From 07ca18caba72e26f5bda3a03c6eb2ba0d9556735 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 25 Dec 2023 05:28:32 +0000 Subject: [PATCH 001/169] file tokens collection --- app/config/collections.php | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/app/config/collections.php b/app/config/collections.php index db229ce87a..06bc1e55a8 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3194,6 +3194,67 @@ $projectCollections = array_merge([ ] ], ], + + 'fileTokens' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('fileTokens'), + 'name' => 'File Tokens', + 'attributes' => [ + [ + '$id' => ID::custom('fileId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('bucketId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expiryDate'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => '_key_file_id_bucket_id', + 'type' => Database::INDEX_KEY, + 'attributes' => ['bucketId', 'fileId'], + 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ] + ], + ], ], $commonCollections); $consoleCollections = array_merge([ From bfa941d69c429132b0e31523c891703760d26b92 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 25 Dec 2023 07:09:35 +0000 Subject: [PATCH 002/169] WIP: file tokens endpoint --- app/controllers/api/storage.php | 378 ++++++++++++++++++++++++++++++++ 1 file changed, 378 insertions(+) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 1fae48dae0..d6e82ecec0 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1485,6 +1485,384 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') $response->noContent(); }); +/** File Tokens */ +App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') + ->desc('Create file') + ->groups(['api', 'storage']) + ->label('scope', 'files.write') + ->label('audits.event', 'fileToken.create') + ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].create') + ->label('audits.resource', 'token/{response.$id}') + ->label('usage.metric', 'fileTokens.{scope}.requests.create') + ->label('usage.params', ['bucketId:{request.bucketId}', 'fileId:{request.fileId}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'createFileToken') + ->label('sdk.description', '/docs/references/storage/create-file-token.md') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('request') + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('queueForEvents') + ->inject('mode') + ->inject('deviceFiles') + ->inject('deviceLocal') + ->action(function (string $bucketId, string $fileId, ?array $permissions, Request $request, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, string $mode, Device $deviceFiles, Device $deviceLocal) { + + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $token = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), new Document([ + '$id' => ID::unique(), + 'secret' => Auth::codeGenerator(128), + 'bucketId' => $bucketId, + 'fileId' => $fileId, + '$permissions' => $permissions + ])); + + $queueForEvents + ->setParam('bucketId', $bucket->getId()) + ->setParam('fileId', $file->getId()) + ->setParam('tokenId', $token->getId()) + ->setContext('bucket', $bucket) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($file, Response::MODEL_FILE_TOKEN); + }); + +App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') + ->desc('List file tokens') + ->groups(['api', 'storage']) + ->label('scope', 'files.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'fileTokens.{scope}.requests.read') + ->label('usage.params', ['bucketId:{request.bucketId}']) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'listFileTokens') + ->label('sdk.description', '/docs/references/storage/list-files.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_FILE_TOKEN_LIST) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) + ->inject('response') + ->inject('dbForProject') + ->inject('mode') + ->action(function (string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject, string $mode) { + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $queries = Query::parseQueries($queries); + // Get cursor document if there was a cursor query + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSORAFTER, Query::TYPE_CURSORBEFORE]); + }); + $cursor = reset($cursor); + if ($cursor) { + /** @var Query $cursor */ + $tokenId = $cursor->getValue(); + $cursorDocument = $dbForProject->getDocument('fileTokens', $tokenId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "File token '{$tokenId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + $filterQueries = Query::groupByType($queries)['filters']; + + $response->dynamic(new Document([ + 'files' => $dbForProject->find('fileTokens', $queries), + 'total' => $dbForProject->count('fileTokens', $filterQueries, APP_LIMIT_COUNT), + ]), Response::MODEL_FILE_TOKEN_LIST); + }); + +App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') + ->desc('Get file token') + ->groups(['api', 'storage']) + ->label('scope', 'files.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'fileTokens.{scope}.requests.read') + ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'getFileToken') + ->label('sdk.description', '/docs/references/storage/get-file-token.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File ID.') + ->param('tokenId', '', new UID(), 'File token ID.') + ->inject('response') + ->inject('dbForProject') + ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject) { + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $response->dynamic($file, Response::MODEL_FILE_TOKEN); + }); + +App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') + ->desc('Update file token permission') + ->groups(['api', 'storage']) + ->label('scope', 'files.write') + ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].update') + ->label('audits.event', 'fileTokens.update') + ->label('audits.resource', 'fileTokens/{response.$id}') + ->label('usage.metric', 'filesTokens.{scope}.requests.update') + ->label('usage.params', ['bucketId:{request.bucketId}', 'fileId:{request.tokenId}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'updateFileToken') + ->label('sdk.description', '/docs/references/storage/update-file.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('tokenId', '', new UID(), 'File token unique ID.') + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('mode') + ->inject('queueForEvents') + ->action(function (string $bucketId, string $fileId, string $tokenId, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { + + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + // Read permission should not be required for update + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $token = $dbForProject->getDocument('fileTokens', $tokenId); + + if($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions, [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]); + + // Users can only manage their own roles, API keys and Admin users can manage any + $roles = Authorization::getRoles(); + if (!Auth::isAppUser($roles) && !Auth::isPrivilegedUser($roles) && !\is_null($permissions)) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); + } + } + } + } + + if (\is_null($permissions)) { + $permissions = $token->getPermissions() ?? []; + } + + $token->setAttribute('$permissions', $permissions); + + $token = $dbForProject->updateDocument('fileTokens', $tokenId, $token); + + $queueForEvents + ->setParam('bucketId', $bucket->getId()) + ->setParam('fileId', $file->getId()) + ->setParam('tokenId', $token->getId()) + ->setContext('bucket', $bucket) + ; + + $response->dynamic($file, Response::MODEL_FILE_TOKEN); + }); + +App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') + ->desc('Delete file token') + ->groups(['api', 'storage']) + ->label('scope', 'files.write') + ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].delete') + ->label('audits.event', 'fileToken.delete') + ->label('audits.resource', 'token/{request.tokenId}') + ->label('usage.metric', 'fileTokens.{scope}.requests.delete') + ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'deleteFileToken') + ->label('sdk.description', '/docs/references/storage/delete-file.md') + ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) + ->label('sdk.response.model', Response::MODEL_NONE) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File ID.') + ->param('tokenId', '', new UID(), 'File token ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('mode') + ->inject('deviceFiles') + ->inject('queueForDeletes') + ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents, string $mode, Device $deviceFiles, Delete $queueForDeletes) { + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + // Read permission should not be required for delete + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $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->getWrite())) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + $token = $dbForProject->getDocument('fileTokens', $tokenId); + if($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + $dbForProject->deleteDocument('fileTokens', $tokenId); + + $queueForEvents + ->setParam('bucketId', $bucket->getId()) + ->setParam('fileId', $file->getId()) + ->setParam('tokenId', $token->getId()) + ->setContext('bucket', $bucket) + ->setPayload($response->output($file, Response::MODEL_FILE_TOKEN)) + ; + + $response->noContent(); + }); + App::get('/v1/storage/usage') ->desc('Get usage stats for storage') ->groups(['api', 'storage', 'usage']) From 2e39fbe70f171b9432cb2e4c6da227a7bdfddac3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 26 Dec 2023 23:52:20 +0000 Subject: [PATCH 003/169] improve file token create --- app/controllers/api/storage.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index d6e82ecec0..adea1e651b 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1,7 +1,6 @@ desc('Create bucket') @@ -1487,7 +1487,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') /** File Tokens */ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') - ->desc('Create file') + ->desc('Create file token') ->groups(['api', 'storage']) ->label('scope', 'files.write') ->label('audits.event', 'fileToken.create') @@ -1495,7 +1495,7 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('audits.resource', 'token/{response.$id}') ->label('usage.metric', 'fileTokens.{scope}.requests.create') ->label('usage.params', ['bucketId:{request.bucketId}', 'fileId:{request.fileId}']) - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) @@ -1506,18 +1506,14 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('expiryDate', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('request') ->inject('response') ->inject('dbForProject') ->inject('user') ->inject('queueForEvents') - ->inject('mode') - ->inject('deviceFiles') - ->inject('deviceLocal') - ->action(function (string $bucketId, string $fileId, ?array $permissions, Request $request, Response $response, Database $dbForProject, Document $user, Event $queueForEvents, string $mode, Device $deviceFiles, Device $deviceLocal) { - + ->action(function (string $bucketId, string $fileId, ?string $expiryDate, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1549,6 +1545,7 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') 'secret' => Auth::codeGenerator(128), 'bucketId' => $bucketId, 'fileId' => $fileId, + 'expiryDate' => $expiryDate, '$permissions' => $permissions ])); From 9ccdabb8e99c05e91fe82c313578a5b33232472e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 26 Dec 2023 23:59:31 +0000 Subject: [PATCH 004/169] improve collection config --- app/config/collections.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index 06bc1e55a8..f787ad8550 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3211,6 +3211,17 @@ $projectCollections = array_merge([ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('fileInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('bucketId'), 'type' => Database::VAR_STRING, @@ -3222,6 +3233,17 @@ $projectCollections = array_merge([ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('bucketInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], [ '$id' => ID::custom('secret'), 'type' => Database::VAR_STRING, @@ -3249,10 +3271,18 @@ $projectCollections = array_merge([ [ '$id' => '_key_file_id_bucket_id', 'type' => Database::INDEX_KEY, - 'attributes' => ['bucketId', 'fileId'], + 'attributes' => ['bucketInternalId', 'fileInternalId'], 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ] + ], + [ + '$id' => '_key_expiry_date', + 'type' => Database::INDEX_KEY, + 'attributes' => ['expiryDate'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], ], ], $commonCollections); From 92c2e26f3a9415a9bcdffb12d4349526cd643213 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 26 Dec 2023 23:59:41 +0000 Subject: [PATCH 005/169] improve list file tokens --- app/controllers/api/storage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index adea1e651b..21c4b40116 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1545,6 +1545,8 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') 'secret' => Auth::codeGenerator(128), 'bucketId' => $bucketId, 'fileId' => $fileId, + 'bucketInternalId' => $bucket->getInternalId(), + 'fileInternalId' => $file->getInternalId(), 'expiryDate' => $expiryDate, '$permissions' => $permissions ])); @@ -1570,7 +1572,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('usage.params', ['bucketId:{request.bucketId}']) ->label('sdk.namespace', 'storage') ->label('sdk.method', 'listFileTokens') - ->label('sdk.description', '/docs/references/storage/list-files.md') + ->label('sdk.description', '/docs/references/storage/list-file-tokens.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_FILE_TOKEN_LIST) @@ -1579,8 +1581,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->inject('mode') - ->action(function (string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject, string $mode) { + ->action(function (string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1625,6 +1626,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') $cursor->setValue($cursorDocument); } + $queries = [...$queries, Query::equal('bucketInternalId', [$bucket->getInternalId()]), Query::equal('fileInternalId', [$file->getInternalId()])]; $filterQueries = Query::groupByType($queries)['filters']; $response->dynamic(new Document([ From 23d0aae23bf4db178d017f1b7fe50f17ede9a605 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 27 Dec 2023 00:03:16 +0000 Subject: [PATCH 006/169] improve get file token --- app/controllers/api/storage.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 21c4b40116..f8388a682b 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1680,7 +1680,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $response->dynamic($file, Response::MODEL_FILE_TOKEN); + $token = $dbForProject->getDocument('fileTokens', $tokenId); + + if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); + } + + $response->dynamic($token, Response::MODEL_FILE_TOKEN); }); App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') From b23369c5480fcc7c7035140fdb60f6d4d8ecda67 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 27 Dec 2023 02:15:59 +0000 Subject: [PATCH 007/169] improve token endpoints --- app/controllers/api/storage.php | 49 +++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index f8388a682b..dc9b63bb92 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1690,7 +1690,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') }); App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') - ->desc('Update file token permission') + ->desc('Update file token') ->groups(['api', 'storage']) ->label('scope', 'files.write') ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].update') @@ -1711,13 +1711,14 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('tokenId', '', new UID(), 'File token unique ID.') + ->param('expiryDate', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') ->inject('user') ->inject('mode') ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, string $tokenId, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { + ->action(function (string $bucketId, string $fileId, string $tokenId, ?string $expiryDate, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); @@ -1729,14 +1730,17 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_UPDATE); - $valid = $validator->isValid($bucket->getUpdate()); + $validator = new Authorization(Database::PERMISSION_READ); + $valid = $validator->isValid($bucket->getRead()); if (!$fileSecurity && !$valid) { throw new Exception(Exception::USER_UNAUTHORIZED); } - // Read permission should not be required for update - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -1744,8 +1748,8 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') $token = $dbForProject->getDocument('fileTokens', $tokenId); - if($token->isEmpty()) { - throw new Exception(Exception::TOKEN_NOT_FOUND); + if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } // Map aggregate permissions into the multiple permissions they represent. @@ -1780,7 +1784,9 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') $permissions = $token->getPermissions() ?? []; } - $token->setAttribute('$permissions', $permissions); + $token + ->setAttribute('expiryDate', $expiryDate) + ->setAttribute('$permissions', $permissions); $token = $dbForProject->updateDocument('fileTokens', $tokenId, $token); @@ -1818,10 +1824,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->inject('mode') - ->inject('deviceFiles') - ->inject('queueForDeletes') - ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents, string $mode, Device $deviceFiles, Delete $queueForDeletes) { + ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1832,27 +1835,25 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') } $fileSecurity = $bucket->getAttribute('fileSecurity', false); - $validator = new Authorization(Database::PERMISSION_DELETE); - $valid = $validator->isValid($bucket->getDelete()); + $validator = new Authorization(Database::PERMISSION_READ); + $valid = $validator->isValid($bucket->getRead()); if (!$fileSecurity && !$valid) { throw new Exception(Exception::USER_UNAUTHORIZED); } - // Read permission should not be required for delete - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $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->getWrite())) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - $token = $dbForProject->getDocument('fileTokens', $tokenId); - if($token->isEmpty()) { - throw new Exception(Exception::TOKEN_NOT_FOUND); + if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } $dbForProject->deleteDocument('fileTokens', $tokenId); From 324f65c8380114f913b93fc9108fd40b18600d63 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 27 Dec 2023 02:21:53 +0000 Subject: [PATCH 008/169] token response model --- src/Appwrite/Utopia/Response.php | 5 ++ .../Utopia/Response/Model/FileToken.php | 71 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/Appwrite/Utopia/Response/Model/FileToken.php diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 7e52536eed..0dcb848a05 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -67,6 +67,7 @@ use Appwrite\Utopia\Response\Model\Project; use Appwrite\Utopia\Response\Model\Rule; use Appwrite\Utopia\Response\Model\Deployment; use Appwrite\Utopia\Response\Model\Detection; +use Appwrite\Utopia\Response\Model\FileToken; use Appwrite\Utopia\Response\Model\Headers; use Appwrite\Utopia\Response\Model\TemplateEmail; use Appwrite\Utopia\Response\Model\Token; @@ -175,6 +176,8 @@ class Response extends SwooleResponse public const MODEL_FILE_LIST = 'fileList'; public const MODEL_BUCKET = 'bucket'; public const MODEL_BUCKET_LIST = 'bucketList'; + public const MODEL_FILE_TOKEN = 'fileToken'; + public const MODEL_FILE_TOKEN_LIST = 'fileTokenList'; // Locale public const MODEL_LOCALE = 'locale'; @@ -303,6 +306,7 @@ class Response extends SwooleResponse ->setModel(new BaseList('Logs List', self::MODEL_LOG_LIST, 'logs', self::MODEL_LOG)) ->setModel(new BaseList('Files List', self::MODEL_FILE_LIST, 'files', self::MODEL_FILE)) ->setModel(new BaseList('Buckets List', self::MODEL_BUCKET_LIST, 'buckets', self::MODEL_BUCKET)) + ->setModel(new BaseList('File Tokens List', self::MODEL_FILE_TOKEN_LIST, 'tokens', self::MODEL_FILE_TOKEN)) ->setModel(new BaseList('Teams List', self::MODEL_TEAM_LIST, 'teams', self::MODEL_TEAM)) ->setModel(new BaseList('Memberships List', self::MODEL_MEMBERSHIP_LIST, 'memberships', self::MODEL_MEMBERSHIP)) ->setModel(new BaseList('Functions List', self::MODEL_FUNCTION_LIST, 'functions', self::MODEL_FUNCTION)) @@ -366,6 +370,7 @@ class Response extends SwooleResponse ->setModel(new LocaleCode()) ->setModel(new File()) ->setModel(new Bucket()) + ->setModel(new FileToken()) ->setModel(new Team()) ->setModel(new Membership()) ->setModel(new Func()) diff --git a/src/Appwrite/Utopia/Response/Model/FileToken.php b/src/Appwrite/Utopia/Response/Model/FileToken.php new file mode 100644 index 0000000000..c308120ff9 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/FileToken.php @@ -0,0 +1,71 @@ +addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Token ID.', + 'default' => '', + 'example' => 'bb8ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Token creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('bucketId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Bucket ID.', + 'default' => '', + 'example' => '5e5ea5c168bb8', + ]) + ->addRule('fileId', [ + 'type' => self::TYPE_STRING, + 'description' => 'File ID.', + 'default' => '', + 'example' => '5e5ea5c168bb8', + ]) + ->addRule('secret', [ + 'type' => self::TYPE_STRING, + 'description' => 'Token secret key.', + 'default' => '', + 'example' => '', + ]) + ->addRule('expiryDate', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Token expiration date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'FileToken'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_FILE_TOKEN; + } +} From eb1562f56b21a9eead9896b864922a29f19e8459 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 28 Dec 2023 10:48:42 +0000 Subject: [PATCH 009/169] rename param to expiry for consistency --- app/config/collections.php | 6 +++--- app/controllers/api/storage.php | 21 +++++++++---------- .../Utopia/Response/Model/FileToken.php | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index f787ad8550..a0b6fb80b8 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3248,7 +3248,7 @@ $projectCollections = array_merge([ '$id' => ID::custom('secret'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 512, 'signed' => true, 'required' => false, 'default' => [], @@ -3256,7 +3256,7 @@ $projectCollections = array_merge([ 'filters' => ['encrypt'], ], [ - '$id' => ID::custom('expiryDate'), + '$id' => ID::custom('expire'), 'type' => Database::VAR_DATETIME, 'format' => '', 'size' => 255, @@ -3278,7 +3278,7 @@ $projectCollections = array_merge([ [ '$id' => '_key_expiry_date', 'type' => Database::INDEX_KEY, - 'attributes' => ['expiryDate'], + 'attributes' => ['expire'], 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index dc9b63bb92..1d3234c3cc 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1507,13 +1507,13 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') - ->param('expiryDate', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) + ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') ->inject('user') ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, ?string $expiryDate, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) { + ->action(function (string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1539,15 +1539,14 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), new Document([ '$id' => ID::unique(), - 'secret' => Auth::codeGenerator(128), + 'secret' => Auth::tokenGenerator(128), 'bucketId' => $bucketId, 'fileId' => $fileId, 'bucketInternalId' => $bucket->getInternalId(), 'fileInternalId' => $file->getInternalId(), - 'expiryDate' => $expiryDate, + 'expire' => $expire, '$permissions' => $permissions ])); @@ -1682,7 +1681,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') $token = $dbForProject->getDocument('fileTokens', $tokenId); - if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } @@ -1711,14 +1710,14 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('tokenId', '', new UID(), 'File token unique ID.') - ->param('expiryDate', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) + ->param('expire', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') ->inject('user') ->inject('mode') ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, string $tokenId, ?string $expiryDate, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { + ->action(function (string $bucketId, string $fileId, string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); @@ -1748,7 +1747,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') $token = $dbForProject->getDocument('fileTokens', $tokenId); - if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } @@ -1785,7 +1784,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') } $token - ->setAttribute('expiryDate', $expiryDate) + ->setAttribute('expire', $expire) ->setAttribute('$permissions', $permissions); $token = $dbForProject->updateDocument('fileTokens', $tokenId, $token); @@ -1852,7 +1851,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') } $token = $dbForProject->getDocument('fileTokens', $tokenId); - if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } diff --git a/src/Appwrite/Utopia/Response/Model/FileToken.php b/src/Appwrite/Utopia/Response/Model/FileToken.php index c308120ff9..2f320ffc79 100644 --- a/src/Appwrite/Utopia/Response/Model/FileToken.php +++ b/src/Appwrite/Utopia/Response/Model/FileToken.php @@ -40,7 +40,7 @@ class FileToken extends Model 'default' => '', 'example' => '', ]) - ->addRule('expiryDate', [ + ->addRule('expire', [ 'type' => self::TYPE_DATETIME, 'description' => 'Token expiration date in ISO 8601 format.', 'default' => '', From a28312be460eda83e4ef402f25466201dabc4cbc Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 02:23:08 +0000 Subject: [PATCH 010/169] refactor collections --- app/config/collections.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index a0b6fb80b8..7c573bc786 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3195,13 +3195,13 @@ $projectCollections = array_merge([ ], ], - 'fileTokens' => [ + 'resource_tokens' => [ '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('fileTokens'), - 'name' => 'File Tokens', + '$id' => ID::custom('resource_tokens'), + 'name' => 'Resource Tokens', 'attributes' => [ [ - '$id' => ID::custom('fileId'), + '$id' => ID::custom('resourceId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -3212,7 +3212,7 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('fileInternalId'), + '$id' => ID::custom('resourceInternalId'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => Database::LENGTH_KEY, @@ -3223,21 +3223,10 @@ $projectCollections = array_merge([ 'filters' => [], ], [ - '$id' => ID::custom('bucketId'), + '$id' => ID::custom('resourceType'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('bucketInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, + 'size' => 100, 'signed' => true, 'required' => true, 'default' => null, @@ -3268,13 +3257,6 @@ $projectCollections = array_merge([ ] ], 'indexes' => [ - [ - '$id' => '_key_file_id_bucket_id', - 'type' => Database::INDEX_KEY, - 'attributes' => ['bucketInternalId', 'fileInternalId'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], [ '$id' => '_key_expiry_date', 'type' => Database::INDEX_KEY, From c1c98e4ac828df8655560db6c855261bb1177c7f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 02:46:52 +0000 Subject: [PATCH 011/169] improve API to new data structure and supprot JWT --- app/controllers/api/storage.php | 96 +++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 16 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 0977efd874..f9c20b032d 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1,5 +1,6 @@ createDocument('bucket_' . $bucket->getInternalId(), new Document([ '$id' => ID::unique(), 'secret' => Auth::tokenGenerator(128), - 'bucketId' => $bucketId, - 'fileId' => $fileId, - 'bucketInternalId' => $bucket->getInternalId(), - 'fileInternalId' => $file->getInternalId(), + 'resourceId' => $bucketId . ':' . $fileId, + 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), + 'resourceType' => 'file', 'expire' => $expire, '$permissions' => $permissions ])); @@ -1649,7 +1649,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($cursor) { /** @var Query $cursor */ $tokenId = $cursor->getValue(); - $cursorDocument = $dbForProject->getDocument('fileTokens', $tokenId); + $cursorDocument = $dbForProject->getDocument('resource_tokens', $tokenId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "File token '{$tokenId}' for the 'cursor' value not found."); @@ -1658,12 +1658,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') $cursor->setValue($cursorDocument); } - $queries = [...$queries, Query::equal('bucketInternalId', [$bucket->getInternalId()]), Query::equal('fileInternalId', [$file->getInternalId()])]; + $queries = [...$queries, Query::equal('resourceInternalId', [$bucket->getInternalId() . ':' . $file->getInternalId()]), Query::equal('resourceType', ['file'])]; $filterQueries = Query::groupByType($queries)['filters']; $response->dynamic(new Document([ - 'files' => $dbForProject->find('fileTokens', $queries), - 'total' => $dbForProject->count('fileTokens', $filterQueries, APP_LIMIT_COUNT), + 'tokens' => $dbForProject->find('resource_tokens', $queries), + 'total' => $dbForProject->count('resource_tokens', $filterQueries, APP_LIMIT_COUNT), ]), Response::MODEL_FILE_TOKEN_LIST); }); @@ -1712,15 +1712,78 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('fileTokens', $tokenId); + $token = $dbForProject->getDocument('resource_tokens', $tokenId); - if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } $response->dynamic($token, Response::MODEL_FILE_TOKEN); }); +// Get token as JWT +App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') + ->desc('Get file token jwt') + ->groups(['api', 'storage']) + ->label('scope', 'files.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'fileTokens.{scope}.requests.read') + ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'getFileTokenJWT') + ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_JWT) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File ID.') + ->param('tokenId', '', new UID(), 'File token ID.') + ->inject('response') + ->inject('dbForProject') + ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject) { + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $token = $dbForProject->getDocument('resource_tokens', $tokenId); + + if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { + throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); + } + + $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway. + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic(new Document(['jwt' => $jwt->encode([ + 'resourceId' => $token->getAttribute('resourceId'), + 'tokenId' => $token->getId(), + 'secret' => $token->getAttribute('secret') + ])]), Response::MODEL_JWT); + }); + App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->desc('Update file token') ->groups(['api', 'storage']) @@ -1778,9 +1841,9 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('fileTokens', $tokenId); + $token = $dbForProject->getDocument('resource_tokens', $tokenId); - if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } @@ -1820,7 +1883,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->setAttribute('expire', $expire) ->setAttribute('$permissions', $permissions); - $token = $dbForProject->updateDocument('fileTokens', $tokenId, $token); + $token = $dbForProject->updateDocument('resource_tokens', $tokenId, $token); $queueForEvents ->setParam('bucketId', $bucket->getId()) @@ -1883,12 +1946,12 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('fileTokens', $tokenId); - if ($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) { + $token = $dbForProject->getDocument('resource_tokens', $tokenId); + if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } - $dbForProject->deleteDocument('fileTokens', $tokenId); + $dbForProject->deleteDocument('resource_tokens', $tokenId); $queueForEvents ->setParam('bucketId', $bucket->getId()) @@ -1901,6 +1964,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') $response->noContent(); }); +/** Storage usage */ App::get('/v1/storage/usage') ->desc('Get usage stats for storage') ->groups(['api', 'storage', 'usage']) From 56087b691b77f972ebad70ae4e470306c977ce2d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 03:03:07 +0000 Subject: [PATCH 012/169] verify and inject resource token --- app/init.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/app/init.php b/app/init.php index 924122ac20..8cdd0cbdd1 100644 --- a/app/init.php +++ b/app/init.php @@ -970,6 +970,50 @@ App::setResource('clients', function ($request, $console, $project) { return $clients; }, ['request', 'console', 'project']); +App::setResource('resourceToken', function ($project, $dbForProject, $request) { + $tokenJWT = $request->getParam('token'); + + if (!empty($tokenJWT) && !$project->isEmpty()) { // JWT authentication + $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway. + + try { + $payload = $jwt->decode($tokenJWT); + } catch (JWTException $error) { + return new Document([]); + } + + $tokenId = $payload['tokenId'] ?? ''; + $secret = $payload['secret'] ?? ''; + + if (empty($tokenId) || empty($secret)) { + return new Document([]); + } + + $token = $dbForProject->getDocument('resource_tokens', $tokenId); + + if ($token->isEmpty() || $token->getAttribute('secret') != $secret) { + return new Document([]); + } + + if ($token->getAttribute('resourceType') === 'file') { + $internalIds = explode(':', $token->getAttribute('resourceInternalId')); + $ids = explode(':', $token->getAttribute('resourceId')); + + if (count($internalIds) != 2 || count($ids) != 2) { + return new Document([]); + } + + return new Document([ + 'bucketId' => $ids[0], + 'fileId' => $ids[1], + 'bucketInternalId' => $internalIds[0], + 'fileInternalId' => $internalIds[1], + ]); + } + return new Document([]); + } +}); + App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForConsole) { /** @var Appwrite\Utopia\Request $request */ /** @var Appwrite\Utopia\Response $response */ From 1065abb0a7dc2ac8e6797ea28c02eff6515044bf Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 04:57:10 +0000 Subject: [PATCH 013/169] update preview to use token --- app/controllers/api/storage.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index f9c20b032d..80b80e8f00 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -874,10 +874,11 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->inject('response') ->inject('project') ->inject('dbForProject') + ->inject('resourceToken') ->inject('mode') ->inject('deviceFiles') ->inject('deviceLocal') - ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Request $request, Response $response, Document $project, Database $dbForProject, string $mode, Device $deviceFiles, Device $deviceLocal) { + ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Request $request, Response $response, Document $project, Database $dbForProject, Document $resourceToken, string $mode, Device $deviceFiles, Device $deviceLocal) { if (!\extension_loaded('imagick')) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing'); @@ -892,19 +893,24 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') == $bucket->getInternalId(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); - if (!$fileSecurity && !$valid) { + if (!$fileSecurity && !$valid && !$isToken) { throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { + if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } + if($resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } From fa40a33631b0aca36bd25e63471e27e717975499 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 06:53:22 +0000 Subject: [PATCH 014/169] fixes and refactor --- app/config/collections.php | 4 +-- app/controllers/api/storage.php | 36 ++++++++++++------- app/controllers/shared/api.php | 12 +++++-- app/init.php | 7 ++-- .../Database/Validator/Queries/FileTokens.php | 19 ++++++++++ src/Appwrite/Utopia/Response.php | 10 +++--- .../{FileToken.php => ResourceToken.php} | 22 +++++------- 7 files changed, 70 insertions(+), 40 deletions(-) create mode 100644 src/Appwrite/Utopia/Database/Validator/Queries/FileTokens.php rename src/Appwrite/Utopia/Response/Model/{FileToken.php => ResourceToken.php} (72%) diff --git a/app/config/collections.php b/app/config/collections.php index 7c573bc786..a043486b79 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -3239,8 +3239,8 @@ $projectCollections = array_merge([ 'format' => '', 'size' => 512, 'signed' => true, - 'required' => false, - 'default' => [], + 'required' => true, + 'default' => null, 'array' => false, 'filters' => ['encrypt'], ], diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 80b80e8f00..38b60e0661 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -46,6 +46,7 @@ use Utopia\Swoole\Request; use Utopia\Validator\Nullable; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Storage\Compression\Compression; +use Appwrite\Utopia\Database\Validator\Queries\FileTokens; App::post('/v1/storage/buckets') ->desc('Create bucket') @@ -907,7 +908,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } - if($resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -1544,11 +1545,11 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('sdk.description', '/docs/references/storage/create-file-token.md') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') ->inject('user') @@ -1579,7 +1580,8 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), new Document([ + + $token = $dbForProject->createDocument('resource_tokens', new Document([ '$id' => ID::unique(), 'secret' => Auth::tokenGenerator(128), 'resourceId' => $bucketId . ':' . $fileId, @@ -1598,7 +1600,7 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') $response ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($file, Response::MODEL_FILE_TOKEN); + ->dynamic($token, Response::MODEL_RESOURCE_TOKEN); }); App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') @@ -1613,7 +1615,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') ->label('sdk.description', '/docs/references/storage/list-file-tokens.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_TOKEN_LIST) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN_LIST) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) @@ -1670,7 +1672,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') $response->dynamic(new Document([ 'tokens' => $dbForProject->find('resource_tokens', $queries), 'total' => $dbForProject->count('resource_tokens', $filterQueries, APP_LIMIT_COUNT), - ]), Response::MODEL_FILE_TOKEN_LIST); + ]), Response::MODEL_RESOURCE_TOKEN_LIST); }); App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') @@ -1685,7 +1687,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->label('sdk.description', '/docs/references/storage/get-file-token.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->param('tokenId', '', new UID(), 'File token ID.') @@ -1724,7 +1726,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } - $response->dynamic($token, Response::MODEL_FILE_TOKEN); + $response->dynamic($token, Response::MODEL_RESOURCE_TOKEN); }); // Get token as JWT @@ -1779,6 +1781,16 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } + // calculate maxAge based on expiry date + $maxAge = PHP_INT_MAX; + $expire = $token->getAttribute('expire'); + if ($expire != null) { + $now = new \DateTime(); + $expiryDate = new \DateTime($expire); + $maxAge = $expiryDate->getTimestamp() - $now->getTimestamp(); + ; + } + $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway. $response @@ -1808,7 +1820,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->label('sdk.description', '/docs/references/storage/update-file.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_TOKEN) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('tokenId', '', new UID(), 'File token unique ID.') @@ -1898,7 +1910,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->setContext('bucket', $bucket) ; - $response->dynamic($file, Response::MODEL_FILE_TOKEN); + $response->dynamic($file, Response::MODEL_RESOURCE_TOKEN); }); App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') @@ -1964,7 +1976,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->setParam('fileId', $file->getId()) ->setParam('tokenId', $token->getId()) ->setContext('bucket', $bucket) - ->setPayload($response->output($file, Response::MODEL_FILE_TOKEN)) + ->setPayload($response->output($file, Response::MODEL_RESOURCE_TOKEN)) ; $response->noContent(); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 05cfddd276..1f31fa5402 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -101,10 +101,11 @@ App::init() ->inject('queueForDeletes') ->inject('queueForDatabase') ->inject('dbForProject') + ->inject('resourceToken') ->inject('mode') ->inject('queueForMails') ->inject('usage') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Database $dbForProject, string $mode, Mail $queueForMails, Stats $usage) use ($databaseListener) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Database $dbForProject, Document $resourceToken, string $mode, Mail $queueForMails, Stats $usage) use ($databaseListener) { $route = $utopia->getRoute(); @@ -223,6 +224,7 @@ App::init() $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') == $bucket->getInternalId(); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -233,19 +235,23 @@ App::init() $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); - if (!$fileSecurity && !$valid) { + if (!$fileSecurity && !$valid && !$isToken) { throw new Exception(Exception::USER_UNAUTHORIZED); } $parts = explode('/', $data['resource']); $fileId = $parts[1] ?? null; - if ($fileSecurity && !$valid) { + if ($fileSecurity && !$valid && !$isToken) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } diff --git a/app/init.php b/app/init.php index 8cdd0cbdd1..ea88cd0c02 100644 --- a/app/init.php +++ b/app/init.php @@ -984,12 +984,11 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { $tokenId = $payload['tokenId'] ?? ''; $secret = $payload['secret'] ?? ''; - if (empty($tokenId) || empty($secret)) { return new Document([]); } - $token = $dbForProject->getDocument('resource_tokens', $tokenId); + $token = Authorization::skip(fn() => $dbForProject->getDocument('resource_tokens', $tokenId)); if ($token->isEmpty() || $token->getAttribute('secret') != $secret) { return new Document([]); @@ -1010,9 +1009,9 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { 'fileInternalId' => $internalIds[1], ]); } - return new Document([]); } -}); + return new Document([]); +}, ['project', 'dbForProject', 'request']); App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForConsole) { /** @var Appwrite\Utopia\Request $request */ diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/FileTokens.php b/src/Appwrite/Utopia/Database/Validator/Queries/FileTokens.php new file mode 100644 index 0000000000..c712ab3261 --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/FileTokens.php @@ -0,0 +1,19 @@ +setModel(new BaseList('Logs List', self::MODEL_LOG_LIST, 'logs', self::MODEL_LOG)) ->setModel(new BaseList('Files List', self::MODEL_FILE_LIST, 'files', self::MODEL_FILE)) ->setModel(new BaseList('Buckets List', self::MODEL_BUCKET_LIST, 'buckets', self::MODEL_BUCKET)) - ->setModel(new BaseList('File Tokens List', self::MODEL_FILE_TOKEN_LIST, 'tokens', self::MODEL_FILE_TOKEN)) + ->setModel(new BaseList('Resource Tokens List', self::MODEL_RESOURCE_TOKEN_LIST, 'tokens', self::MODEL_RESOURCE_TOKEN)) ->setModel(new BaseList('Teams List', self::MODEL_TEAM_LIST, 'teams', self::MODEL_TEAM)) ->setModel(new BaseList('Memberships List', self::MODEL_MEMBERSHIP_LIST, 'memberships', self::MODEL_MEMBERSHIP)) ->setModel(new BaseList('Functions List', self::MODEL_FUNCTION_LIST, 'functions', self::MODEL_FUNCTION)) @@ -370,7 +370,7 @@ class Response extends SwooleResponse ->setModel(new LocaleCode()) ->setModel(new File()) ->setModel(new Bucket()) - ->setModel(new FileToken()) + ->setModel(new ResourceToken()) ->setModel(new Team()) ->setModel(new Membership()) ->setModel(new Func()) diff --git a/src/Appwrite/Utopia/Response/Model/FileToken.php b/src/Appwrite/Utopia/Response/Model/ResourceToken.php similarity index 72% rename from src/Appwrite/Utopia/Response/Model/FileToken.php rename to src/Appwrite/Utopia/Response/Model/ResourceToken.php index 2f320ffc79..f3bbc5fccc 100644 --- a/src/Appwrite/Utopia/Response/Model/FileToken.php +++ b/src/Appwrite/Utopia/Response/Model/ResourceToken.php @@ -5,7 +5,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; -class FileToken extends Model +class ResourceToken extends Model { public function __construct() { @@ -22,23 +22,17 @@ class FileToken extends Model 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, ]) - ->addRule('bucketId', [ + ->addRule('resourceId', [ 'type' => self::TYPE_STRING, - 'description' => 'Bucket ID.', + 'description' => 'Resource ID.', 'default' => '', - 'example' => '5e5ea5c168bb8', + 'example' => '5e5ea5c168bb8:5e5ea5c168bb8', ]) - ->addRule('fileId', [ + ->addRule('resourceInternalId', [ 'type' => self::TYPE_STRING, 'description' => 'File ID.', 'default' => '', - 'example' => '5e5ea5c168bb8', - ]) - ->addRule('secret', [ - 'type' => self::TYPE_STRING, - 'description' => 'Token secret key.', - 'default' => '', - 'example' => '', + 'example' => '1:1', ]) ->addRule('expire', [ 'type' => self::TYPE_DATETIME, @@ -56,7 +50,7 @@ class FileToken extends Model */ public function getName(): string { - return 'FileToken'; + return 'ResourceToken'; } /** @@ -66,6 +60,6 @@ class FileToken extends Model */ public function getType(): string { - return Response::MODEL_FILE_TOKEN; + return Response::MODEL_RESOURCE_TOKEN; } } From b752d2985407ba2ede65d02470654cc46a928230 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 4 Jan 2024 07:27:06 +0000 Subject: [PATCH 015/169] basic test and fix response model --- .../Utopia/Response/Model/ResourceToken.php | 6 +++++ tests/e2e/Services/Storage/StorageBase.php | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/ResourceToken.php b/src/Appwrite/Utopia/Response/Model/ResourceToken.php index f3bbc5fccc..8f44a55b56 100644 --- a/src/Appwrite/Utopia/Response/Model/ResourceToken.php +++ b/src/Appwrite/Utopia/Response/Model/ResourceToken.php @@ -34,6 +34,12 @@ class ResourceToken extends Model 'default' => '', 'example' => '1:1', ]) + ->addRule('resourceType', [ + 'type' => self::TYPE_STRING, + 'description' => 'Resource type.', + 'default' => '', + 'example' => 'file', + ]) ->addRule('expire', [ 'type' => self::TYPE_DATETIME, 'description' => 'Token expiration date in ISO 8601 format.', diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index c4a15585eb..4ac6ff6e64 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -13,6 +13,9 @@ use Utopia\Database\Validator\Datetime as DatetimeValidator; trait StorageBase { + /** + * @group fileTokens + */ public function testCreateBucketFile(): array { /** @@ -741,6 +744,25 @@ trait StorageBase return $data; } + /** + * @group fileTokens + * @depends testCreateBucketFile + */ + public function testCreateFileToken(array $data): array + { + $bucketId = $data['bucketId']; + $fileId = $data['fileId']; + + $res = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files/' . $fileId . '/tokens', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(201, $res['headers']['status-code']); + $this->assertEquals('file', $res['body']['resourceType']); + return $data; + } + /** * @depends testCreateBucketFileZstdCompression */ From 852137b84d829a2010af02487114fb6210e97219 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Mar 2024 01:53:08 +0000 Subject: [PATCH 016/169] update token test --- tests/e2e/Services/Storage/StorageBase.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 4ac6ff6e64..8e6b0ea88f 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -760,6 +760,30 @@ trait StorageBase $this->assertEquals(201, $res['headers']['status-code']); $this->assertEquals('file', $res['body']['resourceType']); + + $data['tokenId'] = $res['body']['$id']; + return $data; + } + + /** + * @group fileTokens + * @depends testCreateFileToken + */ + public function testUpdateFileToken(array $data): array + { + $bucketId = $data['bucketId']; + $fileId = $data['fileId']; + $tokenId = $data['tokenId']; + + $expiry = DateTime::now(); + $res = $this->client->call(Client::METHOD_PUT,'/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'expiry' => $expiry, + ]); + + $this->assertEquals($expiry, $res['body']['expiry']); return $data; } From c6d524c25d441d013c0c8ae1c5bd732e03ba7eb7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Mar 2024 02:08:22 +0000 Subject: [PATCH 017/169] fix formatting --- app/controllers/api/storage.php | 26 +++++++++++----------- app/init.php | 2 +- tests/e2e/Services/Storage/StorageBase.php | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 2dbac2bbdf..cee95c7b2f 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -11,6 +11,7 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; +use Appwrite\Utopia\Database\Validator\Queries\FileTokens; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -26,6 +27,7 @@ use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; use Utopia\Image\Image; @@ -42,12 +44,10 @@ use Utopia\Swoole\Request; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\HexColor; +use Utopia\Validator\Nullable; use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; -use Utopia\Validator\Nullable; -use Utopia\Database\Validator\Datetime as DatetimeValidator; -use Appwrite\Utopia\Database\Validator\Queries\FileTokens; App::post('/v1/storage/buckets') ->desc('Create bucket') @@ -1725,7 +1725,7 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { @@ -1792,7 +1792,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { @@ -1864,7 +1864,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { @@ -1919,7 +1919,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { @@ -1947,10 +1947,10 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic(new Document(['jwt' => $jwt->encode([ - 'resourceId' => $token->getAttribute('resourceId'), - 'tokenId' => $token->getId(), - 'secret' => $token->getAttribute('secret') - ])]), Response::MODEL_JWT); + 'resourceId' => $token->getAttribute('resourceId'), + 'tokenId' => $token->getId(), + 'secret' => $token->getAttribute('secret') + ])]), Response::MODEL_JWT); }); App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') @@ -2003,7 +2003,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { @@ -2108,7 +2108,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') if ($fileSecurity && !$valid) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { - $file = Authorization::skip(fn() => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); } if ($file->isEmpty()) { diff --git a/app/init.php b/app/init.php index cc0bbeb718..66cbb09aaf 100644 --- a/app/init.php +++ b/app/init.php @@ -1133,7 +1133,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return new Document([]); } - $token = Authorization::skip(fn() => $dbForProject->getDocument('resource_tokens', $tokenId)); + $token = Authorization::skip(fn () => $dbForProject->getDocument('resource_tokens', $tokenId)); if ($token->isEmpty() || $token->getAttribute('secret') != $secret) { return new Document([]); diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 7c1ac8f614..50c937da19 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -784,7 +784,7 @@ trait StorageBase $tokenId = $data['tokenId']; $expiry = DateTime::now(); - $res = $this->client->call(Client::METHOD_PUT,'/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ + $res = $this->client->call(Client::METHOD_PUT, '/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ From 52d27179a9b479ddfd24f73c15d4fae340192879 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Mar 2024 03:01:55 +0000 Subject: [PATCH 018/169] fix jwt response --- app/controllers/api/storage.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index cee95c7b2f..9d902af275 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1947,7 +1947,9 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic(new Document(['jwt' => $jwt->encode([ + 'resourceType' => 'file', 'resourceId' => $token->getAttribute('resourceId'), + 'resourceInternalId' => $token->getAttribute('resourceInternalId'), 'tokenId' => $token->getId(), 'secret' => $token->getAttribute('secret') ])]), Response::MODEL_JWT); From c20504fc7dec8259208b1aba61128a03ef799664 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 30 Jun 2024 08:40:35 +0000 Subject: [PATCH 019/169] missing import --- tests/e2e/Services/Storage/StorageBase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index ce335b95d3..dafdf2fe7c 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -10,6 +10,7 @@ use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Datetime as DatetimeValidator; +use Utopia\Database\DateTime; trait StorageBase { From 61a8457232f57403c43b6e4eeece5e451140d36f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 30 Jun 2024 08:42:05 +0000 Subject: [PATCH 020/169] format --- tests/e2e/Services/Storage/StorageBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index dafdf2fe7c..723eae0e94 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -5,12 +5,12 @@ namespace Tests\E2E\Services\Storage; use Appwrite\Extend\Exception; use CURLFile; use Tests\E2E\Client; +use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Datetime as DatetimeValidator; -use Utopia\Database\DateTime; trait StorageBase { From 0dbc37dacf230cafceea7013ccbd55ae37aa2b68 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 30 Jun 2024 08:53:21 +0000 Subject: [PATCH 021/169] renames and fixes --- app/config/collections.php | 4 ++-- app/controllers/api/storage.php | 20 ++++++++++---------- app/init.php | 2 +- tests/e2e/Services/Storage/StorageBase.php | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index a297ebb761..3eccf84f1f 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -4139,9 +4139,9 @@ $projectCollections = array_merge([ ], ], - 'resource_tokens' => [ + 'resourceTokens' => [ '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('resource_tokens'), + '$id' => ID::custom('resourceTokens'), 'name' => 'Resource Tokens', 'attributes' => [ [ diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 6a9599b138..a2e947f78c 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1706,7 +1706,7 @@ App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->createDocument('resource_tokens', new Document([ + $token = $dbForProject->createDocument('resourceTokens', new Document([ '$id' => ID::unique(), 'secret' => Auth::tokenGenerator(128), 'resourceId' => $bucketId . ':' . $fileId, @@ -1782,7 +1782,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') if ($cursor) { /** @var Query $cursor */ $tokenId = $cursor->getValue(); - $cursorDocument = $dbForProject->getDocument('resource_tokens', $tokenId); + $cursorDocument = $dbForProject->getDocument('resourceTokens', $tokenId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "File token '{$tokenId}' for the 'cursor' value not found."); @@ -1795,8 +1795,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') $filterQueries = Query::groupByType($queries)['filters']; $response->dynamic(new Document([ - 'tokens' => $dbForProject->find('resource_tokens', $queries), - 'total' => $dbForProject->count('resource_tokens', $filterQueries, APP_LIMIT_COUNT), + 'tokens' => $dbForProject->find('resourceTokens', $queries), + 'total' => $dbForProject->count('resourceTokens', $filterQueries, APP_LIMIT_COUNT), ]), Response::MODEL_RESOURCE_TOKEN_LIST); }); @@ -1845,7 +1845,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('resource_tokens', $tokenId); + $token = $dbForProject->getDocument('resourceTokens', $tokenId); if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); @@ -1900,7 +1900,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('resource_tokens', $tokenId); + $token = $dbForProject->getDocument('resourceTokens', $tokenId); if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); @@ -1986,7 +1986,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('resource_tokens', $tokenId); + $token = $dbForProject->getDocument('resourceTokens', $tokenId); if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); @@ -2028,7 +2028,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') ->setAttribute('expire', $expire) ->setAttribute('$permissions', $permissions); - $token = $dbForProject->updateDocument('resource_tokens', $tokenId, $token); + $token = $dbForProject->updateDocument('resourceTokens', $tokenId, $token); $queueForEvents ->setParam('bucketId', $bucket->getId()) @@ -2091,12 +2091,12 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } - $token = $dbForProject->getDocument('resource_tokens', $tokenId); + $token = $dbForProject->getDocument('resourceTokens', $tokenId); if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); } - $dbForProject->deleteDocument('resource_tokens', $tokenId); + $dbForProject->deleteDocument('resourceTokens', $tokenId); $queueForEvents ->setParam('bucketId', $bucket->getId()) diff --git a/app/init.php b/app/init.php index 3efea49e31..e66776cdb0 100644 --- a/app/init.php +++ b/app/init.php @@ -1141,7 +1141,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return new Document([]); } - $token = Authorization::skip(fn () => $dbForProject->getDocument('resource_tokens', $tokenId)); + $token = Authorization::skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId)); if ($token->isEmpty() || $token->getAttribute('secret') != $secret) { return new Document([]); diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 723eae0e94..18bd437107 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -789,10 +789,10 @@ trait StorageBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'expiry' => $expiry, + 'expire' => $expiry, ]); - $this->assertEquals($expiry, $res['body']['expiry']); + $this->assertEquals($expiry, $res['body']['expire']); return $data; } From c21402733faa22daaf2bc45a7793e16ea8b7b00d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Jul 2024 07:16:45 +0000 Subject: [PATCH 022/169] development keys module setup --- app/controllers/api/projects.php | 201 ++++++++++++++++++ app/controllers/general.php | 8 + src/Appwrite/Platform/Appwrite.php | 2 + .../Platform/Modules/DevelopmentKeys.php | 14 ++ .../Modules/DevelopmentKeys/Http/Create.php | 80 +++++++ .../Modules/DevelopmentKeys/Services/Http.php | 15 ++ 6 files changed, 320 insertions(+) create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys.php create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Services/Http.php diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 265efbbfae..058fc7c569 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1383,6 +1383,207 @@ App::delete('/v1/projects/:projectId/keys/:keyId') $response->noContent(); }); + +// Development keys + +App::post('/v1/projects/:projectId/development-keys') + ->desc('Create key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'createKey') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = new Document([ + '$id' => ID::unique(), + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'projectInternalId' => $project->getInternalId(), + 'projectId' => $project->getId(), + 'name' => $name, + 'scopes' => $scopes, + 'expire' => $expire, + 'sdks' => [], + 'accessedAt' => null, + 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), + ]); + + $key = $dbForConsole->createDocument('keys', $key); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($key, Response::MODEL_KEY); + }); + +App::get('/v1/projects/:projectId/keys') + ->desc('List keys') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'listKeys') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $keys = $dbForConsole->find('keys', [ + Query::equal('projectInternalId', [$project->getInternalId()]), + Query::limit(5000), + ]); + + $response->dynamic(new Document([ + 'keys' => $keys, + 'total' => count($keys), + ]), Response::MODEL_KEY_LIST); + }); + +App::get('/v1/projects/:projectId/keys/:keyId') + ->desc('Get key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'getKey') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $response->dynamic($key, Response::MODEL_KEY); + }); + +App::put('/v1/projects/:projectId/keys/:keyId') + ->desc('Update key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'updateKey') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $key + ->setAttribute('name', $name) + ->setAttribute('scopes', $scopes) + ->setAttribute('expire', $expire); + + $dbForConsole->updateDocument('keys', $key->getId(), $key); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response->dynamic($key, Response::MODEL_KEY); + }); + +App::delete('/v1/projects/:projectId/keys/:keyId') + ->desc('Delete key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'deleteKey') + ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) + ->label('sdk.response.model', Response::MODEL_NONE) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $dbForConsole->deleteDocument('keys', $key->getId()); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response->noContent(); + }); + // JWT Keys App::post('/v1/projects/:projectId/jwts') diff --git a/app/controllers/general.php b/app/controllers/general.php index 10c9eb8e18..0ed7d9ff40 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -8,6 +8,7 @@ use Appwrite\Event\Event; use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; +use Appwrite\Platform\Appwrite; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -32,6 +33,7 @@ use Utopia\Locale\Locale; use Utopia\Logger\Log; use Utopia\Logger\Log\User; use Utopia\Logger\Logger; +use Utopia\Platform\Service; use Utopia\System\System; use Utopia\Validator\Hostname; use Utopia\Validator\Text; @@ -992,3 +994,9 @@ App::wildcard() foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } + + +// Modules + +$platform = new Appwrite(); +$platform->init(Service::TYPE_HTTP); diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 6b3eb077fa..e1a27f1b0a 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; +use Appwrite\Platform\Modules\DevelopmentKeys; use Utopia\Platform\Platform; class Appwrite extends Platform @@ -10,5 +11,6 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); + $this->addModule(new DevelopmentKeys()); } } diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys.php b/src/Appwrite/Platform/Modules/DevelopmentKeys.php new file mode 100644 index 0000000000..c351ad92f1 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys.php @@ -0,0 +1,14 @@ +addService('http', new Http()); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php new file mode 100644 index 0000000000..12c60546b4 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -0,0 +1,80 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/projects/:projectId/development-keys') + ->desc('Create key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'createKey') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $name, $expire, $response, $dbForConsole)); + } + + public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForConsole) + { + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = new Document([ + '$id' => ID::unique(), + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'projectInternalId' => $project->getInternalId(), + 'projectId' => $project->getId(), + 'name' => $name, + 'expire' => $expire, + 'sdks' => [], + 'accessedAt' => null, + 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), + ]); + + $key = $dbForConsole->createDocument('development_keys', $key); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($key, Response::MODEL_KEY); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Services/Http.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Services/Http.php new file mode 100644 index 0000000000..f0a5e20605 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Services/Http.php @@ -0,0 +1,15 @@ +type = Service::TYPE_HTTP; + $this->addAction(Create::getName(), new Create()); + } +} From bcde2ea2233613515745b6ea7f37e43c1e26a24c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 10 Jul 2024 07:32:57 +0000 Subject: [PATCH 023/169] remove duplicates --- app/controllers/api/projects.php | 201 ------------------------------- 1 file changed, 201 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 058fc7c569..265efbbfae 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -1383,207 +1383,6 @@ App::delete('/v1/projects/:projectId/keys/:keyId') $response->noContent(); }); - -// Development keys - -App::post('/v1/projects/:projectId/development-keys') - ->desc('Create key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $key = new Document([ - '$id' => ID::unique(), - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - 'projectInternalId' => $project->getInternalId(), - 'projectId' => $project->getId(), - 'name' => $name, - 'scopes' => $scopes, - 'expire' => $expire, - 'sdks' => [], - 'accessedAt' => null, - 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), - ]); - - $key = $dbForConsole->createDocument('keys', $key); - - $dbForConsole->purgeCachedDocument('projects', $project->getId()); - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($key, Response::MODEL_KEY); - }); - -App::get('/v1/projects/:projectId/keys') - ->desc('List keys') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listKeys') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY_LIST) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $keys = $dbForConsole->find('keys', [ - Query::equal('projectInternalId', [$project->getInternalId()]), - Query::limit(5000), - ]); - - $response->dynamic(new Document([ - 'keys' => $keys, - 'total' => count($keys), - ]), Response::MODEL_KEY_LIST); - }); - -App::get('/v1/projects/:projectId/keys/:keyId') - ->desc('Get key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('keyId', '', new UID(), 'Key unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $key = $dbForConsole->findOne('keys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); - - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - - $response->dynamic($key, Response::MODEL_KEY); - }); - -App::put('/v1/projects/:projectId/keys/:keyId') - ->desc('Update key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('keyId', '', new UID(), 'Key unique ID.') - ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $key = $dbForConsole->findOne('keys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); - - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - - $key - ->setAttribute('name', $name) - ->setAttribute('scopes', $scopes) - ->setAttribute('expire', $expire); - - $dbForConsole->updateDocument('keys', $key->getId(), $key); - - $dbForConsole->purgeCachedDocument('projects', $project->getId()); - - $response->dynamic($key, Response::MODEL_KEY); - }); - -App::delete('/v1/projects/:projectId/keys/:keyId') - ->desc('Delete key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteKey') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('keyId', '', new UID(), 'Key unique ID.') - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $key = $dbForConsole->findOne('keys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); - - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - - $dbForConsole->deleteDocument('keys', $key->getId()); - - $dbForConsole->purgeCachedDocument('projects', $project->getId()); - - $response->noContent(); - }); - // JWT Keys App::post('/v1/projects/:projectId/jwts') From c058d30d0a1f2fc4949a7c3d0c1db8f4e4624f5e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Jul 2024 05:20:56 +0000 Subject: [PATCH 024/169] all endpoints for development keys --- .../Modules/DevelopmentKeys/Http/Create.php | 28 ++++---- .../Modules/DevelopmentKeys/Http/Delete.php | 63 +++++++++++++++++ .../Modules/DevelopmentKeys/Http/Get.php | 60 ++++++++++++++++ .../Modules/DevelopmentKeys/Http/Update.php | 70 +++++++++++++++++++ .../Modules/DevelopmentKeys/Http/XList.php | 59 ++++++++++++++++ 5 files changed, 266 insertions(+), 14 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php index 12c60546b4..f8b4f75ea2 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -29,20 +29,20 @@ class Create extends Action ->setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) ->setHttpPath('/v1/projects/:projectId/development-keys') ->desc('Create key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) - ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $name, $expire, $response, $dbForConsole)); + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'createKey') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $name, $expire, $response, $dbForConsole)); } public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForConsole) diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php new file mode 100644 index 0000000000..414f8d59a7 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php @@ -0,0 +1,63 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->desc('Delete key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'deleteDevelopmentKey') + ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) + ->label('sdk.response.model', Response::MODEL_NONE) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $keyId, $response, $dbForConsole) => $this->action($projectId, $keyId, $response, $dbForConsole)); + } + + public function action(string $projectId, string $keyId, Response $response, Database $dbForConsole) + { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('development_keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $dbForConsole->deleteDocument('keys', $key->getId()); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php new file mode 100644 index 0000000000..ed481182a1 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php @@ -0,0 +1,60 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->desc('Get key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'getDevelopmentKey') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $keyId, $response, $dbForConsole) => $this->action($projectId, $keyId, $response, $dbForConsole)); + } + + public function action(string $projectId, string $keyId, Response $response, Database $dbForConsole) + { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('development_keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $response->dynamic($key, Response::MODEL_KEY); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php new file mode 100644 index 0000000000..5ab8af6321 --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php @@ -0,0 +1,70 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->desc('Update key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'updateDevelopmentKey') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); + } + public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForConsole) + { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('development_keys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $key + ->setAttribute('name', $name) + ->setAttribute('expire', $expire); + + $dbForConsole->updateDocument('keys', $key->getId(), $key); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response->dynamic($key, Response::MODEL_KEY); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php new file mode 100644 index 0000000000..4304e5ef7e --- /dev/null +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php @@ -0,0 +1,59 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/projects/:projectId/development-keys') + ->desc('List keys') + ->groups(['api', 'projects']) + ->label('scope', 'projects.read') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'listKeys') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $response, $dbForConsole) => $this->action($projectId, $response, $dbForConsole)); + } + + public function action(string $projectId, Response $response, Database $dbForConsole) + { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $keys = $dbForConsole->find('development_keys', [ + Query::equal('projectInternalId', [$project->getInternalId()]), + Query::limit(5000), + ]); + + $response->dynamic(new Document([ + 'keys' => $keys, + 'total' => count($keys), + ]), Response::MODEL_KEY_LIST); + } +} From af3dc25e2c41afa5519f9287142726096e5c7f60 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Jul 2024 07:48:21 +0000 Subject: [PATCH 025/169] add new endpoints to module --- .../Platform/Modules/DevelopmentKeys/Http/Delete.php | 1 + .../Platform/Modules/DevelopmentKeys/Http/Get.php | 1 + .../Platform/Modules/DevelopmentKeys/Http/Update.php | 1 + .../Platform/Modules/DevelopmentKeys/Http/XList.php | 1 + .../Platform/Modules/DevelopmentKeys/Services/Http.php | 8 ++++++++ 5 files changed, 12 insertions(+) diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php index 414f8d59a7..a599b660d9 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php @@ -1,4 +1,5 @@ type = Service::TYPE_HTTP; $this->addAction(Create::getName(), new Create()); + $this->addAction(Update::getName(), new Update()); + $this->addAction(Get::getName(), new Get()); + $this->addAction(XList::getName(), new XList()); + $this->addAction(Delete::getName(), new Delete()); } } From 03000c3ad09a624a80fbb18fbcf00a30740a6c7d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Jul 2024 07:50:42 +0000 Subject: [PATCH 026/169] add collection for development keys --- app/config/collections.php | 101 ++++++++++++++++++ .../Modules/DevelopmentKeys/Http/Create.php | 2 +- .../Modules/DevelopmentKeys/Http/Delete.php | 2 +- .../Modules/DevelopmentKeys/Http/Get.php | 2 +- .../Modules/DevelopmentKeys/Http/Update.php | 2 +- .../Modules/DevelopmentKeys/Http/XList.php | 2 +- 6 files changed, 106 insertions(+), 5 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index e02e25829f..c2b450b353 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -4808,6 +4808,107 @@ $consoleCollections = array_merge([ ], ], + 'developmentKeys' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('developmentKeys'), + 'name' => 'keys', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // var_dump of \bin2hex(\random_bytes(128)) => string(256) doubling for encryption + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('sdks'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + 'webhooks' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('webhooks'), diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php index f8b4f75ea2..cb588d3696 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -69,7 +69,7 @@ class Create extends Action 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), ]); - $key = $dbForConsole->createDocument('development_keys', $key); + $key = $dbForConsole->createDocument('developmentKeys', $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php index a599b660d9..a1e0dad5b0 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php @@ -46,7 +46,7 @@ class Delete extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('development_keys', [ + $key = $dbForConsole->findOne('developmentKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php index c8cf672b61..6f9f2d73b2 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php @@ -47,7 +47,7 @@ class Get extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('development_keys', [ + $key = $dbForConsole->findOne('developmentKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php index da9d9c65b8..553f28b41a 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php @@ -49,7 +49,7 @@ class Update extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('development_keys', [ + $key = $dbForConsole->findOne('developmentKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php index 725ceda826..49605b0fdd 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php @@ -47,7 +47,7 @@ class XList extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $keys = $dbForConsole->find('development_keys', [ + $keys = $dbForConsole->find('developmentKeys', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); From 760c552ffb45a9f5070262c5d597e7298bd62fc1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Jul 2024 08:28:22 +0000 Subject: [PATCH 027/169] support for api test keys --- app/controllers/shared/api.php | 30 ++++++++++++++++++++++++++++++ app/init.php | 1 + 2 files changed, 31 insertions(+) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index bcf7c47d0b..2fff0f10a7 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -291,6 +291,36 @@ App::init() } } } + } elseif($keyType === API_KEY_TEST) { + // Check if given key match project Test API keys + $key = $project->find('secret', $apiKey, 'developmentKeys'); + if ($key) { + $user = new Document([ + '$id' => '', + 'status' => true, + 'email' => 'app-test.' . $project->getId() . '@service.' . $request->getHostname(), + 'password' => '', + 'name' => $project->getAttribute('name', 'Untitled'), + ]); + + $role = Auth::USER_ROLE_ADMIN; + $scopes = $roles[$role]['scopes']; + + $expire = $key->getAttribute('expire'); + if (!empty($expire) && $expire < DateTime::formatTz(DateTime::now())) { + throw new Exception(Exception::PROJECT_KEY_EXPIRED); + } + + Authorization::setRole(Auth::USER_ROLE_ADMIN); + Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. + + $accessedAt = $key->getAttribute('accessedAt', ''); + if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCCESS)) > $accessedAt) { + $key->setAttribute('accessedAt', DateTime::now()); + $dbForConsole->updateDocument('keys', $key->getId(), $key); + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + } + } } } diff --git a/app/init.php b/app/init.php index a0bd3b837b..b75e1bdd99 100644 --- a/app/init.php +++ b/app/init.php @@ -215,6 +215,7 @@ const MESSAGE_TYPE_PUSH = 'push'; // API key types const API_KEY_STANDARD = 'standard'; const API_KEY_DYNAMIC = 'dynamic'; +const API_KEY_TEST = 'test'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; From ae5a60db89675f0aeebe2904fe18fe72808bcb98 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 16 Jul 2024 08:33:38 +0000 Subject: [PATCH 028/169] composer update --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index a32159f79a..cf3aaec13b 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": "06f391b62842a79736fe3fe77ec82adf", + "content-hash": "f5f5f624d7edf2e0a405f4669ae8f672", "packages": [ { "name": "adhocore/jwt", @@ -1720,16 +1720,16 @@ }, { "name": "utopia-php/database", - "version": "0.49.14", + "version": "0.50.0", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "415588c0b98edee9d72cdfe269ff79b14cd8f56d" + "reference": "ce3eaccb2f3bbd34b2b97419836fec633b26b8f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/415588c0b98edee9d72cdfe269ff79b14cd8f56d", - "reference": "415588c0b98edee9d72cdfe269ff79b14cd8f56d", + "url": "https://api.github.com/repos/utopia-php/database/zipball/ce3eaccb2f3bbd34b2b97419836fec633b26b8f7", + "reference": "ce3eaccb2f3bbd34b2b97419836fec633b26b8f7", "shasum": "" }, "require": { @@ -1770,9 +1770,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.49.14" + "source": "https://github.com/utopia-php/database/tree/0.50.0" }, - "time": "2024-06-20T02:39:23+00:00" + "time": "2024-06-21T03:21:42+00:00" }, { "name": "utopia-php/domains", @@ -3157,16 +3157,16 @@ }, { "name": "laravel/pint", - "version": "v1.16.1", + "version": "v1.16.2", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "9266a47f1b9231b83e0cfd849009547329d871b1" + "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/9266a47f1b9231b83e0cfd849009547329d871b1", - "reference": "9266a47f1b9231b83e0cfd849009547329d871b1", + "url": "https://api.github.com/repos/laravel/pint/zipball/51f1ba679a6afe0315621ad143d788bd7ded0eca", + "reference": "51f1ba679a6afe0315621ad143d788bd7ded0eca", "shasum": "" }, "require": { @@ -3219,7 +3219,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-06-18T16:50:05+00:00" + "time": "2024-07-09T15:58:08+00:00" }, { "name": "matthiasmullie/minify", From ca0c38b3c0758c57edacffa3b5513de310a31601 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 29 Jul 2024 10:12:50 +0000 Subject: [PATCH 029/169] subquery for development keys --- app/config/collections.php | 11 +++++++++++ app/controllers/shared/api.php | 3 ++- app/init.php | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/config/collections.php b/app/config/collections.php index 5e7de4da81..d3f7c0c84b 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -4486,6 +4486,17 @@ $consoleCollections = array_merge([ 'array' => false, 'filters' => ['subQueryKeys'], ], + [ + '$id' => ID::custom('developmentKeys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryDevelopmentKeys'], + ], [ '$id' => ID::custom('search'), 'type' => Database::VAR_STRING, diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 158cec98e2..c93a3cc1ab 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -293,6 +293,7 @@ App::init() } } } elseif($keyType === API_KEY_TEST) { + var_dump('keys matches test'); // Check if given key match project Test API keys $key = $project->find('secret', $apiKey, 'developmentKeys'); if ($key) { @@ -316,7 +317,7 @@ App::init() Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. $accessedAt = $key->getAttribute('accessedAt', ''); - if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCCESS)) > $accessedAt) { + if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { $key->setAttribute('accessedAt', DateTime::now()); $dbForConsole->updateDocument('keys', $key->getId(), $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/app/init.php b/app/init.php index 0ddeecc341..07c4a6b501 100644 --- a/app/init.php +++ b/app/init.php @@ -434,6 +434,20 @@ Database::addFilter( } ); +Database::addFilter( + 'subQueryDevelopmentKeys', + function (mixed $value) { + return; + }, + function (mixed $value, Document $document, Database $database) { + return $database + ->find('developmentKeys', [ + Query::equal('projectInternalId', [$document->getInternalId()]), + Query::limit(APP_LIMIT_SUBQUERY), + ]); + } +); + Database::addFilter( 'subQueryWebhooks', function (mixed $value) { From 55fc9d7fbdecfabe29c05e0c7b31571bd1516e7f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 29 Jul 2024 10:12:57 +0000 Subject: [PATCH 030/169] tests and fixes --- app/console | 1 + .../Modules/DevelopmentKeys/Http/Create.php | 2 +- .../Modules/DevelopmentKeys/Http/Delete.php | 3 +- .../Modules/DevelopmentKeys/Http/Get.php | 1 + .../Modules/DevelopmentKeys/Http/Update.php | 3 +- .../Modules/DevelopmentKeys/Http/XList.php | 1 + .../Modules/DevelopmentKeys/Services/Http.php | 6 +- .../Projects/ProjectsConsoleClientTest.php | 2 + .../Projects/ProjectsDevelopmentKeys.php | 247 ++++++++++++++++++ 9 files changed, 260 insertions(+), 6 deletions(-) create mode 160000 app/console create mode 100644 tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php diff --git a/app/console b/app/console new file mode 160000 index 0000000000..f978cecfaf --- /dev/null +++ b/app/console @@ -0,0 +1 @@ +Subproject commit f978cecfafe55e85fcd20fe90fc020e78a7c7952 diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php index cb588d3696..c1f164987f 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -66,7 +66,7 @@ class Create extends Action 'expire' => $expire, 'sdks' => [], 'accessedAt' => null, - 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), + 'secret' => API_KEY_TEST . '_' . \bin2hex(\random_bytes(128)), ]); $key = $dbForConsole->createDocument('developmentKeys', $key); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php index a1e0dad5b0..c088e1059e 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Delete.php @@ -1,4 +1,5 @@ deleteDocument('keys', $key->getId()); + $dbForConsole->deleteDocument('developmentKeys', $key->getId()); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php index 6f9f2d73b2..43435a6a27 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Get.php @@ -1,4 +1,5 @@ setAttribute('name', $name) ->setAttribute('expire', $expire); - $dbForConsole->updateDocument('keys', $key->getId(), $key); + $dbForConsole->updateDocument('developmentKeys', $key->getId(), $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php index 49605b0fdd..65198037b2 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/XList.php @@ -1,4 +1,5 @@ client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertEmpty($response['body']['sdks']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + $data = array_merge($data, [ + 'keyId' => $response['body']['$id'], + 'secret' => $response['body']['secret'] + ]); + + return $data; + } + + + /** + * @depends testCreateProjectDevelopmentKey + * @group developmentKeys + */ + public function testListProjectDevelopmentKey($data): array + { + $id = $data['projectId'] ?? ''; + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + return $data; + } + + + /** + * @depends testCreateProjectDevelopmentKey + * @group developmentKeys + */ + public function testGetProjectDevelopmentKey($data): array + { + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($keyId, $response['body']['$id']); + $this->assertEquals('Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertEmpty($response['body']['sdks']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/error', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + + return $data; + } + + /** + * @depends testCreateProject + * @group developmentKeys + */ + public function testValidateProjectDevelopmentKey($data): void + { + $id = $data['projectId'] ?? ''; + + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), + ]); + var_dump($response['body']['secret']); + $response = $this->client->call(Client::METHOD_GET, '/health', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-key' => $response['body']['secret'] + ], []); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => null, + ]); + + $response = $this->client->call(Client::METHOD_GET, '/health', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-key' => $response['body']['secret'] + ], []); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), -3600), + ]); + + $response = $this->client->call(Client::METHOD_GET, '/health', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-key' => $response['body']['secret'] + ], []); + + $this->assertEquals(401, $response['headers']['status-code']); + } + + + /** + * @depends testCreateProjectDevelopmentKey + * @group developmentKeys + */ + public function testUpdateProjectDevelopmentKey($data): array + { + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; + + $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test Update', + 'expire' => DateTime::addSeconds(new \DateTime(), 360), + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($keyId, $response['body']['$id']); + $this->assertEquals('Key Test Update', $response['body']['name']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertEmpty($response['body']['sdks']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($keyId, $response['body']['$id']); + $this->assertEquals('Key Test Update', $response['body']['name']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertEmpty($response['body']['sdks']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + return $data; + } + + /** + * @depends testCreateProjectDevelopmentKey + * @group developmentKeys + */ + public function testDeleteProjectDevelopmentKey($data): array + { + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; + + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEmpty($response['body']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/development-keys/error', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + + return $data; + } +} From d9556ba603eca43a061892f36d8671c33feb1480 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 29 Jul 2024 10:18:06 +0000 Subject: [PATCH 031/169] make expiry date required --- .../Modules/DevelopmentKeys/Http/Create.php | 2 +- .../Modules/DevelopmentKeys/Http/Update.php | 4 ++-- .../Services/Projects/ProjectsDevelopmentKeys.php | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php index c1f164987f..a00f3f146d 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -39,7 +39,7 @@ class Create extends Action ->label('sdk.response.model', Response::MODEL_KEY) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) ->inject('response') ->inject('dbForConsole') ->callback(fn ($projectId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $name, $expire, $response, $dbForConsole)); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php index fd09bdead8..9379c147f2 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Update.php @@ -36,7 +36,7 @@ class Update extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', true) ->inject('response') ->inject('dbForConsole') ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); @@ -61,7 +61,7 @@ class Update extends Action $key ->setAttribute('name', $name) - ->setAttribute('expire', $expire); + ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); $dbForConsole->updateDocument('developmentKeys', $key->getId(), $key); diff --git a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php index de9f4db3fd..15ccfa0949 100644 --- a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php @@ -19,7 +19,8 @@ trait ProjectsDevelopmentKeys 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'name' => 'Key Test' + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) ]); $this->assertEquals(201, $response['headers']['status-code']); @@ -31,6 +32,16 @@ trait ProjectsDevelopmentKeys $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); + /** TEST expiry date is required */ + $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test' + ]); + + $this->assertEquals(400, $res['headers']['status-code']); + $data = array_merge($data, [ 'keyId' => $response['body']['$id'], 'secret' => $response['body']['secret'] @@ -133,7 +144,7 @@ trait ProjectsDevelopmentKeys 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Key Test', - 'expire' => null, + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); $response = $this->client->call(Client::METHOD_GET, '/health', [ From 61c5848be4c2f85cc27d69c27db816744c278c80 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 12 Aug 2024 05:34:25 +0000 Subject: [PATCH 032/169] refactor development keys --- app/controllers/shared/api.php | 31 ------------------- app/init.php | 24 +++++++++++++- .../Modules/DevelopmentKeys/Http/Create.php | 2 +- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index c93a3cc1ab..672366fa01 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -292,37 +292,6 @@ App::init() } } } - } elseif($keyType === API_KEY_TEST) { - var_dump('keys matches test'); - // Check if given key match project Test API keys - $key = $project->find('secret', $apiKey, 'developmentKeys'); - if ($key) { - $user = new Document([ - '$id' => '', - 'status' => true, - 'email' => 'app-test.' . $project->getId() . '@service.' . $request->getHostname(), - 'password' => '', - 'name' => $project->getAttribute('name', 'Untitled'), - ]); - - $role = Auth::USER_ROLE_ADMIN; - $scopes = $roles[$role]['scopes']; - - $expire = $key->getAttribute('expire'); - if (!empty($expire) && $expire < DateTime::formatTz(DateTime::now())) { - throw new Exception(Exception::PROJECT_KEY_EXPIRED); - } - - Authorization::setRole(Auth::USER_ROLE_ADMIN); - Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. - - $accessedAt = $key->getAttribute('accessedAt', ''); - if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { - $key->setAttribute('accessedAt', DateTime::now()); - $dbForConsole->updateDocument('keys', $key->getId(), $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); - } - } } } diff --git a/app/init.php b/app/init.php index e453046821..cb5eb55558 100644 --- a/app/init.php +++ b/app/init.php @@ -53,6 +53,7 @@ use Utopia\Database\Adapter\MariaDB; use Utopia\Database\Adapter\MySQL; use Utopia\Database\Adapter\SQL; use Utopia\Database\Database; +use Utopia\Database\DateTime as DatabaseDateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Query; @@ -216,7 +217,6 @@ const MESSAGE_TYPE_PUSH = 'push'; // API key types const API_KEY_STANDARD = 'standard'; const API_KEY_DYNAMIC = 'dynamic'; -const API_KEY_TEST = 'test'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; @@ -1749,3 +1749,25 @@ App::setResource('requestTimestamp', function ($request) { App::setResource('plan', function (array $plan = []) { return []; }); + +App::setResource('hasDevelopmentKey', function ($request, $project, $dbForConsole) { + $developmentKey = $request->getHeader('x-appwrite-development-key', ''); + // Check if given key match project Test API keys + $key = $project->find('secret', $developmentKey, 'developmentKeys'); + if ($key) { + + $expire = $key->getAttribute('expire'); + if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { + return false; + } + + $accessedAt = $key->getAttribute('accessedAt', ''); + if (DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { + $key->setAttribute('accessedAt', DatabaseDateTime::now()); + Authorization::skip(fn () => $dbForConsole->updateDocument('keys', $key->getId(), $key)); + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + } + return true; + } + return false; +}, ['request', 'project', 'dbForConsole']); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php index a00f3f146d..ec898cde7d 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php @@ -66,7 +66,7 @@ class Create extends Action 'expire' => $expire, 'sdks' => [], 'accessedAt' => null, - 'secret' => API_KEY_TEST . '_' . \bin2hex(\random_bytes(128)), + 'secret' => \bin2hex(\random_bytes(128)), ]); $key = $dbForConsole->createDocument('developmentKeys', $key); From 0a2eee01180a16f3a911e76307ab3e6137fe41c9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 12 Aug 2024 05:44:52 +0000 Subject: [PATCH 033/169] detailed error logs if development key is provided --- app/controllers/general.php | 7 ++++--- app/controllers/shared/api.php | 4 +++- app/init.php | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 143eb15684..13a1516627 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -671,7 +671,8 @@ App::error() ->inject('logger') ->inject('log') ->inject('queueForUsage') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage) { + ->inject('hasDevelopmentKey') + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, bool $hasDevelopmentKey) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); @@ -859,7 +860,7 @@ App::error() $type = $error->getType(); - $output = ((App::isDevelopment())) ? [ + $output = ((App::isDevelopment()) || $hasDevelopmentKey) ? [ 'message' => $message, 'code' => $code, 'file' => $file, @@ -900,7 +901,7 @@ App::error() $response->dynamic( new Document($output), - $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR + $utopia->isDevelopment() || $hasDevelopmentKey ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR ); }); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 672366fa01..068c7e2f43 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -357,7 +357,8 @@ App::init() ->inject('queueForUsage') ->inject('dbForProject') ->inject('mode') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode) use ($databaseListener) { + ->inject('hasDevelopmentKey') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode, bool $hasDevelopmentKey) use ($databaseListener) { $route = $utopia->getRoute(); @@ -424,6 +425,7 @@ App::init() $enabled // Abuse is enabled && !$isAppUser // User is not API key && !$isPrivilegedUser // User is not an admin + && !$hasDevelopmentKey // request doesn't not contain development key && $abuse->check() // Route is rate-limited ) { throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED); diff --git a/app/init.php b/app/init.php index cb5eb55558..de958ec213 100644 --- a/app/init.php +++ b/app/init.php @@ -1752,10 +1752,9 @@ App::setResource('plan', function (array $plan = []) { App::setResource('hasDevelopmentKey', function ($request, $project, $dbForConsole) { $developmentKey = $request->getHeader('x-appwrite-development-key', ''); - // Check if given key match project Test API keys + // Check if given key match project's development keys $key = $project->find('secret', $developmentKey, 'developmentKeys'); if ($key) { - $expire = $key->getAttribute('expire'); if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { return false; From 383cff5eb8c003374095b34d32f6029222538998 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 12 Aug 2024 08:39:03 +0000 Subject: [PATCH 034/169] enable abuse to test development keys --- .env | 2 +- .../Projects/ProjectsDevelopmentKeys.php | 59 +++++++++++-------- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/.env b/.env index 9cccf5ee7e..3e666fc2f9 100644 --- a/.env +++ b/.env @@ -13,7 +13,7 @@ _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_ABUSE=enabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php index 15ccfa0949..cbc677a7e1 100644 --- a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php @@ -113,7 +113,7 @@ trait ProjectsDevelopmentKeys * @depends testCreateProject * @group developmentKeys */ - public function testValidateProjectDevelopmentKey($data): void + public function testNoRateLimitWithDevelopmentKey($data): void { $id = $data['projectId'] ?? ''; @@ -127,33 +127,38 @@ trait ProjectsDevelopmentKeys 'name' => 'Key Test', 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); - var_dump($response['body']['secret']); - $response = $this->client->call(Client::METHOD_GET, '/health', [ + + $developmentKey = $response['body']['secret']; + + // + for($i = 0; $i < 11; $i++) { + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + } + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-key' => $response['body']['secret'] - ], []); - - $this->assertEquals(200, $response['headers']['status-code']); - - /** - * Test for SUCCESS - */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 3600), + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' ]); + $this->assertEquals('429', $res['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/health', [ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-key' => $response['body']['secret'] - ], []); + 'x-appwrite-development-key' => $developmentKey + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals('401', $res['headers']['status-code']); - $this->assertEquals(200, $response['headers']['status-code']); /** * Test for FAILURE @@ -166,13 +171,15 @@ trait ProjectsDevelopmentKeys 'expire' => DateTime::addSeconds(new \DateTime(), -3600), ]); - $response = $this->client->call(Client::METHOD_GET, '/health', [ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-key' => $response['body']['secret'] - ], []); - - $this->assertEquals(401, $response['headers']['status-code']); + 'x-appwrite-development-key' => $response['body']['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals('429', $res['headers']['status-code']); } From f2377ce5d2cee42d9a7edfac470b82dd229c4784 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 12 Aug 2024 08:55:14 +0000 Subject: [PATCH 035/169] remove submodule --- app/console | 1 - 1 file changed, 1 deletion(-) delete mode 160000 app/console diff --git a/app/console b/app/console deleted file mode 160000 index f978cecfaf..0000000000 --- a/app/console +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f978cecfafe55e85fcd20fe90fc020e78a7c7952 From 179684e8b2b69b67bcd48c4280de6f0da84409d3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 14 Nov 2024 04:48:46 +0000 Subject: [PATCH 036/169] improve dependency --- app/controllers/general.php | 8 ++++---- app/controllers/shared/api.php | 6 +++--- app/init.php | 9 ++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 2079ee6555..cecbfdd7f5 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -710,8 +710,8 @@ App::error() ->inject('logger') ->inject('log') ->inject('queueForUsage') - ->inject('hasDevelopmentKey') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, bool $hasDevelopmentKey) { + ->inject('developmentKey') + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, Document $developmentKey) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); @@ -912,7 +912,7 @@ App::error() $type = $error->getType(); - $output = ((App::isDevelopment()) || $hasDevelopmentKey) ? [ + $output = ((App::isDevelopment()) || (!$developmentKey->isEmpty())) ? [ 'message' => $message, 'code' => $code, 'file' => $file, @@ -953,7 +953,7 @@ App::error() $response->dynamic( new Document($output), - $utopia->isDevelopment() || $hasDevelopmentKey ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR + $utopia->isDevelopment() || !$developmentKey->isEmpty() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR ); }); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 42c5035318..70a97099b2 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -393,8 +393,8 @@ App::init() ->inject('queueForUsage') ->inject('dbForProject') ->inject('mode') - ->inject('hasDevelopmentKey') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Connection $queue, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode, bool $hasDevelopmentKey) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('developmentKey') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Connection $queue, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode, Document $developmentKey) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -461,7 +461,7 @@ App::init() $enabled // Abuse is enabled && !$isAppUser // User is not API key && !$isPrivilegedUser // User is not an admin - && !$hasDevelopmentKey // request doesn't not contain development key + && $developmentKey->isEmpty() // request doesn't not contain development key && $abuse->check() // Route is rate-limited ) { throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED); diff --git a/app/init.php b/app/init.php index 1de0b14740..c93ffdae53 100644 --- a/app/init.php +++ b/app/init.php @@ -1814,14 +1814,14 @@ App::setResource('plan', function (array $plan = []) { return []; }); -App::setResource('hasDevelopmentKey', function ($request, $project, $dbForConsole) { +App::setResource('developmentKey', function ($request, $project, $dbForConsole) { $developmentKey = $request->getHeader('x-appwrite-development-key', ''); // Check if given key match project's development keys $key = $project->find('secret', $developmentKey, 'developmentKeys'); if ($key) { $expire = $key->getAttribute('expire'); if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { - return false; + return new Document([]); } $accessedAt = $key->getAttribute('accessedAt', ''); @@ -1830,9 +1830,9 @@ App::setResource('hasDevelopmentKey', function ($request, $project, $dbForConsol Authorization::skip(fn () => $dbForConsole->updateDocument('keys', $key->getId(), $key)); $dbForConsole->purgeCachedDocument('projects', $project->getId()); } - return true; + return $key; } - return false; + return new Document([]); }, ['request', 'project', 'dbForConsole']); App::setResource('team', function (Document $project, Database $dbForConsole, App $utopia, Request $request) { @@ -1867,4 +1867,3 @@ App::setResource( 'isResourceBlocked', fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false ); - From 33aca37c1c337922a14304bcb7f4b03d2817a951 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Nov 2024 06:17:55 +0000 Subject: [PATCH 037/169] Tokens module setup --- src/Appwrite/Platform/Appwrite.php | 2 ++ .../Modules/Tokens/Http/Tokens/ListTokens.php | 15 +++++++++++++++ src/Appwrite/Platform/Modules/Tokens/Module.php | 14 ++++++++++++++ .../Platform/Modules/Tokens/Services/Http.php | 15 +++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Module.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Services/Http.php diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 6b3eb077fa..12f37b9193 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -4,11 +4,13 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; use Utopia\Platform\Platform; +use Appwrite\Platform\Modules\Tokens; class Appwrite extends Platform { public function __construct() { parent::__construct(new Core()); + $this->addModule(new Tokens\Module()); } } diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php new file mode 100644 index 0000000000..84fdfe9c55 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php @@ -0,0 +1,15 @@ +addService('http', new Http()); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php new file mode 100644 index 0000000000..9df63a0eed --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php @@ -0,0 +1,15 @@ +type = Service::TYPE_HTTP; + $this->addAction(ListTokens::getName(), new ListTokens()); + } +} From 10dab10cc5e4e8622a02c0097afdd94d1fa0857b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 17 Nov 2024 07:01:20 +0000 Subject: [PATCH 038/169] refactor module namings --- src/Appwrite/Platform/Appwrite.php | 2 +- .../CreateKey.php} | 6 +- .../DeleteKey.php} | 6 +- .../{Get.php => DevelopmentKeys/GetKey.php} | 6 +- .../ListKeys.php} | 6 +- .../Http/{ => DevelopmentKeys}/Update.php | 4 +- .../Http/DevelopmentKeys/UpdateKey.php | 72 +++++++++++++++++++ .../Module.php} | 6 +- .../Modules/DevelopmentKeys/Services/Http.php | 20 +++--- .../Projects/ProjectsDevelopmentKeys.php | 2 +- 10 files changed, 101 insertions(+), 29 deletions(-) rename src/Appwrite/Platform/Modules/DevelopmentKeys/Http/{Create.php => DevelopmentKeys/CreateKey.php} (95%) rename src/Appwrite/Platform/Modules/DevelopmentKeys/Http/{Delete.php => DevelopmentKeys/DeleteKey.php} (93%) rename src/Appwrite/Platform/Modules/DevelopmentKeys/Http/{Get.php => DevelopmentKeys/GetKey.php} (93%) rename src/Appwrite/Platform/Modules/DevelopmentKeys/Http/{XList.php => DevelopmentKeys/ListKeys.php} (93%) rename src/Appwrite/Platform/Modules/DevelopmentKeys/Http/{ => DevelopmentKeys}/Update.php (97%) create mode 100644 src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/UpdateKey.php rename src/Appwrite/Platform/Modules/{DevelopmentKeys.php => DevelopmentKeys/Module.php} (59%) diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index e1a27f1b0a..153b22c02c 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -11,6 +11,6 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); - $this->addModule(new DevelopmentKeys()); + $this->addModule(new DevelopmentKeys\Module()); } } diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php similarity index 95% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php rename to src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php index ec898cde7d..c6eee58adb 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/Create.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php @@ -1,6 +1,6 @@ setHttpMethod(Action::HTTP_REQUEST_METHOD_PUT) + ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->desc('Update key') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) + ->label('sdk.namespace', 'projects') + ->label('sdk.method', 'updateDevelopmentKey') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_KEY) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('keyId', '', new UID(), 'Key unique ID.') + ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', true) + ->inject('response') + ->inject('dbForConsole') + ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); + } + public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForConsole) + { + + $project = $dbForConsole->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $key = $dbForConsole->findOne('developmentKeys', [ + Query::equal('$id', [$keyId]), + Query::equal('projectInternalId', [$project->getInternalId()]), + ]); + + if ($key === false || $key->isEmpty()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } + + $key + ->setAttribute('name', $name) + ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); + + $dbForConsole->updateDocument('developmentKeys', $key->getId(), $key); + + $dbForConsole->purgeCachedDocument('projects', $project->getId()); + + $response->dynamic($key, Response::MODEL_KEY); + } +} diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys.php b/src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php similarity index 59% rename from src/Appwrite/Platform/Modules/DevelopmentKeys.php rename to src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php index c351ad92f1..299868cb57 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys.php +++ b/src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php @@ -1,11 +1,11 @@ type = Service::TYPE_HTTP; - $this->addAction(Create::getName(), new Create()); - $this->addAction(Update::getName(), new Update()); - $this->addAction(Get::getName(), new Get()); - $this->addAction(XList::getName(), new XList()); - $this->addAction(Delete::getName(), new Delete()); + $this->addAction(CreateKey::getName(), new CreateKey()); + $this->addAction(UpdateKey::getName(), new UpdateKey()); + $this->addAction(GetKey::getName(), new GetKey()); + $this->addAction(ListKeys::getName(), new ListKeys()); + $this->addAction(DeleteKey::getName(), new DeleteKey()); } } diff --git a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php index cbc677a7e1..f781aad6b2 100644 --- a/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevelopmentKeys.php @@ -131,7 +131,7 @@ trait ProjectsDevelopmentKeys $developmentKey = $response['body']['secret']; // - for($i = 0; $i < 11; $i++) { + for ($i = 0; $i < 11; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, From a9da4b7b3bf88582a8029af70dcc95c2eb6bf16f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 18 Nov 2024 07:38:48 +0000 Subject: [PATCH 039/169] refactor token apis --- app/controllers/api/storage.php | 461 ------------------ src/Appwrite/Extend/Exception.php | 3 + src/Appwrite/Platform/Appwrite.php | 2 +- .../Tokens/Http/Tokens/CreateToken.php | 123 +++++ .../Tokens/Http/Tokens/DeleteToken.php | 66 +++ .../Modules/Tokens/Http/Tokens/GetToken.php | 53 ++ .../Tokens/Http/Tokens/GetTokenJWT.php | 76 +++ .../Modules/Tokens/Http/Tokens/ListTokens.php | 62 ++- .../Tokens/Http/Tokens/UpdateToken.php | 114 +++++ 9 files changed, 496 insertions(+), 464 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 568eea9551..1c03f04638 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -11,7 +11,6 @@ use Appwrite\OpenSSL\OpenSSL; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; -use Appwrite\Utopia\Database\Validator\Queries\FileTokens; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -24,7 +23,6 @@ use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; -use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\Query\Cursor; use Utopia\Database\Validator\UID; @@ -43,7 +41,6 @@ use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Boolean; use Utopia\Validator\HexColor; -use Utopia\Validator\Nullable; use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; @@ -1659,464 +1656,6 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') $response->noContent(); }); -/** File Tokens */ -App::post('/v1/storage/buckets/:bucketId/files/:fileId/tokens') - ->desc('Create file token') - ->groups(['api', 'storage']) - ->label('scope', 'files.write') - ->label('audits.event', 'fileToken.create') - ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].create') - ->label('audits.resource', 'token/{response.$id}') - ->label('usage.metric', 'fileTokens.{scope}.requests.create') - ->label('usage.params', ['bucketId:{request.bucketId}', 'fileId:{request.fileId}']) - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createFileToken') - ->label('sdk.description', '/docs/references/storage/create-file-token.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File unique ID.') - ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) - ->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('response') - ->inject('dbForProject') - ->inject('user') - ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->createDocument('resourceTokens', new Document([ - '$id' => ID::unique(), - 'secret' => Auth::tokenGenerator(128), - 'resourceId' => $bucketId . ':' . $fileId, - 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), - 'resourceType' => 'file', - 'expire' => $expire, - '$permissions' => $permissions - ])); - - $queueForEvents - ->setParam('bucketId', $bucket->getId()) - ->setParam('fileId', $file->getId()) - ->setParam('tokenId', $token->getId()) - ->setContext('bucket', $bucket) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($token, Response::MODEL_RESOURCE_TOKEN); - }); - -App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens') - ->desc('List file tokens') - ->groups(['api', 'storage']) - ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('usage.metric', 'fileTokens.{scope}.requests.read') - ->label('usage.params', ['bucketId:{request.bucketId}']) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listFileTokens') - ->label('sdk.description', '/docs/references/storage/list-file-tokens.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN_LIST) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File unique ID.') - ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) - ->inject('response') - ->inject('dbForProject') - ->action(function (string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $queries = Query::parseQueries($queries); - // Get cursor document if there was a cursor query - $cursor = \array_filter($queries, function ($query) { - return \in_array($query->getMethod(), [Query::TYPE_CURSORAFTER, Query::TYPE_CURSORBEFORE]); - }); - $cursor = reset($cursor); - if ($cursor) { - /** @var Query $cursor */ - $tokenId = $cursor->getValue(); - $cursorDocument = $dbForProject->getDocument('resourceTokens', $tokenId); - - if ($cursorDocument->isEmpty()) { - throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "File token '{$tokenId}' for the 'cursor' value not found."); - } - - $cursor->setValue($cursorDocument); - } - - $queries = [...$queries, Query::equal('resourceInternalId', [$bucket->getInternalId() . ':' . $file->getInternalId()]), Query::equal('resourceType', ['file'])]; - $filterQueries = Query::groupByType($queries)['filters']; - - $response->dynamic(new Document([ - 'tokens' => $dbForProject->find('resourceTokens', $queries), - 'total' => $dbForProject->count('resourceTokens', $filterQueries, APP_LIMIT_COUNT), - ]), Response::MODEL_RESOURCE_TOKEN_LIST); - }); - -App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') - ->desc('Get file token') - ->groups(['api', 'storage']) - ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('usage.metric', 'fileTokens.{scope}.requests.read') - ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileToken') - ->label('sdk.description', '/docs/references/storage/get-file-token.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File ID.') - ->param('tokenId', '', new UID(), 'File token ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->getDocument('resourceTokens', $tokenId); - - if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { - throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); - } - - $response->dynamic($token, Response::MODEL_RESOURCE_TOKEN); - }); - -// Get token as JWT -App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') - ->desc('Get file token jwt') - ->groups(['api', 'storage']) - ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('usage.metric', 'fileTokens.{scope}.requests.read') - ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileTokenJWT') - ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File ID.') - ->param('tokenId', '', new UID(), 'File token ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->getDocument('resourceTokens', $tokenId); - - if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { - throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); - } - - // calculate maxAge based on expiry date - $maxAge = PHP_INT_MAX; - $expire = $token->getAttribute('expire'); - if ($expire != null) { - $now = new \DateTime(); - $expiryDate = new \DateTime($expire); - $maxAge = $expiryDate->getTimestamp() - $now->getTimestamp(); - ; - } - - $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway. - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic(new Document(['jwt' => $jwt->encode([ - 'resourceType' => 'file', - 'resourceId' => $token->getAttribute('resourceId'), - 'resourceInternalId' => $token->getAttribute('resourceInternalId'), - 'tokenId' => $token->getId(), - 'secret' => $token->getAttribute('secret') - ])]), Response::MODEL_JWT); - }); - -App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') - ->desc('Update file token') - ->groups(['api', 'storage']) - ->label('scope', 'files.write') - ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].update') - ->label('audits.event', 'fileTokens.update') - ->label('audits.resource', 'fileTokens/{response.$id}') - ->label('usage.metric', 'filesTokens.{scope}.requests.update') - ->label('usage.params', ['bucketId:{request.bucketId}', 'fileId:{request.tokenId}']) - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateFileToken') - ->label('sdk.description', '/docs/references/storage/update-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File unique ID.') - ->param('tokenId', '', new UID(), 'File token unique ID.') - ->param('expire', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) - ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('response') - ->inject('dbForProject') - ->inject('user') - ->inject('mode') - ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { - - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->getDocument('resourceTokens', $tokenId); - - if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { - throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); - } - - // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions, [ - Database::PERMISSION_READ, - Database::PERMISSION_UPDATE, - Database::PERMISSION_DELETE, - ]); - - // Users can only manage their own roles, API keys and Admin users can manage any - $roles = Authorization::getRoles(); - if (!Auth::isAppUser($roles) && !Auth::isPrivilegedUser($roles) && !\is_null($permissions)) { - foreach (Database::PERMISSIONS as $type) { - foreach ($permissions as $permission) { - $permission = Permission::parse($permission); - if ($permission->getPermission() != $type) { - continue; - } - $role = (new Role( - $permission->getRole(), - $permission->getIdentifier(), - $permission->getDimension() - ))->toString(); - if (!Authorization::isRole($role)) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); - } - } - } - } - - if (\is_null($permissions)) { - $permissions = $token->getPermissions() ?? []; - } - - $token - ->setAttribute('expire', $expire) - ->setAttribute('$permissions', $permissions); - - $token = $dbForProject->updateDocument('resourceTokens', $tokenId, $token); - - $queueForEvents - ->setParam('bucketId', $bucket->getId()) - ->setParam('fileId', $file->getId()) - ->setParam('tokenId', $token->getId()) - ->setContext('bucket', $bucket) - ; - - $response->dynamic($file, Response::MODEL_RESOURCE_TOKEN); - }); - -App::delete('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId') - ->desc('Delete file token') - ->groups(['api', 'storage']) - ->label('scope', 'files.write') - ->label('event', 'buckets.[bucketId].files.[fileId].tokens.[tokenId].delete') - ->label('audits.event', 'fileToken.delete') - ->label('audits.resource', 'token/{request.tokenId}') - ->label('usage.metric', 'fileTokens.{scope}.requests.delete') - ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteFileToken') - ->label('sdk.description', '/docs/references/storage/delete-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') - ->param('fileId', '', new UID(), 'File ID.') - ->param('tokenId', '', new UID(), 'File token ID.') - ->inject('response') - ->inject('dbForProject') - ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) { - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->getDocument('resourceTokens', $tokenId); - if ($token->isEmpty() || $token->getAttribute('resourceInternalId') != $bucket->getInternalId() . ':' . $file->getInternalId()) { - throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND); - } - - $dbForProject->deleteDocument('resourceTokens', $tokenId); - - $queueForEvents - ->setParam('bucketId', $bucket->getId()) - ->setParam('fileId', $file->getId()) - ->setParam('tokenId', $token->getId()) - ->setContext('bucket', $bucket) - ->setPayload($response->output($file, Response::MODEL_RESOURCE_TOKEN)) - ; - - $response->noContent(); - }); - /** Storage usage */ App::get('/v1/storage/usage') ->desc('Get storage usage stats') diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index d25332126c..9de85eec8a 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -302,6 +302,9 @@ class Exception extends \Exception /** Schedules */ public const SCHEDULE_NOT_FOUND = 'schedule_not_found'; + /** Tokens */ + public const TOKEN_NOT_FOUND = 'token_not_found'; + protected string $type = ''; protected array $errors = []; diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 12f37b9193..a075116d8b 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -3,8 +3,8 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; -use Utopia\Platform\Platform; use Appwrite\Platform\Modules\Tokens; +use Utopia\Platform\Platform; class Appwrite extends Platform { diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php new file mode 100644 index 0000000000..3e28b23430 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php @@ -0,0 +1,123 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tokens') + ->desc('Create token') + ->groups(['api', 'token']) + ->label('scope', 'tokens.write') + ->label('audits.event', 'token.create') + ->label('event', 'tokens.[tokenId].create') + ->label('audits.resource', 'token/{response.$id}') + ->label('usage.metric', 'tokens.{scope}.requests.create') + ->label('usage.params', ['resourceId:{request.resourceId}', 'resourceType:{request.resourceType}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'create') + ->label('sdk.description', '/docs/references/tokens/create.md') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->param('resourceType', '', new WhiteList(['files']), 'Resource type one of [files].') + ->param('resourceId', '', new UID(), 'Unique resource ID.') + ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) + ->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('queueForEvents') + ->callback(fn ($resourceType, $resourceId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents) => $this->action($resourceType, $resourceId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents)); + } + + public function action(string $resourceType, string $resourceId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) + { + + if ($resourceType === 'files') { + $ids = explode(':', $resourceId); + if (count($ids) !== 2) { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid resource id'); + } + $bucketId = $ids[0]; + $fileId = $ids[1]; + $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + + $token = $dbForProject->createDocument('resourceTokens', new Document([ + '$id' => ID::unique(), + 'secret' => Auth::tokenGenerator(128), + 'resourceId' => $bucketId . ':' . $fileId, + 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), + 'resourceType' => 'file', + 'expire' => $expire, + '$permissions' => $permissions + ])); + + $queueForEvents + ->setParam('bucketId', $bucket->getId()) + ->setParam('fileId', $file->getId()) + ->setParam('tokenId', $token->getId()) + ->setContext('bucket', $bucket) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($token, Response::MODEL_RESOURCE_TOKEN); + } else { + throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid resource type'); + } + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php new file mode 100644 index 0000000000..d8f463cbd8 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php @@ -0,0 +1,66 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_DELETE) + ->setHttpPath('/v1/tokens/:tokenId') + ->desc('Delete token') + ->groups(['api', 'tokens']) + ->label('scope', 'tokens.write') + ->label('event', 'tokens.[tokenId].delete') + ->label('audits.event', 'tokens.delete') + ->label('audits.resource', 'token/{request.tokenId}') + ->label('usage.metric', 'tokens.{scope}.requests.delete') + ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'delete') + ->label('sdk.description', '/docs/references/tokens/delete.md') + ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) + ->label('sdk.response.model', Response::MODEL_NONE) + ->param('tokenId', '', new UID(), 'Token ID.') + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->callback(fn ($tokenId, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $response, $dbForProject, $queueForEvents)); + } + + public function action(string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) + { + $token = $dbForProject->getDocument('resourceTokens', $tokenId); + if ($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + $dbForProject->deleteDocument('resourceTokens', $tokenId); + + $queueForEvents + ->setParam('tokenId', $token->getId()) + ->setPayload($response->output($token, Response::MODEL_RESOURCE_TOKEN)) + ; + + $response->noContent(); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php new file mode 100644 index 0000000000..d1a895fabc --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php @@ -0,0 +1,53 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/tokens/:tokenId') + ->desc('Get token') + ->groups(['api', 'tokens']) + ->label('scope', 'tokens.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'tokens.{scope}.requests.read') + ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'get') + ->label('sdk.description', '/docs/references/tokens/get.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->param('tokenId', '', new UID(), 'Token ID.') + ->inject('response') + ->inject('dbForProject') + ->callback(fn ($tokenId, $response, $dbForProject) => $this->action($tokenId, $response, $dbForProject)); + } + + public function action(string $tokenId, Response $response, Database $dbForProject) + { + $token = $dbForProject->getDocument('resourceTokens', $tokenId); + + if ($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + $response->dynamic($token, Response::MODEL_RESOURCE_TOKEN); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php new file mode 100644 index 0000000000..253b0b6fd0 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php @@ -0,0 +1,76 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') + ->desc('Get file token jwt') + ->groups(['api', 'storage']) + ->label('scope', 'files.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'fileTokens.{scope}.requests.read') + ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) + ->label('sdk.namespace', 'storage') + ->label('sdk.method', 'getFileTokenJWT') + ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_JWT) + ->param('tokenId', '', new UID(), 'File token ID.') + ->inject('response') + ->inject('dbForProject') + ->callback(fn ($tokenId, $response, $dbForProject) => $this->action($tokenId, $response, $dbForProject)); + } + + public function action(string $tokenId, Response $response, Database $dbForProject) + { + $token = $dbForProject->getDocument('resourceTokens', $tokenId); + + if ($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + // calculate maxAge based on expiry date + $maxAge = PHP_INT_MAX; + $expire = $token->getAttribute('expire'); + if ($expire != null) { + $now = new \DateTime(); + $expiryDate = new \DateTime($expire); + $maxAge = $expiryDate->getTimestamp() - $now->getTimestamp(); + ; + } + + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway. + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic(new Document(['jwt' => $jwt->encode([ + 'resourceType' => $token->getAttribute('resourceType'), + 'resourceId' => $token->getAttribute('resourceId'), + 'resourceInternalId' => $token->getAttribute('resourceInternalId'), + 'tokenId' => $token->getId(), + 'secret' => $token->getAttribute('secret') + ])]), Response::MODEL_JWT); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php index 84fdfe9c55..5b8948d357 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php @@ -1,6 +1,14 @@ setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + ->setHttpPath('/v1/storage/buckets/:bucketId/files/:fileId/tokens') + ->desc('List tokens') + ->groups(['api', 'tokens']) + ->label('scope', 'tokens.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('usage.metric', 'tokens.requests.read') + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'list') + ->label('sdk.description', '/docs/references/storage/list.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN_LIST) + ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) + ->inject('response') + ->inject('dbForProject') + ->callback(fn ($queries, $response, $dbForProject) => $this->action($queries, $response, $dbForProject)); + } + + public function action(array $queries, Response $response, Database $dbForProject) + { + $queries = Query::parseQueries($queries); + // Get cursor document if there was a cursor query + $cursor = \array_filter($queries, function ($query) { + return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); + }); + $cursor = reset($cursor); + if ($cursor) { + /** @var Query $cursor */ + $tokenId = $cursor->getValue(); + $cursorDocument = $dbForProject->getDocument('resourceTokens', $tokenId); + + if ($cursorDocument->isEmpty()) { + throw new Exception(ExtendException::GENERAL_CURSOR_NOT_FOUND, "File token '{$tokenId}' for the 'cursor' value not found."); + } + + $cursor->setValue($cursorDocument); + } + + $filterQueries = Query::groupByType($queries)['filters']; + + $response->dynamic(new Document([ + 'tokens' => $dbForProject->find('resourceTokens', $queries), + 'total' => $dbForProject->count('resourceTokens', $filterQueries, APP_LIMIT_COUNT), + ]), Response::MODEL_RESOURCE_TOKEN_LIST); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php new file mode 100644 index 0000000000..a20fda3e96 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php @@ -0,0 +1,114 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_PATCH) + ->setHttpPath('/v1/tokens/:tokenId') + ->desc('Update token') + ->groups(['api', 'tokens']) + ->label('scope', 'tokens.write') + ->label('event', 'tokens.[tokenId].update') + ->label('audits.event', 'tokens.update') + ->label('audits.resource', 'tokens/{response.$id}') + ->label('usage.metric', 'tokens.{scope}.requests.update') + ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'update') + ->label('sdk.description', '/docs/references/tokens/update.md') + ->label('sdk.response.code', Response::STATUS_CODE_OK) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->param('tokenId', '', new UID(), 'Token unique ID.') + ->param('expire', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) + ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('mode') + ->inject('queueForEvents') + ->callback(fn ($tokenId, $expire, $permission, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $expire, $permission, $response, $dbForProject, $queueForEvents)); + } + + public function action(string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Event $queueForEvents) + { + $token = $dbForProject->getDocument('resourceTokens', $tokenId); + + if ($token->isEmpty()) { + throw new Exception(Exception::TOKEN_NOT_FOUND); + } + + // Map aggregate permissions into the multiple permissions they represent. + $permissions = Permission::aggregate($permissions, [ + Database::PERMISSION_READ, + Database::PERMISSION_UPDATE, + Database::PERMISSION_DELETE, + ]); + + // Users can only manage their own roles, API keys and Admin users can manage any + $roles = Authorization::getRoles(); + if (!Auth::isAppUser($roles) && !Auth::isPrivilegedUser($roles) && !\is_null($permissions)) { + foreach (Database::PERMISSIONS as $type) { + foreach ($permissions as $permission) { + $permission = Permission::parse($permission); + if ($permission->getPermission() != $type) { + continue; + } + $role = (new Role( + $permission->getRole(), + $permission->getIdentifier(), + $permission->getDimension() + ))->toString(); + if (!Authorization::isRole($role)) { + throw new Exception(Exception::USER_UNAUTHORIZED, 'Permissions must be one of: (' . \implode(', ', $roles) . ')'); + } + } + } + } + + if (\is_null($permissions)) { + $permissions = $token->getPermissions() ?? []; + } + + $token + ->setAttribute('expire', $expire) + ->setAttribute('$permissions', $permissions); + + $token = $dbForProject->updateDocument('resourceTokens', $tokenId, $token); + + $queueForEvents + ->setParam('tokenId', $token->getId()) + ; + + $response->dynamic($token, Response::MODEL_RESOURCE_TOKEN); + } +} From 0d1fec47c64263e94fe2064e02ac6f8c1daa98fd Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 18 Nov 2024 08:00:14 +0000 Subject: [PATCH 040/169] tokens test --- .github/workflows/tests.yml | 1 + tests/e2e/Services/Storage/StorageBase.php | 43 ---------- tests/e2e/Services/Tokens/TokensBase.php | 96 ++++++++++++++++++++++ 3 files changed, 97 insertions(+), 43 deletions(-) create mode 100644 tests/e2e/Services/Tokens/TokensBase.php diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c53b03b52..3e895b051f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -125,6 +125,7 @@ jobs: Webhooks, VCS, Messaging, + Tokens, ] steps: diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 836861c4fb..79e8083552 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -5,7 +5,6 @@ namespace Tests\E2E\Services\Storage; use Appwrite\Extend\Exception; use CURLFile; use Tests\E2E\Client; -use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -753,48 +752,6 @@ trait StorageBase return $data; } - /** - * @group fileTokens - * @depends testCreateBucketFile - */ - public function testCreateFileToken(array $data): array - { - $bucketId = $data['bucketId']; - $fileId = $data['fileId']; - - $res = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files/' . $fileId . '/tokens', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(201, $res['headers']['status-code']); - $this->assertEquals('file', $res['body']['resourceType']); - - $data['tokenId'] = $res['body']['$id']; - return $data; - } - - /** - * @group fileTokens - * @depends testCreateFileToken - */ - public function testUpdateFileToken(array $data): array - { - $bucketId = $data['bucketId']; - $fileId = $data['fileId']; - $tokenId = $data['tokenId']; - - $expiry = DateTime::now(); - $res = $this->client->call(Client::METHOD_PUT, '/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'expire' => $expiry, - ]); - - $this->assertEquals($expiry, $res['body']['expire']); - return $data; - } /** * @depends testCreateBucketFileZstdCompression diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php new file mode 100644 index 0000000000..5c57677783 --- /dev/null +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -0,0 +1,96 @@ +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', + 'fileSecurity' => true, + 'maximumFileSize' => 2000000, //2MB + 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']['$id']); + + $bucketId = $bucket['body']['$id']; + + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $file['headers']['status-code']); + $this->assertNotEmpty($file['body']['$id']); + + $fileId = $file['body']['$id']; + + $res = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files/' . $fileId . '/tokens', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(201, $res['headers']['status-code']); + $this->assertEquals('files', $res['body']['resourceType']); + + $data = []; + $data['fileId'] = $fileId; + $data['bucketId'] = $bucketId; + $data['tokenId'] = $res['body']['$id']; + return $data; + } + + /** + * @group fileTokens + * @depends testCreateFileToken + */ + public function testUpdateFileToken(array $data): array + { + $bucketId = $data['bucketId']; + $fileId = $data['fileId']; + $tokenId = $data['tokenId']; + + $expiry = DateTime::now(); + $res = $this->client->call(Client::METHOD_PUT, '/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'expire' => $expiry, + ]); + + $this->assertEquals($expiry, $res['body']['expire']); + return $data; + } + +} From d32dc0a4d9d44ccebf3688726268be08ae814a08 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 18 Nov 2024 08:52:16 +0000 Subject: [PATCH 041/169] tokens test and scopes --- app/config/roles.php | 2 + app/config/scopes.php | 6 + app/controllers/general.php | 5 + .../Tokens/Http/Tokens/CreateToken.php | 2 +- .../Platform/Modules/Tokens/Services/Http.php | 15 ++- tests/e2e/Services/Tokens/TokensBase.php | 82 +------------ .../Tokens/TokensConsoleClientTest.php | 14 +++ .../Tokens/TokensCustomClientTest.php | 15 +++ .../Tokens/TokensCustomServerTest.php | 112 ++++++++++++++++++ 9 files changed, 170 insertions(+), 83 deletions(-) create mode 100644 tests/e2e/Services/Tokens/TokensConsoleClientTest.php create mode 100644 tests/e2e/Services/Tokens/TokensCustomClientTest.php create mode 100644 tests/e2e/Services/Tokens/TokensCustomServerTest.php diff --git a/app/config/roles.php b/app/config/roles.php index fae97895b8..6d55c1cc9d 100644 --- a/app/config/roles.php +++ b/app/config/roles.php @@ -76,6 +76,8 @@ $admins = [ 'topics.read', 'subscribers.write', 'subscribers.read', + 'tokens.read', + 'tokens.write', ]; return [ diff --git a/app/config/scopes.php b/app/config/scopes.php index 3765ab54fa..e123626c63 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -130,4 +130,10 @@ return [ // List of publicly visible scopes 'assistant.read' => [ 'description' => 'Access to read the Assistant service', ], + 'tokens.read' => [ + 'description' => 'Access to read your project\'s tokens', + ], + 'tokens.write' => [ + 'description' => 'Access to create, update, and delete your project\'s tokens', + ], ]; diff --git a/app/controllers/general.php b/app/controllers/general.php index b2a07f06f6..faf7748468 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -10,6 +10,7 @@ use Appwrite\Event\Func; use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; +use Appwrite\Platform\Appwrite; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -38,6 +39,7 @@ use Utopia\Logger\Adapter\Sentry; use Utopia\Logger\Log; use Utopia\Logger\Log\User; use Utopia\Logger\Logger; +use Utopia\Platform\Service; use Utopia\System\System; use Utopia\Validator\Hostname; use Utopia\Validator\Text; @@ -1100,3 +1102,6 @@ App::wildcard() foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } + +$platform = new Appwrite(); +$platform->init(Service::TYPE_HTTP); \ No newline at end of file diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php index 3e28b23430..490e4e08ed 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php @@ -29,7 +29,7 @@ class CreateToken extends Action public function __construct() { - $this->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) + $this->setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) ->setHttpPath('/v1/tokens') ->desc('Create token') ->groups(['api', 'token']) diff --git a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php index 9df63a0eed..3304933a1f 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php @@ -2,7 +2,12 @@ namespace Appwrite\Platform\Modules\Tokens\Services; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\CreateToken; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\DeleteToken; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetToken; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetTokenJWT; use Appwrite\Platform\Modules\Tokens\Http\Tokens\ListTokens; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\UpdateToken; use Utopia\Platform\Service; class Http extends Service @@ -10,6 +15,14 @@ class Http extends Service public function __construct() { $this->type = Service::TYPE_HTTP; - $this->addAction(ListTokens::getName(), new ListTokens()); + $this + ->addAction(CreateToken::getName(), new CreateToken()) + ->addAction(DeleteToken::getName(), new DeleteToken()) + ->addAction(GetToken::getName(), new GetToken()) + ->addAction(GetTokenJWT::getName(), new GetTokenJWT()) + ->addAction(ListTokens::getName(), new ListTokens()) + ->addAction(UpdateToken::getName(), new UpdateToken()) + ; + } } diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index 5c57677783..ae93d6164a 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -11,86 +11,6 @@ use Utopia\Database\Helpers\Role; trait TokensBase { - /** - * @group fileTokens - */ - public function testCreateFileToken(): array - { - - $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', - 'fileSecurity' => true, - 'maximumFileSize' => 2000000, //2MB - 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], - 'permissions' => [ - Permission::read(Role::any()), - Permission::create(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - $this->assertEquals(201, $bucket['headers']['status-code']); - $this->assertNotEmpty($bucket['body']['$id']); - - $bucketId = $bucket['body']['$id']; - - $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([ - 'content-type' => 'multipart/form-data', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'fileId' => ID::unique(), - 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), - 'permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - ]); - $this->assertEquals(201, $file['headers']['status-code']); - $this->assertNotEmpty($file['body']['$id']); - - $fileId = $file['body']['$id']; - - $res = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files/' . $fileId . '/tokens', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(201, $res['headers']['status-code']); - $this->assertEquals('files', $res['body']['resourceType']); - - $data = []; - $data['fileId'] = $fileId; - $data['bucketId'] = $bucketId; - $data['tokenId'] = $res['body']['$id']; - return $data; - } - - /** - * @group fileTokens - * @depends testCreateFileToken - */ - public function testUpdateFileToken(array $data): array - { - $bucketId = $data['bucketId']; - $fileId = $data['fileId']; - $tokenId = $data['tokenId']; - - $expiry = DateTime::now(); - $res = $this->client->call(Client::METHOD_PUT, '/storage/buckets/'. $bucketId . '/files/'. $fileId . '/tokens/' . $tokenId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'expire' => $expiry, - ]); - - $this->assertEquals($expiry, $res['body']['expire']); - return $data; - } + } diff --git a/tests/e2e/Services/Tokens/TokensConsoleClientTest.php b/tests/e2e/Services/Tokens/TokensConsoleClientTest.php new file mode 100644 index 0000000000..1ce72335dd --- /dev/null +++ b/tests/e2e/Services/Tokens/TokensConsoleClientTest.php @@ -0,0 +1,14 @@ +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', + 'fileSecurity' => true, + 'maximumFileSize' => 2000000, //2MB + 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']['$id']); + + $bucketId = $bucket['body']['$id']; + + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $file['headers']['status-code']); + $this->assertNotEmpty($file['body']['$id']); + + $fileId = $file['body']['$id']; + + $res = $this->client->call(Client::METHOD_POST, '/tokens', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], $this->getHeaders()), [ + 'resourceType' => 'files', + 'resourceId' => $bucketId . ':' . $fileId + ]); + + $this->assertEquals(201, $res['headers']['status-code']); + $this->assertEquals('files', $res['body']['resourceType']); + + $data = []; + $data['fileId'] = $fileId; + $data['bucketId'] = $bucketId; + $data['tokenId'] = $res['body']['$id']; + return $data; + } + + /** + * @depends testCreateToken + */ + public function testUpdateToken(array $data): array + { + $bucketId = $data['bucketId']; + $fileId = $data['fileId']; + $tokenId = $data['tokenId']; + + $expiry = DateTime::now(); + $res = $this->client->call(Client::METHOD_PUT, '/tokens/' . $tokenId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'expire' => $expiry, + ]); + + $this->assertEquals($expiry, $res['body']['expire']); + return $data; + } + + /** + * @depends testUpdateToken + */ + public function testDeleteToken(array $data): array + { + + return $data; + } +} From cc3edd7b2bd443f5165b26007b84254b3269c744 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 22 Nov 2024 04:21:03 +0000 Subject: [PATCH 042/169] Refactor naming to Dev keys --- app/config/collections.php | 10 ++--- app/controllers/general.php | 8 ++-- app/controllers/shared/api.php | 6 +-- app/init.php | 10 ++--- src/Appwrite/Platform/Appwrite.php | 4 +- .../Http/DevKeys}/CreateKey.php | 4 +- .../Http/DevKeys}/DeleteKey.php | 8 ++-- .../Http/DevKeys}/GetKey.php | 6 +-- .../Http/DevKeys}/ListKeys.php | 4 +- .../Http/DevKeys}/Update.php | 8 ++-- .../Http/DevKeys}/UpdateKey.php | 8 ++-- .../{DevelopmentKeys => DevKeys}/Module.php | 4 +- .../Services/Http.php | 12 +++--- .../Projects/ProjectsConsoleClientTest.php | 4 +- ...evelopmentKeys.php => ProjectsDevKeys.php} | 38 +++++++++---------- 15 files changed, 67 insertions(+), 67 deletions(-) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/CreateKey.php (95%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/DeleteKey.php (87%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/GetKey.php (91%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/ListKeys.php (93%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/Update.php (90%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys/Http/DevelopmentKeys => DevKeys/Http/DevKeys}/UpdateKey.php (90%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys => DevKeys}/Module.php (59%) rename src/Appwrite/Platform/Modules/{DevelopmentKeys => DevKeys}/Services/Http.php (51%) rename tests/e2e/Services/Projects/{ProjectsDevelopmentKeys.php => ProjectsDevKeys.php} (90%) diff --git a/app/config/collections.php b/app/config/collections.php index f7403c7054..45e4501fe4 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -4520,7 +4520,7 @@ $consoleCollections = array_merge([ 'filters' => ['subQueryKeys'], ], [ - '$id' => ID::custom('developmentKeys'), + '$id' => ID::custom('devKeys'), 'type' => Database::VAR_STRING, 'format' => '', 'size' => 16384, @@ -4528,7 +4528,7 @@ $consoleCollections = array_merge([ 'required' => false, 'default' => null, 'array' => false, - 'filters' => ['subQueryDevelopmentKeys'], + 'filters' => ['subQueryDevKeys'], ], [ '$id' => ID::custom('search'), @@ -4932,10 +4932,10 @@ $consoleCollections = array_merge([ ], ], - 'developmentKeys' => [ + 'devKeys' => [ '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('developmentKeys'), - 'name' => 'keys', + '$id' => ID::custom('devKeys'), + 'name' => 'Dev keys', 'attributes' => [ [ '$id' => ID::custom('projectInternalId'), diff --git a/app/controllers/general.php b/app/controllers/general.php index cecbfdd7f5..e1da716d4c 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -710,8 +710,8 @@ App::error() ->inject('logger') ->inject('log') ->inject('queueForUsage') - ->inject('developmentKey') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, Document $developmentKey) { + ->inject('devKey') + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, Document $devKey) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); @@ -912,7 +912,7 @@ App::error() $type = $error->getType(); - $output = ((App::isDevelopment()) || (!$developmentKey->isEmpty())) ? [ + $output = ((App::isDevelopment()) || (!$devKey->isEmpty())) ? [ 'message' => $message, 'code' => $code, 'file' => $file, @@ -953,7 +953,7 @@ App::error() $response->dynamic( new Document($output), - $utopia->isDevelopment() || !$developmentKey->isEmpty() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR + $utopia->isDevelopment() || !$devKey->isEmpty() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR ); }); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 70a97099b2..6b2abd228f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -393,8 +393,8 @@ App::init() ->inject('queueForUsage') ->inject('dbForProject') ->inject('mode') - ->inject('developmentKey') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Connection $queue, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode, Document $developmentKey) use ($usageDatabaseListener, $eventDatabaseListener) { + ->inject('devKey') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Connection $queue, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, string $mode, Document $devKey) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -461,7 +461,7 @@ App::init() $enabled // Abuse is enabled && !$isAppUser // User is not API key && !$isPrivilegedUser // User is not an admin - && $developmentKey->isEmpty() // request doesn't not contain development key + && $devKey->isEmpty() // request doesn't not contain development key && $abuse->check() // Route is rate-limited ) { throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED); diff --git a/app/init.php b/app/init.php index c93ffdae53..2056cdca20 100644 --- a/app/init.php +++ b/app/init.php @@ -477,13 +477,13 @@ Database::addFilter( ); Database::addFilter( - 'subQueryDevelopmentKeys', + 'subQueryDevKeys', function (mixed $value) { return; }, function (mixed $value, Document $document, Database $database) { return $database - ->find('developmentKeys', [ + ->find('devKeys', [ Query::equal('projectInternalId', [$document->getInternalId()]), Query::limit(APP_LIMIT_SUBQUERY), ]); @@ -1814,10 +1814,10 @@ App::setResource('plan', function (array $plan = []) { return []; }); -App::setResource('developmentKey', function ($request, $project, $dbForConsole) { - $developmentKey = $request->getHeader('x-appwrite-development-key', ''); +App::setResource('devKey', function ($request, $project, $dbForConsole) { + $devKey = $request->getHeader('x-appwrite-development-key', ''); // Check if given key match project's development keys - $key = $project->find('secret', $developmentKey, 'developmentKeys'); + $key = $project->find('secret', $devKey, 'devKeys'); if ($key) { $expire = $key->getAttribute('expire'); if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 153b22c02c..ec19b3248c 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -3,7 +3,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; -use Appwrite\Platform\Modules\DevelopmentKeys; +use Appwrite\Platform\Modules\DevKeys; use Utopia\Platform\Platform; class Appwrite extends Platform @@ -11,6 +11,6 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); - $this->addModule(new DevelopmentKeys\Module()); + $this->addModule(new DevKeys\Module()); } } diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php similarity index 95% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php index c6eee58adb..2e1c4db7f2 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/CreateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php @@ -1,6 +1,6 @@ \bin2hex(\random_bytes(128)), ]); - $key = $dbForConsole->createDocument('developmentKeys', $key); + $key = $dbForConsole->createDocument('devKeys', $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/DeleteKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php similarity index 87% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/DeleteKey.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php index 493f3e8457..1d5b2a324d 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/DeleteKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php @@ -1,6 +1,6 @@ label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteDevelopmentKey') + ->label('sdk.method', 'deleteDevKey') ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) ->label('sdk.response.model', Response::MODEL_NONE) ->param('projectId', '', new UID(), 'Project unique ID.') @@ -47,7 +47,7 @@ class DeleteKey extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('developmentKeys', [ + $key = $dbForConsole->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -56,7 +56,7 @@ class DeleteKey extends Action throw new Exception(Exception::KEY_NOT_FOUND); } - $dbForConsole->deleteDocument('developmentKeys', $key->getId()); + $dbForConsole->deleteDocument('devKeys', $key->getId()); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/GetKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php similarity index 91% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/GetKey.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php index 218c657ea4..4dc95bf091 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/GetKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php @@ -1,6 +1,6 @@ label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getDevelopmentKey') + ->label('sdk.method', 'getDevKey') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_KEY) @@ -48,7 +48,7 @@ class GetKey extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('developmentKeys', [ + $key = $dbForConsole->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/ListKeys.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php similarity index 93% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/ListKeys.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php index 5dc6872471..a6461014c8 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/ListKeys.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php @@ -1,6 +1,6 @@ find('developmentKeys', [ + $keys = $dbForConsole->find('devKeys', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/Update.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php similarity index 90% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/Update.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php index ee61bcb087..ef2da333f9 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/Update.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php @@ -1,6 +1,6 @@ label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateDevelopmentKey') + ->label('sdk.method', 'updateDevKey') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_KEY) @@ -50,7 +50,7 @@ class UpdateKey extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('developmentKeys', [ + $key = $dbForConsole->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -63,7 +63,7 @@ class UpdateKey extends Action ->setAttribute('name', $name) ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); - $dbForConsole->updateDocument('developmentKeys', $key->getId(), $key); + $dbForConsole->updateDocument('devKeys', $key->getId(), $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php similarity index 90% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/UpdateKey.php rename to src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php index 4d6a0785af..16906e92b3 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Http/DevelopmentKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php @@ -1,6 +1,6 @@ label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateDevelopmentKey') + ->label('sdk.method', 'updateDevKey') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_KEY) @@ -50,7 +50,7 @@ class UpdateKey extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('developmentKeys', [ + $key = $dbForConsole->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -63,7 +63,7 @@ class UpdateKey extends Action ->setAttribute('name', $name) ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); - $dbForConsole->updateDocument('developmentKeys', $key->getId(), $key); + $dbForConsole->updateDocument('devKeys', $key->getId(), $key); $dbForConsole->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php b/src/Appwrite/Platform/Modules/DevKeys/Module.php similarity index 59% rename from src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php rename to src/Appwrite/Platform/Modules/DevKeys/Module.php index 299868cb57..796ec50186 100644 --- a/src/Appwrite/Platform/Modules/DevelopmentKeys/Module.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Module.php @@ -1,8 +1,8 @@ DateTime::addSeconds(new \DateTime(), 3600), ]); - $developmentKey = $response['body']['secret']; + $devKey = $response['body']['secret']; // for ($i = 0; $i < 11; $i++) { @@ -152,7 +152,7 @@ trait ProjectsDevelopmentKeys $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-development-key' => $developmentKey + 'x-appwrite-development-key' => $devKey ], [ 'email' => 'user@appwrite.io', 'password' => 'password' @@ -184,10 +184,10 @@ trait ProjectsDevelopmentKeys /** - * @depends testCreateProjectDevelopmentKey - * @group developmentKeys + * @depends testCreateProjectDevKey + * @group devKeys */ - public function testUpdateProjectDevelopmentKey($data): array + public function testUpdateProjectDevKey($data): array { $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; @@ -227,10 +227,10 @@ trait ProjectsDevelopmentKeys } /** - * @depends testCreateProjectDevelopmentKey - * @group developmentKeys + * @depends testCreateProjectDevKey + * @group devKeys */ - public function testDeleteProjectDevelopmentKey($data): array + public function testDeleteProjectDevKey($data): array { $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; From b3c2f8a0247c65d333840dcc8268caddab5888a6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 22 Nov 2024 05:55:39 +0000 Subject: [PATCH 043/169] disable CORS --- app/controllers/general.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index e1da716d4c..0479ceb083 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -458,7 +458,8 @@ App::init() ->inject('queueForCertificates') ->inject('queueForFunctions') ->inject('isResourceBlocked') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForConsole, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, Usage $queueForUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked) { + ->inject('devKey') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForConsole, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, Usage $queueForUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked, Document $devKey) { /* * Appwrite Router */ @@ -656,6 +657,7 @@ App::init() if ( !$originValidator->isValid($origin) + && $devKey->isEmpty() && \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE]) && $route->getLabel('origin', false) !== '*' && empty($request->getHeader('x-appwrite-key', '')) @@ -676,7 +678,8 @@ App::options() ->inject('queueForFunctions') ->inject('geodb') ->inject('isResourceBlocked') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked) { + ->inject('devKey') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, Document $devKey) { /* * Appwrite Router */ @@ -696,7 +699,7 @@ App::options() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Appwrite-Session, X-Fallback-Cookies, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $origin) + ->addHeader('Access-Control-Allow-Origin', $devKey->isEmpty() ? $origin : '*') ->addHeader('Access-Control-Allow-Credentials', 'true') ->noContent(); }); From 010ace3b57ab3abfbee866325958f4ee57b24bda Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 22 Nov 2024 06:56:36 +0000 Subject: [PATCH 044/169] update redirect validator --- app/controllers/api/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 76a3ef8b61..82b3d918a6 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1109,8 +1109,8 @@ App::get('/v1/account/sessions/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients']) - ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients']) + ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients', 'devKey']) + ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') From 2c6e5d0bea5463d322f7d77f2680f368eebd8de9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 28 Nov 2024 01:43:21 +0000 Subject: [PATCH 045/169] remove old file --- .../Modules/DevKeys/Http/DevKeys/Update.php | 72 ------------------- 1 file changed, 72 deletions(-) delete mode 100644 src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php deleted file mode 100644 index ef2da333f9..0000000000 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/Update.php +++ /dev/null @@ -1,72 +0,0 @@ -setHttpMethod(Action::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') - ->desc('Update key') - ->groups(['api', 'projects']) - ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateDevKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) - ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('keyId', '', new UID(), 'Key unique ID.') - ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', true) - ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); - } - public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForConsole) - { - - $project = $dbForConsole->getDocument('projects', $projectId); - - if ($project->isEmpty()) { - throw new Exception(Exception::PROJECT_NOT_FOUND); - } - - $key = $dbForConsole->findOne('devKeys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); - - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - - $key - ->setAttribute('name', $name) - ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); - - $dbForConsole->updateDocument('devKeys', $key->getId(), $key); - - $dbForConsole->purgeCachedDocument('projects', $project->getId()); - - $response->dynamic($key, Response::MODEL_KEY); - } -} From 8206cee44928ffdb1e885fd9ec6cfd3903e32297 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 10:57:49 +0545 Subject: [PATCH 046/169] Update tests/e2e/Services/Projects/ProjectsDevKeys.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 97eb9297a4..7c8149bbcc 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -157,7 +157,7 @@ trait ProjectsDevKeys 'email' => 'user@appwrite.io', 'password' => 'password' ]); - $this->assertEquals('401', $res['headers']['status-code']); + $this->assertEquals(401, $res['headers']['status-code']); /** From b8917bc8115d07a45a2333082547f0c5ed8b5da6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 10:58:05 +0545 Subject: [PATCH 047/169] Update tests/e2e/Services/Projects/ProjectsDevKeys.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 7c8149bbcc..3fbe569d29 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -147,7 +147,7 @@ trait ProjectsDevKeys 'email' => 'user@appwrite.io', 'password' => 'password' ]); - $this->assertEquals('429', $res['headers']['status-code']); + $this->assertEquals(429, $res['headers']['status-code']); $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', From 8a59a22c2e0a25af066833a830198dda95c1676d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:25:16 +0000 Subject: [PATCH 048/169] update suggested changes --- app/controllers/api/account.php | 10 +++++----- app/controllers/api/teams.php | 2 +- app/controllers/general.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 82b3d918a6..8349142c14 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1698,8 +1698,8 @@ App::get('/v1/account/tokens/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients']) - ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients']) + ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients', 'devKey']) + ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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.', true, ['clients', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') @@ -1772,7 +1772,7 @@ App::post('/v1/account/tokens/magic-url') ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients) => new Host($clients), '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.', true, ['clients']) + ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), '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.', true, ['clients', 'devKey']) ->param('phrase', false, new Boolean(), 'Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.', true) ->inject('request') ->inject('response') @@ -2969,7 +2969,7 @@ App::post('/v1/account/recovery') ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients) => new Host($clients), '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.', false, ['clients']) + ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), '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.', false, ['clients', 'devKey']) ->inject('request') ->inject('response') ->inject('user') @@ -3232,7 +3232,7 @@ App::post('/v1/account/verification') ->label('sdk.response.model', Response::MODEL_TOKEN) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') - ->param('url', '', fn ($clients) => new Host($clients), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page + ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients', 'devKey']) // TODO add built-in confirm page ->inject('request') ->inject('response') ->inject('project') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index f829800b98..92e4a2b1dd 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -413,7 +413,7 @@ App::post('/v1/teams/:teamId/memberships') } return new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE); }, 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', false, ['project']) - ->param('url', '', fn ($clients) => new Host($clients), '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.', true, ['clients']) // TODO add our own built-in confirm page + ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), '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.', true, ['clients', 'devKey']) // TODO add our own built-in confirm page ->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true) ->inject('response') ->inject('project') diff --git a/app/controllers/general.php b/app/controllers/general.php index dbe58d1bcb..23d1b75b1b 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -672,7 +672,7 @@ App::init() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $refDomain) + ->addHeader('Access-Control-Allow-Origin', $devKey->isEmpty() ? $refDomain : "*") ->addHeader('Access-Control-Allow-Credentials', 'true'); /* From fb0da77d2f5f9749bb600cc1968f5062f7ca12b1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:26:52 +0000 Subject: [PATCH 049/169] add todo --- app/controllers/general.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/general.php b/app/controllers/general.php index 23d1b75b1b..56d9c3f6f2 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -947,6 +947,8 @@ App::error() $type = $error->getType(); + // TODO filter out secrets and server details when not in development + // but devKey is provided $output = ((App::isDevelopment()) || (!$devKey->isEmpty())) ? [ 'message' => $message, 'code' => $code, From e536e6ea745d3e7a1adec900de6cc4a581f4b76f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:29:13 +0000 Subject: [PATCH 050/169] support dev key from param as well --- app/init.php | 4 ++-- tests/e2e/Services/Projects/ProjectsDevKeys.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/init.php b/app/init.php index 9dc5e28e80..c16b47961b 100644 --- a/app/init.php +++ b/app/init.php @@ -1811,8 +1811,8 @@ App::setResource('plan', function (array $plan = []) { return []; }); -App::setResource('devKey', function ($request, $project, $dbForConsole) { - $devKey = $request->getHeader('x-appwrite-development-key', ''); +App::setResource('devKey', function (Request $request, Document $project, Database $dbForConsole) { + $devKey = $request->getHeader('x-appwrite-dev-key', $request->getParam('devKey', '')); // Check if given key match project's development keys $key = $project->find('secret', $devKey, 'devKeys'); if ($key) { diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 3fbe569d29..86eff481ae 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -152,7 +152,7 @@ trait ProjectsDevKeys $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-development-key' => $devKey + 'x-appwrite-dev-key' => $devKey ], [ 'email' => 'user@appwrite.io', 'password' => 'password' @@ -174,7 +174,7 @@ trait ProjectsDevKeys $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-development-key' => $response['body']['secret'] + 'x-appwrite-dev-key' => $response['body']['secret'] ], [ 'email' => 'user@appwrite.io', 'password' => 'password' From ec14cc170fbf7d14136f73c41976c2e36f7c7621 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:40:09 +0000 Subject: [PATCH 051/169] fixing response model --- .../DevKeys/Http/DevKeys/CreateKey.php | 8 +- .../DevKeys/Http/DevKeys/DeleteKey.php | 2 +- .../Modules/DevKeys/Http/DevKeys/GetKey.php | 6 +- .../Modules/DevKeys/Http/DevKeys/ListKeys.php | 8 +- .../DevKeys/Http/DevKeys/UpdateKey.php | 6 +- src/Appwrite/Utopia/Response.php | 5 ++ src/Appwrite/Utopia/Response/Model/DevKey.php | 82 +++++++++++++++++++ 7 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 src/Appwrite/Utopia/Response/Model/DevKey.php diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php index 2e1c4db7f2..68ca88a58a 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php @@ -28,15 +28,15 @@ class CreateKey extends Action $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) ->setHttpPath('/v1/projects/:projectId/development-keys') - ->desc('Create key') + ->desc('Create dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') + ->label('sdk.method', 'createDevKey') ->label('sdk.response.code', Response::STATUS_CODE_CREATED) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk.response.model', Response::MODEL_DEV_KEY) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) @@ -75,6 +75,6 @@ class CreateKey extends Action $response ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($key, Response::MODEL_KEY); + ->dynamic($key, Response::MODEL_DEV_KEY); } } diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php index 1d5b2a324d..fcc6083340 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php @@ -23,7 +23,7 @@ class DeleteKey extends Action $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_DELETE) ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') - ->desc('Delete key') + ->desc('Delete dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php index 4dc95bf091..f9c542c6b2 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php @@ -23,7 +23,7 @@ class GetKey extends Action $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') - ->desc('Get key') + ->desc('Get dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -31,7 +31,7 @@ class GetKey extends Action ->label('sdk.method', 'getDevKey') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk.response.model', Response::MODEL_DEV_KEY) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') @@ -57,6 +57,6 @@ class GetKey extends Action throw new Exception(Exception::KEY_NOT_FOUND); } - $response->dynamic($key, Response::MODEL_KEY); + $response->dynamic($key, Response::MODEL_DEV_KEY); } } diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php index a6461014c8..a4b4083080 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php @@ -24,15 +24,15 @@ class ListKeys extends Action $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) ->setHttpPath('/v1/projects/:projectId/development-keys') - ->desc('List keys') + ->desc('List dev keys') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listKeys') + ->label('sdk.method', 'listDevKeys') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->label('sdk.response.model', Response::MODEL_DEV_KEY_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForConsole') @@ -56,6 +56,6 @@ class ListKeys extends Action $response->dynamic(new Document([ 'keys' => $keys, 'total' => count($keys), - ]), Response::MODEL_KEY_LIST); + ]), Response::MODEL_DEV_KEY_LIST); } } diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php index 16906e92b3..5c6ded23c0 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php @@ -24,7 +24,7 @@ class UpdateKey extends Action { $this->setHttpMethod(Action::HTTP_REQUEST_METHOD_PUT) ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') - ->desc('Update key') + ->desc('Update dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -32,7 +32,7 @@ class UpdateKey extends Action ->label('sdk.method', 'updateDevKey') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk.response.model', Response::MODEL_DEV_KEY) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') @@ -67,6 +67,6 @@ class UpdateKey extends Action $dbForConsole->purgeCachedDocument('projects', $project->getId()); - $response->dynamic($key, Response::MODEL_KEY); + $response->dynamic($key, Response::MODEL_DEV_KEY); } } diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 6cc2639f51..c196331346 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -39,6 +39,7 @@ use Appwrite\Utopia\Response\Model\Currency; use Appwrite\Utopia\Response\Model\Database; use Appwrite\Utopia\Response\Model\Deployment; use Appwrite\Utopia\Response\Model\Detection; +use Appwrite\Utopia\Response\Model\DevKey; use Appwrite\Utopia\Response\Model\Document as ModelDocument; use Appwrite\Utopia\Response\Model\Error; use Appwrite\Utopia\Response\Model\ErrorDev; @@ -282,6 +283,8 @@ class Response extends SwooleResponse public const MODEL_WEBHOOK_LIST = 'webhookList'; public const MODEL_KEY = 'key'; public const MODEL_KEY_LIST = 'keyList'; + public const MODEL_DEV_KEY = 'devKey'; + public const MODEL_DEV_KEY_LIST = 'devKeyList'; public const MODEL_MOCK_NUMBER = 'mockNumber'; public const MODEL_AUTH_PROVIDER = 'authProvider'; public const MODEL_AUTH_PROVIDER_LIST = 'authProviderList'; @@ -363,6 +366,7 @@ class Response extends SwooleResponse ->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false)) ->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false)) ->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false)) + ->setModel(new BaseList('Dev Keys List', self::MODEL_DEV_KEY_LIST, 'keys', self::MODEL_DEV_KEY, true, false)) ->setModel(new BaseList('Auth Providers List', self::MODEL_AUTH_PROVIDER_LIST, 'platforms', self::MODEL_AUTH_PROVIDER, true, false)) ->setModel(new BaseList('Platforms List', self::MODEL_PLATFORM_LIST, 'platforms', self::MODEL_PLATFORM, true, false)) ->setModel(new BaseList('Countries List', self::MODEL_COUNTRY_LIST, 'countries', self::MODEL_COUNTRY)) @@ -438,6 +442,7 @@ class Response extends SwooleResponse ->setModel(new Project()) ->setModel(new Webhook()) ->setModel(new Key()) + ->setModel(new DevKey()) ->setModel(new MockNumber()) ->setModel(new AuthProvider()) ->setModel(new Platform()) diff --git a/src/Appwrite/Utopia/Response/Model/DevKey.php b/src/Appwrite/Utopia/Response/Model/DevKey.php new file mode 100644 index 0000000000..50ce750b6a --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/DevKey.php @@ -0,0 +1,82 @@ +addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Key ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Key creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Key update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('name', [ + 'type' => self::TYPE_STRING, + 'description' => 'Key name.', + 'default' => '', + 'example' => 'My API Key', + ]) + ->addRule('expire', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Key expiration date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('secret', [ + 'type' => self::TYPE_STRING, + 'description' => 'Secret key.', + 'default' => '', + 'example' => '919c2d18fb5d4...a2ae413da83346ad2', + ]) + ->addRule('accessedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Most recent access date in ISO 8601 format. This attribute is only updated again after ' . APP_KEY_ACCESS / 60 / 60 . ' hours.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE + ]) + ; + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'DevKey'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_DEV_KEY; + } +} From 01f579151de5eb82f21989f05849714e4dc9cec1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:43:15 +0000 Subject: [PATCH 052/169] updated project model --- src/Appwrite/Utopia/Response/Model/Project.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index 6e01baee84..055fb07737 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -197,6 +197,13 @@ class Project extends Model 'example' => new \stdClass(), 'array' => true, ]) + ->addRule('devKeys', [ + 'type' => Response::MODEL_DEV_KEY, + 'description' => 'List of dev keys.', + 'default' => [], + 'example' => new \stdClass(), + 'array' => true, + ]) ->addRule('smtpEnabled', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'Status for custom SMTP', From 136cc5fe46ccaf622973b9211ad6c28dc50ebfb3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:45:43 +0000 Subject: [PATCH 053/169] update put request --- .../Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php index 5c6ded23c0..de29b40960 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php @@ -36,7 +36,7 @@ class UpdateKey extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') - ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', true) + ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.') ->inject('response') ->inject('dbForConsole') ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); @@ -61,7 +61,7 @@ class UpdateKey extends Action $key ->setAttribute('name', $name) - ->setAttribute('expire', $expire ?? $key->getAttribute('expire')); + ->setAttribute('expire', $expire); $dbForConsole->updateDocument('devKeys', $key->getId(), $key); From e7943e8490f2ada8f520c0443b8367572e0b3441 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:57:08 +0000 Subject: [PATCH 054/169] update test --- .../e2e/Services/Projects/ProjectsDevKeys.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 86eff481ae..ff5e033cd2 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -130,7 +130,6 @@ trait ProjectsDevKeys $devKey = $response['body']['secret']; - // for ($i = 0; $i < 11; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', @@ -139,6 +138,7 @@ trait ProjectsDevKeys 'email' => 'user@appwrite.io', 'password' => 'password' ]); + $this->assertEquals(200, $res['headers']['status-code']); } $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', @@ -179,7 +179,7 @@ trait ProjectsDevKeys 'email' => 'user@appwrite.io', 'password' => 'password' ]); - $this->assertEquals('429', $res['headers']['status-code']); + $this->assertEquals(429, $res['headers']['status-code']); } @@ -243,12 +243,26 @@ trait ProjectsDevKeys $this->assertEquals(204, $response['headers']['status-code']); $this->assertEmpty($response['body']); + /** + * Get rate limit trying to use the deleted key + */ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $response['body']['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $res['headers']['status-code']); + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); $this->assertEquals(404, $response['headers']['status-code']); + /** * Test for FAILURE From cb1aff42c58cc56b25a36b2655564a1988033ecb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 05:59:03 +0000 Subject: [PATCH 055/169] make 10 requests --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index ff5e033cd2..9c6e062f03 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -130,7 +130,7 @@ trait ProjectsDevKeys $devKey = $response['body']['secret']; - for ($i = 0; $i < 11; $i++) { + for ($i = 0; $i < 10; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, From f21281ebf531c19e35fc39fd94f035e4d1643f6f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 06:02:21 +0000 Subject: [PATCH 056/169] format --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 9c6e062f03..e1eddc8957 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -255,14 +255,14 @@ trait ProjectsDevKeys 'password' => 'password' ]); $this->assertEquals(429, $res['headers']['status-code']); - + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); $this->assertEquals(404, $response['headers']['status-code']); - + /** * Test for FAILURE From 11bf99c871df59d23571de2f8382d73f75ee32ac Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 08:25:55 +0000 Subject: [PATCH 057/169] restructure endpoints --- .../Http/Tokens/Buckets/Files/Action.php | 45 +++++++ .../Tokens/Buckets/Files/CreateFileToken.php | 86 ++++++++++++ .../Files/ListFileTokens.php} | 20 ++- .../Tokens/Http/Tokens/CreateToken.php | 123 ------------------ .../Tokens/Http/Tokens/GetTokenJWT.php | 16 +-- 5 files changed, 152 insertions(+), 138 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php create mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php rename src/Appwrite/Platform/Modules/Tokens/Http/Tokens/{ListTokens.php => Buckets/Files/ListFileTokens.php} (71%) delete mode 100644 src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php 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 new file mode 100644 index 0000000000..612710e4d5 --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php @@ -0,0 +1,45 @@ + $dbForProject->getDocument('buckets', $bucketId)); + + $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isPrivilegedUser = Auth::isPrivilegedUser(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()); + if (!$fileSecurity && !$valid) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + if ($fileSecurity && !$valid) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + + if ($file->isEmpty()) { + throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); + } + return [ + 'bucket' => $bucket, + 'file' => $file, + ]; + } +} \ No newline at end of file diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php new file mode 100644 index 0000000000..7f5ac38fea --- /dev/null +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php @@ -0,0 +1,86 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/tokens/buckets/:bucketId/files/:fileId') + ->desc('Create file token') + ->groups(['api', 'token']) + ->label('scope', 'tokens.write') + ->label('audits.event', 'token.create') + ->label('event', 'tokens.[tokenId].create') + ->label('audits.resource', 'token/{response.$id}') + ->label('usage.metric', 'tokens.{scope}.requests.create') + ->label('usage.params', ['resourceId:{request.resourceId}', 'resourceType:{request.resourceType}']) + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'createFileToken') + ->label('sdk.description', '/docs/references/tokens/create_file_token.md') + ->label('sdk.response.code', Response::STATUS_CODE_CREATED) + ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) + ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File unique ID.') + ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) + ->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) + ->inject('response') + ->inject('dbForProject') + ->inject('user') + ->inject('queueForEvents') + ->callback(fn ($bucketId, $fileId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents) => $this->action($bucketId, $fileId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents)); + } + + public function action(string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) + { + + ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $bucketId, $fileId); + + $token = $dbForProject->createDocument('resourceTokens', new Document([ + '$id' => ID::unique(), + 'secret' => Auth::tokenGenerator(128), + 'resourceId' => $bucketId . ':' . $fileId, + 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), + 'resourceType' => 'file', + 'expire' => $expire, + '$permissions' => $permissions + ])); + + $queueForEvents + ->setParam('bucketId', $bucket->getId()) + ->setParam('fileId', $file->getId()) + ->setParam('tokenId', $token->getId()) + ->setContext('bucket', $bucket) + ; + + $response + ->setStatusCode(Response::STATUS_CODE_CREATED) + ->dynamic($token, Response::MODEL_RESOURCE_TOKEN); + } +} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php similarity index 71% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php rename to src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php index 5b8948d357..88a6137654 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/ListTokens.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php @@ -1,6 +1,6 @@ setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/storage/buckets/:bucketId/files/:fileId/tokens') + ->setHttpPath('/v1/tokens/buckets/:bucketId/files/:fileId') ->desc('List tokens') ->groups(['api', 'tokens']) ->label('scope', 'tokens.read') @@ -37,15 +37,21 @@ class ListTokens extends Action ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN_LIST) + ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') + ->param('fileId', '', new UID(), 'File unique ID.') ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback(fn ($queries, $response, $dbForProject) => $this->action($queries, $response, $dbForProject)); + ->callback(fn ($bucketId, $fileId, $queries, $response, $dbForProject) => $this->action($bucketId, $fileId, $queries, $response, $dbForProject)); } - public function action(array $queries, Response $response, Database $dbForProject) + public function action(string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) { + ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $bucketId, $fileId); + $queries = Query::parseQueries($queries); + $queries[] = Query::equal('resourceType', ["files"]); + $queries[] = Query::equal('resourceId', [$bucket->getInternalId() . ':' . $file->getInternalId()]); // Get cursor document if there was a cursor query $cursor = \array_filter($queries, function ($query) { return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php deleted file mode 100644 index 490e4e08ed..0000000000 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/CreateToken.php +++ /dev/null @@ -1,123 +0,0 @@ -setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/tokens') - ->desc('Create token') - ->groups(['api', 'token']) - ->label('scope', 'tokens.write') - ->label('audits.event', 'token.create') - ->label('event', 'tokens.[tokenId].create') - ->label('audits.resource', 'token/{response.$id}') - ->label('usage.metric', 'tokens.{scope}.requests.create') - ->label('usage.params', ['resourceId:{request.resourceId}', 'resourceType:{request.resourceType}']) - ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') - ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) - ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/tokens/create.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) - ->param('resourceType', '', new WhiteList(['files']), 'Resource type one of [files].') - ->param('resourceId', '', new UID(), 'Unique resource ID.') - ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) - ->param('permissions', [], new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) - ->inject('response') - ->inject('dbForProject') - ->inject('user') - ->inject('queueForEvents') - ->callback(fn ($resourceType, $resourceId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents) => $this->action($resourceType, $resourceId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents)); - } - - public function action(string $resourceType, string $resourceId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) - { - - if ($resourceType === 'files') { - $ids = explode(':', $resourceId); - if (count($ids) !== 2) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid resource id'); - } - $bucketId = $ids[0]; - $fileId = $ids[1]; - $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); - $isPrivilegedUser = Auth::isPrivilegedUser(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()); - if (!$fileSecurity && !$valid) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); - } - - if ($file->isEmpty()) { - throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); - } - - $token = $dbForProject->createDocument('resourceTokens', new Document([ - '$id' => ID::unique(), - 'secret' => Auth::tokenGenerator(128), - 'resourceId' => $bucketId . ':' . $fileId, - 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), - 'resourceType' => 'file', - 'expire' => $expire, - '$permissions' => $permissions - ])); - - $queueForEvents - ->setParam('bucketId', $bucket->getId()) - ->setParam('fileId', $file->getId()) - ->setParam('tokenId', $token->getId()) - ->setContext('bucket', $bucket) - ; - - $response - ->setStatusCode(Response::STATUS_CODE_CREATED) - ->dynamic($token, Response::MODEL_RESOURCE_TOKEN); - } else { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Invalid resource type'); - } - } -} diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php index 253b0b6fd0..225c9b78fb 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php @@ -24,15 +24,15 @@ class GetTokenJWT extends Action public function __construct() { $this->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId/jwt') - ->desc('Get file token jwt') - ->groups(['api', 'storage']) - ->label('scope', 'files.read') + ->setHttpPath('/v1/tokens/:tokenId/jwt') + ->desc('Get token as JWT') + ->groups(['api', 'tokens']) + ->label('scope', 'tokens.read') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('usage.metric', 'fileTokens.{scope}.requests.read') - ->label('usage.params', ['bucketId:{request.bucketId}','fileId:{request.fileId}']) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileTokenJWT') + ->label('usage.metric', 'tokens.{scope}.requests.read') + ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('sdk.namespace', 'tokens') + ->label('sdk.method', 'getJWT') ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) From 285544d2d650bfc9126f8b32b533cbe653ebc602 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Wed, 4 Dec 2024 09:39:30 +0000 Subject: [PATCH 058/169] delete token test --- .../Services/Tokens/TokensCustomServerTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/e2e/Services/Tokens/TokensCustomServerTest.php b/tests/e2e/Services/Tokens/TokensCustomServerTest.php index d326087b65..91f0e72dc9 100644 --- a/tests/e2e/Services/Tokens/TokensCustomServerTest.php +++ b/tests/e2e/Services/Tokens/TokensCustomServerTest.php @@ -61,14 +61,11 @@ class TokensCustomServerTest extends Scope $fileId = $file['body']['$id']; - $res = $this->client->call(Client::METHOD_POST, '/tokens', array_merge([ + $res = $this->client->call(Client::METHOD_POST, '/tokens/buckets/' . $bucketId . '/files/' . $fileId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], - ], $this->getHeaders()), [ - 'resourceType' => 'files', - 'resourceId' => $bucketId . ':' . $fileId - ]); + ], $this->getHeaders()), []); $this->assertEquals(201, $res['headers']['status-code']); $this->assertEquals('files', $res['body']['resourceType']); @@ -85,8 +82,6 @@ class TokensCustomServerTest extends Scope */ public function testUpdateToken(array $data): array { - $bucketId = $data['bucketId']; - $fileId = $data['fileId']; $tokenId = $data['tokenId']; $expiry = DateTime::now(); @@ -106,7 +101,14 @@ class TokensCustomServerTest extends Scope */ public function testDeleteToken(array $data): array { + $tokenId = $data['tokenId']; + $res = $this->client->call(Client::METHOD_DELETE, '/tokens/' . $tokenId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $res['headers']['status-code']); return $data; } } From 0770748c0f5c976bb45c51768813df53b1fa9ad3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 5 Dec 2024 05:40:45 +0000 Subject: [PATCH 059/169] validate file and bucket permission - validate file update permission when creating file token --- .../Tokens/Buckets/Files/CreateFileToken.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php index 7f5ac38fea..e422cd1c8a 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php @@ -9,6 +9,7 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; @@ -60,8 +61,24 @@ class CreateFileToken extends Action public function action(string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) { + /** + * @var Document $bucket + * @var Document $file + */ ['bucket' => $bucket, 'file' => $file] = $this->getFileAndBucket($dbForProject, $bucketId, $fileId); + $fileSecurity = $bucket->getAttribute('fileSecurity', false); + $validator = new Authorization(Database::PERMISSION_UPDATE); + $bucketPermission = $validator->isValid($bucket->getUpdate()); + if (!$fileSecurity && !$bucketPermission) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + + $filePermission = $validator->isValid($file->getUpdate()); + if ($fileSecurity && !$bucketPermission && !$filePermission) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + $token = $dbForProject->createDocument('resourceTokens', new Document([ '$id' => ID::unique(), 'secret' => Auth::tokenGenerator(128), From e21467d9f0386a731254d3bfc0b4d8d3ca0f5576 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 5 Dec 2024 05:40:52 +0000 Subject: [PATCH 060/169] format --- app/controllers/general.php | 2 +- .../Modules/Tokens/Http/Tokens/Buckets/Files/Action.php | 2 +- tests/e2e/Services/Tokens/TokensBase.php | 9 --------- tests/e2e/Services/Tokens/TokensCustomServerTest.php | 5 ++--- 4 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index faf7748468..ee78fd0679 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1104,4 +1104,4 @@ foreach (Config::getParam('services', []) as $service) { } $platform = new Appwrite(); -$platform->init(Service::TYPE_HTTP); \ No newline at end of file +$platform->init(Service::TYPE_HTTP); 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 612710e4d5..6d6838451a 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 @@ -42,4 +42,4 @@ class Action extends UtopiaAction 'file' => $file, ]; } -} \ No newline at end of file +} diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index ae93d6164a..11f6897f15 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -2,15 +2,6 @@ namespace Tests\E2E\Services\Tokens; -use CURLFile; -use Tests\E2E\Client; -use Utopia\Database\DateTime; -use Utopia\Database\Helpers\ID; -use Utopia\Database\Helpers\Permission; -use Utopia\Database\Helpers\Role; - trait TokensBase { - - } diff --git a/tests/e2e/Services/Tokens/TokensCustomServerTest.php b/tests/e2e/Services/Tokens/TokensCustomServerTest.php index 91f0e72dc9..4750ec0a2e 100644 --- a/tests/e2e/Services/Tokens/TokensCustomServerTest.php +++ b/tests/e2e/Services/Tokens/TokensCustomServerTest.php @@ -2,12 +2,11 @@ namespace Tests\E2E\Services\Tokens; +use CURLFile; +use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; - -use CURLFile; -use Tests\E2E\Client; use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; From 7c82ff6491a2d5752f6ba81c94874dab3869b5e6 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 5 Dec 2024 06:17:17 +0000 Subject: [PATCH 061/169] fix naming --- src/Appwrite/Platform/Modules/Tokens/Services/Http.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php index 3304933a1f..13233c1fb8 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php @@ -2,11 +2,11 @@ namespace Appwrite\Platform\Modules\Tokens\Services; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\CreateToken; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\CreateFileToken; use Appwrite\Platform\Modules\Tokens\Http\Tokens\DeleteToken; use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetToken; use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetTokenJWT; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\ListTokens; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\ListFileTokens; use Appwrite\Platform\Modules\Tokens\Http\Tokens\UpdateToken; use Utopia\Platform\Service; @@ -16,11 +16,11 @@ class Http extends Service { $this->type = Service::TYPE_HTTP; $this - ->addAction(CreateToken::getName(), new CreateToken()) + ->addAction(CreateFileToken::getName(), new CreateFileToken()) ->addAction(DeleteToken::getName(), new DeleteToken()) ->addAction(GetToken::getName(), new GetToken()) ->addAction(GetTokenJWT::getName(), new GetTokenJWT()) - ->addAction(ListTokens::getName(), new ListTokens()) + ->addAction(ListFileTokens::getName(), new ListFileTokens()) ->addAction(UpdateToken::getName(), new UpdateToken()) ; From 98cf3d4b802bde5ef50c82684c966d3622122944 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 5 Dec 2024 06:19:25 +0000 Subject: [PATCH 062/169] format --- src/Appwrite/Platform/Modules/Tokens/Services/Http.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php index 13233c1fb8..35f9b89b80 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Tokens/Services/Http.php @@ -3,10 +3,10 @@ namespace Appwrite\Platform\Modules\Tokens\Services; use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\CreateFileToken; +use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\ListFileTokens; use Appwrite\Platform\Modules\Tokens\Http\Tokens\DeleteToken; use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetToken; use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetTokenJWT; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\ListFileTokens; use Appwrite\Platform\Modules\Tokens\Http\Tokens\UpdateToken; use Utopia\Platform\Service; From 82d64c8daf12834031875225229ab1748faa1d97 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Dec 2024 08:45:03 +0000 Subject: [PATCH 063/169] fix test --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index e1eddc8957..4a561fdf76 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -27,8 +27,6 @@ trait ProjectsDevKeys $this->assertNotEmpty($response['body']['$id']); $this->assertEquals('Key Test', $response['body']['name']); $this->assertNotEmpty($response['body']['secret']); - $this->assertArrayHasKey('sdks', $response['body']); - $this->assertEmpty($response['body']['sdks']); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); @@ -204,8 +202,6 @@ trait ProjectsDevKeys $this->assertNotEmpty($response['body']['$id']); $this->assertEquals($keyId, $response['body']['$id']); $this->assertEquals('Key Test Update', $response['body']['name']); - $this->assertArrayHasKey('sdks', $response['body']); - $this->assertEmpty($response['body']['sdks']); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); @@ -218,8 +214,6 @@ trait ProjectsDevKeys $this->assertNotEmpty($response['body']['$id']); $this->assertEquals($keyId, $response['body']['$id']); $this->assertEquals('Key Test Update', $response['body']['name']); - $this->assertArrayHasKey('sdks', $response['body']); - $this->assertEmpty($response['body']['sdks']); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); From 30a079a6b991de3966fe28e91fc2c0028b82c3cf Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Dec 2024 09:07:55 +0000 Subject: [PATCH 064/169] fix missing key --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 4a561fdf76..a57a886d4c 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -89,8 +89,6 @@ trait ProjectsDevKeys $this->assertEquals($keyId, $response['body']['$id']); $this->assertEquals('Key Test', $response['body']['name']); $this->assertNotEmpty($response['body']['secret']); - $this->assertArrayHasKey('sdks', $response['body']); - $this->assertEmpty($response['body']['sdks']); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); From 5627082165a31b3319fa9a9b9a625195ad43e065 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Dec 2024 09:45:40 +0000 Subject: [PATCH 065/169] update --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index a57a886d4c..8398bcfa7e 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -241,7 +241,7 @@ trait ProjectsDevKeys $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $response['body']['secret'] + 'x-appwrite-dev-key' => $data['secret'] ], [ 'email' => 'user@appwrite.io', 'password' => 'password' From dcacb5ee2cf46f972b44adfb5975a1deb9b174c1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 08:45:09 +0000 Subject: [PATCH 066/169] test fix --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 8398bcfa7e..b8af5cfda7 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -2,6 +2,7 @@ namespace Tests\E2E\Services\Projects; +use Appwrite\ID; use Tests\E2E\Client; use Utopia\Database\DateTime; @@ -126,7 +127,7 @@ trait ProjectsDevKeys $devKey = $response['body']['secret']; - for ($i = 0; $i < 10; $i++) { + for ($i = 0; $i < 11; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, @@ -134,7 +135,7 @@ trait ProjectsDevKeys 'email' => 'user@appwrite.io', 'password' => 'password' ]); - $this->assertEquals(200, $res['headers']['status-code']); + $this->assertEquals(401, $res['headers']['status-code']); } $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', From 172ef61663e2c463ef1033bab36f428d6caf462d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 08:54:10 +0000 Subject: [PATCH 067/169] remove devkey check on error --- app/controllers/general.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 2940b33447..842a3543e3 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -743,7 +743,7 @@ App::error() ->inject('log') ->inject('queueForUsage') ->inject('devKey') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage, Document $devKey) { + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); @@ -949,7 +949,7 @@ App::error() // TODO filter out secrets and server details when not in development // but devKey is provided - $output = ((App::isDevelopment()) || (!$devKey->isEmpty())) ? [ + $output = (App::isDevelopment()) ? [ 'message' => $message, 'code' => $code, 'file' => $file, @@ -990,7 +990,7 @@ App::error() $response->dynamic( new Document($output), - $utopia->isDevelopment() || !$devKey->isEmpty() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR + $utopia->isDevelopment() ? Response::MODEL_ERROR_DEV : Response::MODEL_ERROR ); }); From ae0e1eb30250f44ba957fa87637dfe427c0a2613 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 08:54:13 +0000 Subject: [PATCH 068/169] fix lint --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index b8af5cfda7..5cde1a6d8f 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -2,7 +2,6 @@ namespace Tests\E2E\Services\Projects; -use Appwrite\ID; use Tests\E2E\Client; use Utopia\Database\DateTime; From b25772483beb764f233624a4a1ab468c30d0308c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 08:57:44 +0000 Subject: [PATCH 069/169] key that expires after 5 second --- .../e2e/Services/Projects/ProjectsDevKeys.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 5cde1a6d8f..fc550270d9 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -176,6 +176,40 @@ trait ProjectsDevKeys 'password' => 'password' ]); $this->assertEquals(429, $res['headers']['status-code']); + + + /** + * Test for FAILURE after expire + */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 5), + ]); + + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $response['body']['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $res['headers']['status-code']); + + sleep(5); + + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $response['body']['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $res['headers']['status-code']); } From 4ffdc9c1037143aa5ddcf1d92e6a3c57d85a036e Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 09:22:05 +0000 Subject: [PATCH 070/169] fix existing test by adding dev key --- tests/e2e/Scopes/ProjectCustom.php | 14 ++++++++++++++ tests/e2e/Scopes/SideClient.php | 9 +++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index 7f84ace6f2..5b492cfc06 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -3,6 +3,7 @@ namespace Tests\E2E\Scopes; use Tests\E2E\Client; +use Utopia\Database\DateTime; use Utopia\Database\Helpers\ID; trait ProjectCustom @@ -103,6 +104,17 @@ trait ProjectCustom $this->assertNotEmpty($key['body']); $this->assertNotEmpty($key['body']['secret']); + $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/development-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), + ]); + $this->assertEquals(201, $devKey['headers']['status-code']); + $this->assertNotEmpty($devKey['body']); + $this->assertNotEmpty($devKey['body']['secret']); + $webhook = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/webhooks', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', @@ -143,9 +155,11 @@ trait ProjectCustom '$id' => $project['body']['$id'], 'name' => $project['body']['name'], 'apiKey' => $key['body']['secret'], + 'devKey' => $devKey['body']['secret'], 'webhookId' => $webhook['body']['$id'], 'signatureKey' => $webhook['body']['signatureKey'], ]; + if ($fresh) { return $project; } diff --git a/tests/e2e/Scopes/SideClient.php b/tests/e2e/Scopes/SideClient.php index 54f77a9747..205d5d4426 100644 --- a/tests/e2e/Scopes/SideClient.php +++ b/tests/e2e/Scopes/SideClient.php @@ -4,12 +4,17 @@ namespace Tests\E2E\Scopes; trait SideClient { - public function getHeaders(): array + public function getHeaders(bool $devKey = true): array { - return [ + $headers = [ 'origin' => 'http://localhost', 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $this->getUser()['session'], + ]; + if ($devKey) { + $headers['x-appwrite-dev-key'] = $this->getProject()['devKey']; + } + return $headers; } /** From 3ad865319c4f7d3839fe84679607515f1f6df6cb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 09:22:16 +0000 Subject: [PATCH 071/169] refactor: rename endpoint --- .../DevKeys/Http/DevKeys/CreateKey.php | 2 +- .../DevKeys/Http/DevKeys/DeleteKey.php | 2 +- .../Modules/DevKeys/Http/DevKeys/GetKey.php | 2 +- .../Modules/DevKeys/Http/DevKeys/ListKeys.php | 2 +- .../DevKeys/Http/DevKeys/UpdateKey.php | 2 +- tests/e2e/Scopes/ProjectCustom.php | 2 +- .../e2e/Services/Projects/ProjectsDevKeys.php | 26 +++++++++---------- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php index 68ca88a58a..fd23a9d7eb 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php @@ -27,7 +27,7 @@ class CreateKey extends Action { $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) - ->setHttpPath('/v1/projects/:projectId/development-keys') + ->setHttpPath('/v1/projects/:projectId/dev-keys') ->desc('Create dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php index fcc6083340..44a8a9da3e 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php @@ -22,7 +22,7 @@ class DeleteKey extends Action { $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_DELETE) - ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->setHttpPath('/v1/projects/:projectId/dev-keys/:keyId') ->desc('Delete dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php index f9c542c6b2..93da6ca8b3 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php @@ -22,7 +22,7 @@ class GetKey extends Action { $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->setHttpPath('/v1/projects/:projectId/dev-keys/:keyId') ->desc('Get dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.read') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php index a4b4083080..2ef7cfa9eb 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php @@ -23,7 +23,7 @@ class ListKeys extends Action { $this ->setHttpMethod(Action::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/projects/:projectId/development-keys') + ->setHttpPath('/v1/projects/:projectId/dev-keys') ->desc('List dev keys') ->groups(['api', 'projects']) ->label('scope', 'projects.read') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php index de29b40960..f56b2ed6d2 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php @@ -23,7 +23,7 @@ class UpdateKey extends Action public function __construct() { $this->setHttpMethod(Action::HTTP_REQUEST_METHOD_PUT) - ->setHttpPath('/v1/projects/:projectId/development-keys/:keyId') + ->setHttpPath('/v1/projects/:projectId/dev-keys/:keyId') ->desc('Update dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index 5b492cfc06..b9561765fe 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -104,7 +104,7 @@ trait ProjectCustom $this->assertNotEmpty($key['body']); $this->assertNotEmpty($key['body']['secret']); - $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/development-keys', array_merge([ + $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index fc550270d9..79644bb936 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -15,7 +15,7 @@ trait ProjectsDevKeys { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -31,7 +31,7 @@ trait ProjectsDevKeys $this->assertEmpty($response['body']['accessedAt']); /** TEST expiry date is required */ - $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -57,7 +57,7 @@ trait ProjectsDevKeys { $id = $data['projectId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -79,7 +79,7 @@ trait ProjectsDevKeys $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -95,7 +95,7 @@ trait ProjectsDevKeys /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/error', array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -116,7 +116,7 @@ trait ProjectsDevKeys /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -159,7 +159,7 @@ trait ProjectsDevKeys /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -181,7 +181,7 @@ trait ProjectsDevKeys /** * Test for FAILURE after expire */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/development-keys', array_merge([ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -222,7 +222,7 @@ trait ProjectsDevKeys $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -237,7 +237,7 @@ trait ProjectsDevKeys $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -261,7 +261,7 @@ trait ProjectsDevKeys $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -282,7 +282,7 @@ trait ProjectsDevKeys ]); $this->assertEquals(429, $res['headers']['status-code']); - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/development-keys/' . $keyId, array_merge([ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); @@ -293,7 +293,7 @@ trait ProjectsDevKeys /** * Test for FAILURE */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/development-keys/error', array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/dev-keys/error', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); From ba83dd925261ccf6acc0ef6b42fc7022bc6b85d2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 09:33:17 +0000 Subject: [PATCH 072/169] fix dev key creation --- tests/e2e/Scopes/ProjectCustom.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index b9561765fe..9c8041027f 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -105,8 +105,10 @@ trait ProjectCustom $this->assertNotEmpty($key['body']['secret']); $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/dev-keys', array_merge([ + 'origin' => 'http://localhost', 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + 'x-appwrite-project' => 'console', ], $this->getHeaders()), [ 'name' => 'Key Test', 'expire' => DateTime::addSeconds(new \DateTime(), 3600), From 85656f81a5dacd1bb7889622a93881aa5d08884c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 10:03:52 +0000 Subject: [PATCH 073/169] update db name --- .../Modules/DevKeys/Http/DevKeys/CreateKey.php | 12 ++++++------ .../Modules/DevKeys/Http/DevKeys/DeleteKey.php | 14 +++++++------- .../Modules/DevKeys/Http/DevKeys/GetKey.php | 10 +++++----- .../Modules/DevKeys/Http/DevKeys/ListKeys.php | 10 +++++----- .../Modules/DevKeys/Http/DevKeys/UpdateKey.php | 14 +++++++------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php index fd23a9d7eb..a1f4c2a296 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php @@ -41,13 +41,13 @@ class CreateKey extends Action ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $name, $expire, $response, $dbForConsole)); + ->inject('dbForPlatform') + ->callback(fn ($projectId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $name, $expire, $response, $dbForPlatform)); } - public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForConsole) + public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -69,9 +69,9 @@ class CreateKey extends Action 'secret' => \bin2hex(\random_bytes(128)), ]); - $key = $dbForConsole->createDocument('devKeys', $key); + $key = $dbForPlatform->createDocument('devKeys', $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php index 44a8a9da3e..0fae2c30aa 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php @@ -34,20 +34,20 @@ class DeleteKey extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $keyId, $response, $dbForConsole) => $this->action($projectId, $keyId, $response, $dbForConsole)); + ->inject('dbForPlatform') + ->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform)); } - public function action(string $projectId, string $keyId, Response $response, Database $dbForConsole) + public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('devKeys', [ + $key = $dbForPlatform->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -56,9 +56,9 @@ class DeleteKey extends Action throw new Exception(Exception::KEY_NOT_FOUND); } - $dbForConsole->deleteDocument('devKeys', $key->getId()); + $dbForPlatform->deleteDocument('devKeys', $key->getId()); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->noContent(); } diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php index 93da6ca8b3..4f2a7fa9ca 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php @@ -35,20 +35,20 @@ class GetKey extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $keyId, $response, $dbForConsole) => $this->action($projectId, $keyId, $response, $dbForConsole)); + ->inject('dbForPlatform') + ->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform)); } - public function action(string $projectId, string $keyId, Response $response, Database $dbForConsole) + public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('devKeys', [ + $key = $dbForPlatform->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php index 2ef7cfa9eb..e9df3167ea 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php @@ -35,20 +35,20 @@ class ListKeys extends Action ->label('sdk.response.model', Response::MODEL_DEV_KEY_LIST) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $response, $dbForConsole) => $this->action($projectId, $response, $dbForConsole)); + ->inject('dbForPlatform') + ->callback(fn ($projectId, $response, $dbForPlatform) => $this->action($projectId, $response, $dbForPlatform)); } - public function action(string $projectId, Response $response, Database $dbForConsole) + public function action(string $projectId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $keys = $dbForConsole->find('devKeys', [ + $keys = $dbForPlatform->find('devKeys', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php index f56b2ed6d2..6d17429084 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php @@ -38,19 +38,19 @@ class UpdateKey extends Action ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.') ->inject('response') - ->inject('dbForConsole') - ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForConsole) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForConsole)); + ->inject('dbForPlatform') + ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForPlatform)); } - public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForConsole) + public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('devKeys', [ + $key = $dbForPlatform->findOne('devKeys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); @@ -63,9 +63,9 @@ class UpdateKey extends Action ->setAttribute('name', $name) ->setAttribute('expire', $expire); - $dbForConsole->updateDocument('devKeys', $key->getId(), $key); + $dbForPlatform->updateDocument('devKeys', $key->getId(), $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->dynamic($key, Response::MODEL_DEV_KEY); } From 6f3c60d4623710eb83773fb0cbc6066fc69589ea Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 10:25:22 +0000 Subject: [PATCH 074/169] fix tests --- tests/e2e/Scopes/SideClient.php | 2 +- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/SideClient.php b/tests/e2e/Scopes/SideClient.php index 205d5d4426..17ee7a3002 100644 --- a/tests/e2e/Scopes/SideClient.php +++ b/tests/e2e/Scopes/SideClient.php @@ -11,7 +11,7 @@ trait SideClient 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $this->getUser()['session'], ]; - if ($devKey) { + if ($devKey && isset($this->getProject()['devKey'])) { $headers['x-appwrite-dev-key'] = $this->getProject()['devKey']; } return $headers; diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 79644bb936..fbbdda6e93 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -126,7 +126,7 @@ trait ProjectsDevKeys $devKey = $response['body']['secret']; - for ($i = 0; $i < 11; $i++) { + for ($i = 0; $i < 10; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', 'x-appwrite-project' => $id, From 05baa6090dbfc6292e2e91479a9a95f77b1cf643 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 10:31:55 +0000 Subject: [PATCH 075/169] fix cycle --- tests/e2e/Scopes/ProjectCustom.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index 9c8041027f..42aed2ba7c 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -104,12 +104,12 @@ trait ProjectCustom $this->assertNotEmpty($key['body']); $this->assertNotEmpty($key['body']['secret']); - $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/dev-keys', array_merge([ + $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $project['body']['$id'] . '/dev-keys', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'cookie' => 'a_session_console=' . $this->getRoot()['session'], 'x-appwrite-project' => 'console', - ], $this->getHeaders()), [ + ], [ 'name' => 'Key Test', 'expire' => DateTime::addSeconds(new \DateTime(), 3600), ]); From b8388a4092715fb7eb7b0f79a92df7655b9dbf9b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 10:41:01 +0000 Subject: [PATCH 076/169] fix expected in test --- tests/e2e/Services/Account/AccountBase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 2d72625121..b748f24233 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -118,7 +118,7 @@ trait AccountBase 'password' => $shortPassword ]); - $this->assertEquals($response['headers']['status-code'], 400); + $this->assertEquals(400, $response['headers']['status-code']); $longPassword = ''; for ($i = 0; $i < 257; $i++) { // 256 is the limit @@ -135,7 +135,7 @@ trait AccountBase 'password' => $longPassword, ]); - $this->assertEquals($response['headers']['status-code'], 400); + $this->assertEquals(400, $response['headers']['status-code']); return [ 'id' => $id, @@ -156,7 +156,7 @@ trait AccountBase 'email' => 'otpuser@appwrite.io' ]); - $this->assertEquals($response['headers']['status-code'], 201); + $this->assertEquals(201, $response['headers']['status-code'], ); $this->assertNotEmpty($response['body']['$id']); $this->assertNotEmpty($response['body']['$createdAt']); $this->assertNotEmpty($response['body']['userId']); From cd54ba1b83b51b980bcc19b911eb3593567d14da Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 10:49:35 +0000 Subject: [PATCH 077/169] fix account test --- tests/e2e/Services/Account/AccountBase.php | 3 +++ tests/e2e/Services/Account/AccountCustomClientTest.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index b748f24233..fcf836c713 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -112,6 +112,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '' ]), [ 'userId' => ID::unique(), 'email' => 'shortpass@appwrite.io', @@ -129,6 +130,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '' ]), [ 'userId' => ID::unique(), 'email' => 'longpass@appwrite.io', @@ -286,6 +288,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '' ]), [ 'userId' => ID::unique(), 'email' => $email, diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index cca27cc3be..5d89f6f3f0 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -618,6 +618,7 @@ class AccountCustomClientTest extends Scope 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '' ]), [ 'userId' => ID::unique(), 'email' => $data['email'], @@ -1216,6 +1217,7 @@ class AccountCustomClientTest extends Scope 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '' ]), [ 'userId' => ID::unique(), 'email' => $email, From 195ae3fdcb72aaf3b130e0789f0b15a18ec5cc57 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 15 Dec 2024 11:06:46 +0000 Subject: [PATCH 078/169] update project desc --- tests/e2e/Scopes/Scope.php | 2 +- tests/e2e/Scopes/SideConsole.php | 2 +- tests/e2e/Services/GraphQL/AbuseTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 3213ff4c5d..fda4abc1dc 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -56,7 +56,7 @@ abstract class Scope extends TestCase /** * @return array */ - abstract public function getHeaders(): array; + abstract public function getHeaders(bool $devKey): array; /** * @return array diff --git a/tests/e2e/Scopes/SideConsole.php b/tests/e2e/Scopes/SideConsole.php index 74a0dd0c60..d619861a75 100644 --- a/tests/e2e/Scopes/SideConsole.php +++ b/tests/e2e/Scopes/SideConsole.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Scopes; trait SideConsole { - public function getHeaders(): array + public function getHeaders(bool $devKey = false): array { return [ 'origin' => 'http://localhost', diff --git a/tests/e2e/Services/GraphQL/AbuseTest.php b/tests/e2e/Services/GraphQL/AbuseTest.php index d4e87cf029..ea97492c2b 100644 --- a/tests/e2e/Services/GraphQL/AbuseTest.php +++ b/tests/e2e/Services/GraphQL/AbuseTest.php @@ -88,7 +88,7 @@ class AbuseTest extends Scope $response = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, - ], $this->getHeaders()), $graphQLPayload); + ], $this->getHeaders(false)), $graphQLPayload); $max = System::getEnv('_APP_GRAPHQL_MAX_QUERY_COMPLEXITY', 250); From d5e775416d2d50eb5bfc71272ec7f0d1197d2f8b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Mon, 27 Jan 2025 10:36:40 +0000 Subject: [PATCH 079/169] chore: added devkeys collections to new file, and formatting --- app/config/collections/platform.php | 112 ++++++++++++++++++++++++++++ app/controllers/general.php | 2 +- 2 files changed, 113 insertions(+), 1 deletion(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index a5fedb6461..3c51a0d9af 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -287,6 +287,17 @@ return [ 'array' => false, 'filters' => ['subQueryKeys'], ], + [ + '$id' => ID::custom('devKeys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryDevKeys'], + ], [ '$id' => ID::custom('search'), 'type' => Database::VAR_STRING, @@ -689,6 +700,107 @@ return [ ], ], + 'devKeys' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('devKeys'), + 'name' => 'Dev keys', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // var_dump of \bin2hex(\random_bytes(128)) => string(256) doubling for encryption + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('sdks'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + 'webhooks' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('webhooks'), diff --git a/app/controllers/general.php b/app/controllers/general.php index 39afa48b19..6775740c7d 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -10,11 +10,11 @@ use Appwrite\Event\Func; use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; +use Appwrite\Platform\Appwrite; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; -use Appwrite\Platform\Appwrite; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; From b399ff00a6d1bfb8e88760463244eb3bfb759766 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 14:06:56 +0000 Subject: [PATCH 080/169] chore: update e2e tests to use abuse env --- .github/workflows/tests.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b7438de42..32241446cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,6 +20,17 @@ jobs: with: submodules: recursive + - name: Detect test types + id: detect-tests + run: | + ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') + + if [ "$ABUSE_ENABLED" = "enabled" ]; then + echo 'test_suffixes=["CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT + else + echo 'test_suffixes=["ConsoleClient"]' >> $GITHUB_OUTPUT + fi + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -127,6 +138,7 @@ jobs: Messaging, Migrations ] + test_suffix: ${{ fromJSON(needs.setup.outputs.test_suffixes) }} tables-mode: [ 'Project', 'Shared V1', @@ -150,7 +162,7 @@ jobs: docker compose up -d sleep 30 - - name: Run ${{ matrix.service }} tests with ${{ matrix.tables-mode }} table mode + - name: Run ${{ matrix.service }} ${{ matrix.test_suffix }} tests (${{ matrix.tables-mode }}) run: | if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then echo "Using shared tables V1" @@ -169,7 +181,7 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}Test.php --debug benchmarking: name: Benchmark From 9561ed99d222c6479077728ebf2605df5582f54d Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 14:18:00 +0000 Subject: [PATCH 081/169] chore: fix getHeaders implementation in scope tests --- tests/e2e/Scopes/SideNone.php | 2 +- tests/e2e/Scopes/SideServer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/SideNone.php b/tests/e2e/Scopes/SideNone.php index 79c52afe00..3765834011 100644 --- a/tests/e2e/Scopes/SideNone.php +++ b/tests/e2e/Scopes/SideNone.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Scopes; trait SideNone { - public function getHeaders(): array + public function getHeaders(bool $devKey): array { return []; } diff --git a/tests/e2e/Scopes/SideServer.php b/tests/e2e/Scopes/SideServer.php index b5e15150e9..7137b8e81e 100644 --- a/tests/e2e/Scopes/SideServer.php +++ b/tests/e2e/Scopes/SideServer.php @@ -9,7 +9,7 @@ trait SideServer */ protected $key = []; - public function getHeaders(): array + public function getHeaders(bool $devKey): array { return [ 'x-appwrite-key' => $this->getProject()['apiKey'] From cad18dc7c797df66f54f7c86f2357d9531a5b724 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 14:29:45 +0000 Subject: [PATCH 082/169] chore: fix abstract implementations for scope tests --- tests/e2e/Scopes/Scope.php | 2 +- tests/e2e/Scopes/SideConsole.php | 2 +- tests/e2e/Scopes/SideNone.php | 2 +- tests/e2e/Scopes/SideServer.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index fda4abc1dc..6deaa62c05 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -56,7 +56,7 @@ abstract class Scope extends TestCase /** * @return array */ - abstract public function getHeaders(bool $devKey): array; + abstract public function getHeaders(bool $devKey = true): array; /** * @return array diff --git a/tests/e2e/Scopes/SideConsole.php b/tests/e2e/Scopes/SideConsole.php index d619861a75..9ad3e93d6a 100644 --- a/tests/e2e/Scopes/SideConsole.php +++ b/tests/e2e/Scopes/SideConsole.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Scopes; trait SideConsole { - public function getHeaders(bool $devKey = false): array + public function getHeaders(bool $devKey = true): array { return [ 'origin' => 'http://localhost', diff --git a/tests/e2e/Scopes/SideNone.php b/tests/e2e/Scopes/SideNone.php index 3765834011..1660beb777 100644 --- a/tests/e2e/Scopes/SideNone.php +++ b/tests/e2e/Scopes/SideNone.php @@ -4,7 +4,7 @@ namespace Tests\E2E\Scopes; trait SideNone { - public function getHeaders(bool $devKey): array + public function getHeaders(bool $devKey = true): array { return []; } diff --git a/tests/e2e/Scopes/SideServer.php b/tests/e2e/Scopes/SideServer.php index 7137b8e81e..d27b2092b0 100644 --- a/tests/e2e/Scopes/SideServer.php +++ b/tests/e2e/Scopes/SideServer.php @@ -9,7 +9,7 @@ trait SideServer */ protected $key = []; - public function getHeaders(bool $devKey): array + public function getHeaders(bool $devKey = false): array { return [ 'x-appwrite-key' => $this->getProject()['apiKey'] From 222516dbd4291d6c45fd5950d5a001c2b7d5fe5c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 14:41:58 +0000 Subject: [PATCH 083/169] chore: added base tests in e2e service --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32241446cc..4aa5252de0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,9 +26,9 @@ jobs: ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') if [ "$ABUSE_ENABLED" = "enabled" ]; then - echo 'test_suffixes=["CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["Base", "CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT else - echo 'test_suffixes=["ConsoleClient"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["Base", "ConsoleClient"]' >> $GITHUB_OUTPUT fi - name: Set up Docker Buildx From 7bd29501c2fd81afd0807484de8f40c24f0647af Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 16:07:41 +0000 Subject: [PATCH 084/169] chore: added test_suffixes to outputs --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4aa5252de0..8ac58fd744 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,8 @@ jobs: setup: name: Setup & Build Appwrite Image runs-on: ubuntu-latest + outputs: + test_suffixes: ${{ steps.detect-tests.outputs.test_suffixes }} steps: - name: Checkout repository uses: actions/checkout@v4 From acadaf2307217c4095a8e3c5df5f46ade8e168d9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 16:13:07 +0000 Subject: [PATCH 085/169] chore: fix naming for tests --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ac58fd744..b65a9193fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,9 +28,9 @@ jobs: ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') if [ "$ABUSE_ENABLED" = "enabled" ]; then - echo 'test_suffixes=["Base", "CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["Base", "CustomClientTest", "CustomServerTest"]' >> $GITHUB_OUTPUT else - echo 'test_suffixes=["Base", "ConsoleClient"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["Base", "ConsoleClientTest"]' >> $GITHUB_OUTPUT fi - name: Set up Docker Buildx @@ -183,7 +183,7 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}Test.php --debug + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}.php --debug benchmarking: name: Benchmark From af7f59952552854f6bd271088ab344595b7606f2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 16:22:32 +0000 Subject: [PATCH 086/169] chore: fix remove base --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b65a9193fd..3644b1d1c0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,9 +28,9 @@ jobs: ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') if [ "$ABUSE_ENABLED" = "enabled" ]; then - echo 'test_suffixes=["Base", "CustomClientTest", "CustomServerTest"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT else - echo 'test_suffixes=["Base", "ConsoleClientTest"]' >> $GITHUB_OUTPUT + echo 'test_suffixes=["ConsoleClient"]' >> $GITHUB_OUTPUT fi - name: Set up Docker Buildx @@ -183,7 +183,7 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}.php --debug + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}Test.php --debug benchmarking: name: Benchmark From c01f67f44fce3e033f8b616b7d3ac30e14b9dfa0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 16:58:27 +0000 Subject: [PATCH 087/169] chore: fix parsing of test files --- .github/workflows/tests.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3644b1d1c0..19a77c8a56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -179,11 +179,27 @@ jobs: export _APP_DATABASE_SHARED_TABLES= export _APP_DATABASE_SHARED_TABLES_V1= fi - - docker compose exec -T \ - -e _APP_DATABASE_SHARED_TABLES \ - -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }}/${{ matrix.service }}${{ matrix.test_suffix }}Test.php --debug + + TEST_SUFFIXES=${{ matrix.test_suffix }} + TEST_FOLDER="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" + ALL_TEST_FILES=$(find "$TEST_FOLDER" -type f -name "*Test.php") + + for TEST_FILE in $ALL_TEST_FILES; do + SUFFIX=$(echo "$TEST_FILE" | grep -oE '(CustomClient|CustomServer|ConsoleClient)Test\.php$' | sed 's/Test\.php$//') + + if [ -n "$SUFFIX" ]; then + if [[ "$TEST_SUFFIXES" == *"$SUFFIX"* ]]; then + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test "$TEST_FILE" --debug + else + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test "$TEST_FILE" --debug + fi + done benchmarking: name: Benchmark From c2aff2c2cb36053e8544618b88a93d4cbd928c8a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 17:16:35 +0000 Subject: [PATCH 088/169] chore: fix fetching of test files --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 19a77c8a56..02cbd30bbb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -182,7 +182,7 @@ jobs: TEST_SUFFIXES=${{ matrix.test_suffix }} TEST_FOLDER="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" - ALL_TEST_FILES=$(find "$TEST_FOLDER" -type f -name "*Test.php") + ALL_TEST_FILES=$(docker compose exec -T appwrite find "$TEST_FOLDER" -type f -name "*Test.php") for TEST_FILE in $ALL_TEST_FILES; do SUFFIX=$(echo "$TEST_FILE" | grep -oE '(CustomClient|CustomServer|ConsoleClient)Test\.php$' | sed 's/Test\.php$//') @@ -193,6 +193,7 @@ jobs: -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test "$TEST_FILE" --debug + fi else docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ From c73f2afbe11166985f61fb99649efadbb6d9a400 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 17:41:48 +0000 Subject: [PATCH 089/169] chore: fix run tests loop --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02cbd30bbb..2978afeaba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -164,7 +164,7 @@ jobs: docker compose up -d sleep 30 - - name: Run ${{ matrix.service }} ${{ matrix.test_suffix }} tests (${{ matrix.tables-mode }}) + - name: Run ${{ matrix.service }} tests with ${{ matrix.tables-mode }} table mode run: | if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then echo "Using shared tables V1" From 28e1ce9dc24f9df4d5c40bcd7510fe53f1bcc865 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 28 Jan 2025 17:49:05 +0000 Subject: [PATCH 090/169] chore: fix recursive tests --- .github/workflows/tests.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2978afeaba..ac222c1df7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,25 +14,12 @@ jobs: setup: name: Setup & Build Appwrite Image runs-on: ubuntu-latest - outputs: - test_suffixes: ${{ steps.detect-tests.outputs.test_suffixes }} steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - - name: Detect test types - id: detect-tests - run: | - ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') - - if [ "$ABUSE_ENABLED" = "enabled" ]; then - echo 'test_suffixes=["CustomClient", "CustomServer"]' >> $GITHUB_OUTPUT - else - echo 'test_suffixes=["ConsoleClient"]' >> $GITHUB_OUTPUT - fi - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -140,7 +127,6 @@ jobs: Messaging, Migrations ] - test_suffix: ${{ fromJSON(needs.setup.outputs.test_suffixes) }} tables-mode: [ 'Project', 'Shared V1', @@ -180,7 +166,9 @@ jobs: export _APP_DATABASE_SHARED_TABLES_V1= fi - TEST_SUFFIXES=${{ matrix.test_suffix }} + ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') + TEST_SUFFIXES=$( [[ "$ABUSE_ENABLED" == "enabled" ]] && echo 'CustomClient CustomServer' || echo 'ConsoleClient') + TEST_FOLDER="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" ALL_TEST_FILES=$(docker compose exec -T appwrite find "$TEST_FOLDER" -type f -name "*Test.php") From 1e71eb84c4fd642505ce0eb41b0874aba5427d94 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 29 Jan 2025 04:25:52 +0000 Subject: [PATCH 091/169] chore: added devkeys to account and database tests --- tests/e2e/Services/Account/AccountBase.php | 1 + tests/e2e/Services/Databases/DatabasesPermissionsScope.php | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index fcf836c713..1a77cccb18 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -99,6 +99,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '', ]), [ 'userId' => ID::unique(), 'email' => '', diff --git a/tests/e2e/Services/Databases/DatabasesPermissionsScope.php b/tests/e2e/Services/Databases/DatabasesPermissionsScope.php index 336e47db08..0042d253ac 100644 --- a/tests/e2e/Services/Databases/DatabasesPermissionsScope.php +++ b/tests/e2e/Services/Databases/DatabasesPermissionsScope.php @@ -15,6 +15,7 @@ trait DatabasesPermissionsScope 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-dev-key' => $this->getProject()['devKey'] ?? '', ], [ 'userId' => $id, 'email' => $email, From f132c2b266e3324f047b65fd32102848e6652e01 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 29 Jan 2025 05:52:03 +0000 Subject: [PATCH 092/169] chore: changed ordering of tests --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac222c1df7..6bbef54dc0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -167,7 +167,7 @@ jobs: fi ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') - TEST_SUFFIXES=$( [[ "$ABUSE_ENABLED" == "enabled" ]] && echo 'CustomClient CustomServer' || echo 'ConsoleClient') + TEST_SUFFIXES=$( [[ "$ABUSE_ENABLED" == "enabled" ]] && echo 'CustomServer CustomClient' || echo 'ConsoleClient') TEST_FOLDER="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" ALL_TEST_FILES=$(docker compose exec -T appwrite find "$TEST_FOLDER" -type f -name "*Test.php") From 23111d26c48cec11e788f10ce66dc4bd29d7e7d3 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 09:28:23 +0000 Subject: [PATCH 093/169] chore: filtered out customclienttests --- .github/workflows/tests.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6bbef54dc0..a252b20172 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -166,27 +166,12 @@ jobs: export _APP_DATABASE_SHARED_TABLES_V1= fi - ABUSE_ENABLED=$(grep -oP '^_APP_OPTIONS_ABUSE=\K\w+' .env || echo 'disabled') - TEST_SUFFIXES=$( [[ "$ABUSE_ENABLED" == "enabled" ]] && echo 'CustomServer CustomClient' || echo 'ConsoleClient') - - TEST_FOLDER="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" - ALL_TEST_FILES=$(docker compose exec -T appwrite find "$TEST_FOLDER" -type f -name "*Test.php") - - for TEST_FILE in $ALL_TEST_FILES; do - SUFFIX=$(echo "$TEST_FILE" | grep -oE '(CustomClient|CustomServer|ConsoleClient)Test\.php$' | sed 's/Test\.php$//') - - if [ -n "$SUFFIX" ]; then - if [[ "$TEST_SUFFIXES" == *"$SUFFIX"* ]]; then - docker compose exec -T \ - -e _APP_DATABASE_SHARED_TABLES \ - -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test "$TEST_FILE" --debug - fi - else + for test_file in /usr/src/code/tests/e2e/Services/${{ matrix.service }}/*Test.php; do + if [[ "$test_file" != *CustomClientTest.php ]]; then docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test "$TEST_FILE" --debug + appwrite test "$test_file" --debug fi done From 5a1ad4d5ae4e813f2061941c1062c9379ef10976 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 11:48:43 +0000 Subject: [PATCH 094/169] chore: added grouping of devkeys in ci --- .github/workflows/tests.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a252b20172..007e3a6c1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -166,14 +166,20 @@ jobs: export _APP_DATABASE_SHARED_TABLES_V1= fi - for test_file in /usr/src/code/tests/e2e/Services/${{ matrix.service }}/*Test.php; do - if [[ "$test_file" != *CustomClientTest.php ]]; then - docker compose exec -T \ - -e _APP_DATABASE_SHARED_TABLES \ - -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test "$test_file" --debug - fi - done + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys + + if [ "${{ matrix.service }}" == "Projects" ]; then + export _APP_OPTIONS_ABUSE=enabled + + docker compose exec -T \ + -e _APP_OPTIONS_ABUSE \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --group=devKeys + fi benchmarking: name: Benchmark From bd801712b95b34e350f183fc1b3240d4b8bc784a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 11:51:43 +0000 Subject: [PATCH 095/169] chore: disabled options abuse env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index e998cabee1..8f7d7996e7 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=enabled +_APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled From 751f7e3fadfea97801a8480961ae3ec886cf94b8 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 12:11:09 +0000 Subject: [PATCH 096/169] chore: shifted abuse project test to different job in ci --- .github/workflows/tests.yml | 58 ++++++++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 007e3a6c1b..2dd7351369 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -171,16 +171,60 @@ jobs: -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys - if [ "${{ matrix.service }}" == "Projects" ]; then - export _APP_OPTIONS_ABUSE=enabled + e2e_dev_keys: + name: E2E Service Test + runs-on: ubuntu-latest + needs: setup + strategy: + fail-fast: false + matrix: + tables-mode: [ + 'Project', + 'Shared V1', + 'Shared V2', + ] - docker compose exec -T \ - -e _APP_OPTIONS_ABUSE \ - -e _APP_DATABASE_SHARED_TABLES \ - -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --group=devKeys + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + docker compose up -d + sleep 30 + + - name: Run Projects tests with dev keys in ${{ matrix.tables-mode }} table mode + run: | + if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then + echo "Using shared tables V1" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1=database_db_main + elif [ "${{ matrix.tables-mode }}" == "Shared V2" ]; then + echo "Using shared tables V2" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1= + else + echo "Using project tables" + export _APP_DATABASE_SHARED_TABLES= + export _APP_DATABASE_SHARED_TABLES_V1= fi + export _APP_OPTIONS_ABUSE=enabled + + docker compose exec -T \ + -e _APP_OPTIONS_ABUSE \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys + benchmarking: name: Benchmark runs-on: ubuntu-latest From 67ba9a880dfc510ac8eef4f6d7cdb5baafaf8d86 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 12:25:56 +0000 Subject: [PATCH 097/169] chore: fix tests --- .github/workflows/tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2dd7351369..5f295c4359 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -172,7 +172,7 @@ jobs: appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys e2e_dev_keys: - name: E2E Service Test + name: E2E Service Test (Dev Keys) runs-on: ubuntu-latest needs: setup strategy: @@ -217,10 +217,8 @@ jobs: export _APP_DATABASE_SHARED_TABLES_V1= fi - export _APP_OPTIONS_ABUSE=enabled - docker compose exec -T \ - -e _APP_OPTIONS_ABUSE \ + -e _APP_OPTIONS_ABUSE=enabled \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys From 3522e63404a7a9c524c2f1230f670d0c342cf5f3 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 12:36:28 +0000 Subject: [PATCH 098/169] chore: fix tests --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f295c4359..ce924e20d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -198,6 +198,7 @@ jobs: - name: Load and Start Appwrite run: | docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env docker compose up -d sleep 30 @@ -218,7 +219,6 @@ jobs: fi docker compose exec -T \ - -e _APP_OPTIONS_ABUSE=enabled \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys From 2fa22b4b8521caa5a7c3f2e85932649a0bc776cd Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 14:05:53 +0000 Subject: [PATCH 099/169] chore: workflow added rebuild on cache miss --- .github/workflows/tests.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce924e20d3..c5a565b269 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -138,12 +138,29 @@ jobs: uses: actions/checkout@v4 - name: Load Cache + id: cache-docker-image uses: actions/cache@v4 with: key: ${{ env.CACHE_KEY }} path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true + - name: Build Docker Image if Cache Missed + if: steps.cache-docker-image.outputs.cache-hit != 'true' + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ${{ env.IMAGE }} + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar + build-args: | + DEBUG=false + TESTING=true + VERSION=dev + - name: Load and Start Appwrite run: | docker load --input /tmp/${{ env.IMAGE }}.tar From 1b91b601bcb3128758b0a90415fc8698f850c048 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 14:18:08 +0000 Subject: [PATCH 100/169] chore: remove cache rebuild --- .github/workflows/tests.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c5a565b269..c83d98bd0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -145,22 +145,6 @@ jobs: path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true - - name: Build Docker Image if Cache Missed - if: steps.cache-docker-image.outputs.cache-hit != 'true' - uses: docker/build-push-action@v3 - with: - context: . - push: false - tags: ${{ env.IMAGE }} - load: true - cache-from: type=gha - cache-to: type=gha,mode=max - outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar - build-args: | - DEBUG=false - TESTING=true - VERSION=dev - - name: Load and Start Appwrite run: | docker load --input /tmp/${{ env.IMAGE }}.tar From b4849cd6caf6b13b40c890a5a542b6c7d6a46d72 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 30 Jan 2025 14:18:28 +0000 Subject: [PATCH 101/169] chore: remove id --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c83d98bd0c..ce924e20d3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -138,7 +138,6 @@ jobs: uses: actions/checkout@v4 - name: Load Cache - id: cache-docker-image uses: actions/cache@v4 with: key: ${{ env.CACHE_KEY }} From 942034087155727fe271899792a6ed64cc0c4e56 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 4 Feb 2025 10:53:15 +0000 Subject: [PATCH 102/169] chore: changed directory structure for devkeys --- src/Appwrite/Platform/Appwrite.php | 4 +-- .../Modules/DevKeys/Services/Http.php | 23 --------------- .../Http/DevKeys/CreateDevKey.php} | 28 +++++++++++++------ .../Http/DevKeys/DeleteDevKey.php} | 27 ++++++++++++------ .../Http/DevKeys/GetDevKey.php} | 28 +++++++++++++------ .../Http/DevKeys/ListDevKeys.php} | 28 +++++++++++++------ .../Http/DevKeys/UpdateDevKey.php} | 28 +++++++++++++------ .../Modules/{DevKeys => Projects}/Module.php | 4 +-- .../Modules/Projects/Services/Http.php | 23 +++++++++++++++ 9 files changed, 122 insertions(+), 71 deletions(-) delete mode 100644 src/Appwrite/Platform/Modules/DevKeys/Services/Http.php rename src/Appwrite/Platform/Modules/{DevKeys/Http/DevKeys/CreateKey.php => Projects/Http/DevKeys/CreateDevKey.php} (78%) rename src/Appwrite/Platform/Modules/{DevKeys/Http/DevKeys/DeleteKey.php => Projects/Http/DevKeys/DeleteDevKey.php} (71%) rename src/Appwrite/Platform/Modules/{DevKeys/Http/DevKeys/GetKey.php => Projects/Http/DevKeys/GetDevKey.php} (70%) rename src/Appwrite/Platform/Modules/{DevKeys/Http/DevKeys/ListKeys.php => Projects/Http/DevKeys/ListDevKeys.php} (68%) rename src/Appwrite/Platform/Modules/{DevKeys/Http/DevKeys/UpdateKey.php => Projects/Http/DevKeys/UpdateDevKey.php} (76%) rename src/Appwrite/Platform/Modules/{DevKeys => Projects}/Module.php (62%) create mode 100644 src/Appwrite/Platform/Modules/Projects/Services/Http.php diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index ec19b3248c..b4510df777 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -3,7 +3,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; -use Appwrite\Platform\Modules\DevKeys; +use Appwrite\Platform\Modules\Projects; use Utopia\Platform\Platform; class Appwrite extends Platform @@ -11,6 +11,6 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); - $this->addModule(new DevKeys\Module()); + $this->addModule(new Projects\Module()); } } diff --git a/src/Appwrite/Platform/Modules/DevKeys/Services/Http.php b/src/Appwrite/Platform/Modules/DevKeys/Services/Http.php deleted file mode 100644 index 0e9decc3a9..0000000000 --- a/src/Appwrite/Platform/Modules/DevKeys/Services/Http.php +++ /dev/null @@ -1,23 +0,0 @@ -type = Service::TYPE_HTTP; - $this->addAction(CreateKey::getName(), new CreateKey()); - $this->addAction(UpdateKey::getName(), new UpdateKey()); - $this->addAction(GetKey::getName(), new GetKey()); - $this->addAction(ListKeys::getName(), new ListKeys()); - $this->addAction(DeleteKey::getName(), new DeleteKey()); - } -} diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php similarity index 78% rename from src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php index a1f4c2a296..3f28cd6f81 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/CreateKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php @@ -1,8 +1,11 @@ desc('Create dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createDevKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEV_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createDevKey', + description: '', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DEV_KEY + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php similarity index 71% rename from src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php index 0fae2c30aa..a81382e280 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/DeleteKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php @@ -1,8 +1,11 @@ desc('Delete dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteDevKey') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteDevKey', + description: '', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_NONE + ) + ], + contentType: ContentType::NONE + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php similarity index 70% rename from src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php index 4f2a7fa9ca..d67166c324 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/GetKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php @@ -1,8 +1,11 @@ desc('Get dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getDevKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEV_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getDevKey', + description: '', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEV_KEY + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php similarity index 68% rename from src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php index e9df3167ea..9dc281ef07 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/ListKeys.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php @@ -1,8 +1,11 @@ desc('List dev keys') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listDevKeys') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEV_KEY_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listDevKeys', + description: '', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DEV_KEY_LIST + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForPlatform') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php similarity index 76% rename from src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php index 6d17429084..3f7952c79d 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Http/DevKeys/UpdateKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php @@ -1,8 +1,11 @@ desc('Update dev key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateDevKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEV_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateDevKey', + description: '', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DEV_KEY + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') diff --git a/src/Appwrite/Platform/Modules/DevKeys/Module.php b/src/Appwrite/Platform/Modules/Projects/Module.php similarity index 62% rename from src/Appwrite/Platform/Modules/DevKeys/Module.php rename to src/Appwrite/Platform/Modules/Projects/Module.php index 796ec50186..2a550acf54 100644 --- a/src/Appwrite/Platform/Modules/DevKeys/Module.php +++ b/src/Appwrite/Platform/Modules/Projects/Module.php @@ -1,8 +1,8 @@ type = Service::TYPE_HTTP; + $this->addAction(CreateDevKey::getName(), new CreateDevKey()); + $this->addAction(UpdateDevKey::getName(), new UpdateDevKey()); + $this->addAction(GetDevKey::getName(), new GetDevKey()); + $this->addAction(ListDevKeys::getName(), new ListDevKeys()); + $this->addAction(DeleteDevKey::getName(), new DeleteDevKey()); + } +} From ebd6b1b01336c7a08e9683986f2e1a6e44360768 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 4 Feb 2025 11:32:02 +0000 Subject: [PATCH 103/169] chore: added missing import --- .../Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php | 1 + .../Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php | 1 + .../Platform/Modules/Projects/Http/DevKeys/GetDevKey.php | 1 + .../Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php | 1 + .../Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php | 1 + 5 files changed, 5 insertions(+) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php index 3f28cd6f81..2d8b00a38f 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Projects\Http\DevKeys; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php index a81382e280..ebfbd6639f 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Projects\Http\DevKeys; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php index d67166c324..8ee46beee7 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Projects\Http\DevKeys; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php index 9dc281ef07..eea1249b54 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Projects\Http\DevKeys; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php index 3f7952c79d..3559d4edf4 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Projects\Http\DevKeys; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; From fccc6d560536ac9c687b820d0d3286c1c172402a Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 4 Feb 2025 11:45:41 +0000 Subject: [PATCH 104/169] chore: added docs for devkeys --- docs/references/projects/create-dev-key.md | 1 + docs/references/projects/delete-dev-key.md | 1 + docs/references/projects/get-dev-key.md | 1 + docs/references/projects/list-dev-keys.md | 1 + docs/references/projects/update-dev-key.md | 1 + .../Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/GetDevKey.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php | 2 +- 10 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 docs/references/projects/create-dev-key.md create mode 100644 docs/references/projects/delete-dev-key.md create mode 100644 docs/references/projects/get-dev-key.md create mode 100644 docs/references/projects/list-dev-keys.md create mode 100644 docs/references/projects/update-dev-key.md diff --git a/docs/references/projects/create-dev-key.md b/docs/references/projects/create-dev-key.md new file mode 100644 index 0000000000..4d6afd789b --- /dev/null +++ b/docs/references/projects/create-dev-key.md @@ -0,0 +1 @@ +Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only. \ No newline at end of file diff --git a/docs/references/projects/delete-dev-key.md b/docs/references/projects/delete-dev-key.md new file mode 100644 index 0000000000..f78b373739 --- /dev/null +++ b/docs/references/projects/delete-dev-key.md @@ -0,0 +1 @@ +Delete a project's dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors. \ No newline at end of file diff --git a/docs/references/projects/get-dev-key.md b/docs/references/projects/get-dev-key.md new file mode 100644 index 0000000000..ad7ede3cfa --- /dev/null +++ b/docs/references/projects/get-dev-key.md @@ -0,0 +1 @@ +Get a project's dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. \ No newline at end of file diff --git a/docs/references/projects/list-dev-keys.md b/docs/references/projects/list-dev-keys.md new file mode 100644 index 0000000000..7fcf3fa9f4 --- /dev/null +++ b/docs/references/projects/list-dev-keys.md @@ -0,0 +1 @@ +List all the project's dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. \ No newline at end of file diff --git a/docs/references/projects/update-dev-key.md b/docs/references/projects/update-dev-key.md new file mode 100644 index 0000000000..55ea27f9c1 --- /dev/null +++ b/docs/references/projects/update-dev-key.md @@ -0,0 +1 @@ +Update a project's dev key by its unique ID. Use this endpoint to update a project's dev key name or expiration time. \ No newline at end of file diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php index 2d8b00a38f..90a8969774 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php @@ -38,7 +38,7 @@ class CreateDevKey extends Action ->label('sdk', new Method( namespace: 'projects', name: 'createDevKey', - description: '', + description: '/docs/references/projects/create-dev-key.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php index ebfbd6639f..27b2b83396 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php @@ -33,7 +33,7 @@ class DeleteDevKey extends Action ->label('sdk', new Method( namespace: 'projects', name: 'deleteDevKey', - description: '', + description: '/docs/references/projects/delete-dev-key.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php index 8ee46beee7..5e5960b121 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php @@ -33,7 +33,7 @@ class GetDevKey extends Action ->label('sdk', new Method( namespace: 'projects', name: 'getDevKey', - description: '', + description: '/docs/references/projects/get-dev-key.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php index eea1249b54..267284fa2c 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php @@ -34,7 +34,7 @@ class ListDevKeys extends Action ->label('sdk', new Method( namespace: 'projects', name: 'listDevKeys', - description: '', + description: '/docs/references/projects/list-dev-keys.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php index 3559d4edf4..e2601a1693 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php @@ -34,7 +34,7 @@ class UpdateDevKey extends Action ->label('sdk', new Method( namespace: 'projects', name: 'updateDevKey', - description: '', + description: '/docs/references/projects/update-dev-key.md', auth: [AuthType::ADMIN], responses: [ new SDKResponse( From cea308ef7161c062da66e5d1afebde9a47b84e00 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 4 Feb 2025 11:55:05 +0000 Subject: [PATCH 105/169] chore: remove confusing comment --- app/controllers/general.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 6775740c7d..2599c124bc 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -990,8 +990,6 @@ App::error() $type = $error->getType(); - // TODO filter out secrets and server details when not in development - // but devKey is provided $output = (App::isDevelopment()) ? [ 'message' => $message, 'code' => $code, From a98f32b5e1d1efdfae5f1549a851002ab1a53261 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 4 Feb 2025 16:56:14 +0000 Subject: [PATCH 106/169] merge with 1.7.x --- .env | 3 + .github/workflows/sdk-preview.yml | 33 + .github/workflows/tests.yml | 39 +- .gitignore | 1 + CHANGES.md | 114 + CONTRIBUTING.md | 12 + Dockerfile | 8 +- README-CN.md | 6 +- README.md | 6 +- SECURITY.md | 1 + app/cli.php | 27 +- app/config/collections.php | 6246 +---------------- app/config/collections/common.php | 2640 +++++++ app/config/collections/databases.php | 126 + app/config/collections/platform.php | 1534 ++++ app/config/collections/projects.php | 1957 ++++++ app/config/errors.php | 17 +- app/config/function-templates.php | 5 +- .../locale/templates/email-inner-base.tpl | 4 +- .../locale/templates/email-magic-url.tpl | 2 +- .../locale/templates/email-mfa-challenge.tpl | 2 +- app/config/locale/templates/email-otp.tpl | 2 +- .../locale/templates/email-session-alert.tpl | 2 +- app/config/locale/translations/af.json | 16 +- app/config/locale/translations/ar-ma.json | 20 +- app/config/locale/translations/ar.json | 18 +- app/config/locale/translations/as.json | 22 +- app/config/locale/translations/az.json | 18 +- app/config/locale/translations/be.json | 22 +- app/config/locale/translations/bg.json | 18 +- app/config/locale/translations/bh.json | 24 +- app/config/locale/translations/bn.json | 18 +- app/config/locale/translations/bs.json | 18 +- app/config/locale/translations/ca.json | 18 +- app/config/locale/translations/cs.json | 18 +- app/config/locale/translations/da.json | 18 +- app/config/locale/translations/de.json | 18 +- app/config/locale/translations/el.json | 18 +- app/config/locale/translations/en.json | 26 +- app/config/locale/translations/eo.json | 18 +- app/config/locale/translations/es.json | 20 +- app/config/locale/translations/fa.json | 16 +- app/config/locale/translations/fi.json | 18 +- app/config/locale/translations/fo.json | 18 +- app/config/locale/translations/fr.json | 18 +- app/config/locale/translations/ga.json | 18 +- app/config/locale/translations/gu.json | 18 +- app/config/locale/translations/he.json | 18 +- app/config/locale/translations/hi.json | 18 +- app/config/locale/translations/hr.json | 18 +- app/config/locale/translations/hu.json | 18 +- app/config/locale/translations/hy.json | 18 +- app/config/locale/translations/id.json | 18 +- app/config/locale/translations/is.json | 18 +- app/config/locale/translations/it.json | 18 +- app/config/locale/translations/ja.json | 22 +- app/config/locale/translations/jv.json | 18 +- app/config/locale/translations/km.json | 6 +- app/config/locale/translations/kn.json | 18 +- app/config/locale/translations/ko.json | 22 +- app/config/locale/translations/la.json | 20 +- app/config/locale/translations/lb.json | 18 +- app/config/locale/translations/lt.json | 18 +- app/config/locale/translations/lv.json | 18 +- app/config/locale/translations/ml.json | 22 +- app/config/locale/translations/mr.json | 18 +- app/config/locale/translations/ms.json | 18 +- app/config/locale/translations/nb.json | 18 +- app/config/locale/translations/ne.json | 18 +- app/config/locale/translations/nl.json | 16 +- app/config/locale/translations/nn.json | 22 +- app/config/locale/translations/or.json | 18 +- app/config/locale/translations/pa.json | 18 +- app/config/locale/translations/pl.json | 18 +- app/config/locale/translations/pt-br.json | 18 +- app/config/locale/translations/pt-pt.json | 18 +- app/config/locale/translations/ro.json | 18 +- app/config/locale/translations/ru.json | 18 +- app/config/locale/translations/sa.json | 22 +- app/config/locale/translations/sd.json | 26 +- app/config/locale/translations/si.json | 18 +- app/config/locale/translations/sk.json | 18 +- app/config/locale/translations/sl.json | 18 +- app/config/locale/translations/sn.json | 18 +- app/config/locale/translations/sq.json | 18 +- app/config/locale/translations/sv.json | 18 +- app/config/locale/translations/ta.json | 18 +- app/config/locale/translations/te.json | 18 +- app/config/locale/translations/th.json | 4 +- app/config/locale/translations/tl.json | 18 +- app/config/locale/translations/tr.json | 18 +- app/config/locale/translations/uk.json | 18 +- app/config/locale/translations/ur.json | 18 +- app/config/locale/translations/vi.json | 6 +- app/config/locale/translations/zh-cn.json | 22 +- app/config/locale/translations/zh-tw.json | 22 +- app/config/platforms.php | 32 +- app/config/specs/open-api3-1.6.x-client.json | 393 +- app/config/specs/open-api3-1.6.x-console.json | 2506 ++----- app/config/specs/open-api3-1.6.x-server.json | 1219 +--- app/config/specs/open-api3-latest-client.json | 569 +- .../specs/open-api3-latest-console.json | 2949 +++----- app/config/specs/open-api3-latest-server.json | 1587 ++--- app/config/specs/swagger2-1.6.x-client.json | 397 +- app/config/specs/swagger2-1.6.x-console.json | 2597 ++----- app/config/specs/swagger2-1.6.x-server.json | 1284 +--- app/config/specs/swagger2-latest-client.json | 687 +- app/config/specs/swagger2-latest-console.json | 3154 +++------ app/config/specs/swagger2-latest-server.json | 1766 ++--- app/config/storage/inputs.php | 12 +- app/config/storage/mimes.php | 102 +- app/config/storage/outputs.php | 18 +- app/config/variables.php | 18 + app/controllers/api/account.php | 1136 +-- app/controllers/api/avatars.php | 200 +- app/controllers/api/console.php | 45 +- app/controllers/api/databases.php | 1371 ++-- app/controllers/api/functions.php | 706 +- app/controllers/api/graphql.php | 78 +- app/controllers/api/health.php | 473 +- app/controllers/api/locale.php | 173 +- app/controllers/api/messaging.php | 1054 ++- app/controllers/api/migrations.php | 705 +- app/controllers/api/project.php | 185 +- app/controllers/api/projects.php | 1399 ++-- app/controllers/api/proxy.php | 160 +- app/controllers/api/storage.php | 439 +- app/controllers/api/teams.php | 617 +- app/controllers/api/users.php | 903 ++- app/controllers/api/vcs.php | 450 +- app/controllers/general.php | 213 +- app/controllers/mock.php | 22 +- app/controllers/shared/api.php | 278 +- app/controllers/shared/api/auth.php | 17 +- app/http.php | 309 +- app/init.php | 191 +- app/realtime.php | 85 +- app/views/install/compose.phtml | 3 +- app/worker.php | 122 +- composer.json | 21 +- composer.lock | 2630 +++++-- docker-compose.yml | 12 +- .../examples/account/create-push-target.md | 1 + .../client-graphql/examples/account/create.md | 1 + .../client-graphql/examples/account/get.md | 1 + .../examples/account/update-email.md | 1 + .../examples/account/update-m-f-a.md | 1 + .../account/update-mfa-authenticator.md | 1 + .../examples/account/update-name.md | 1 + .../examples/account/update-password.md | 1 + .../examples/account/update-phone.md | 1 + .../examples/account/update-prefs.md | 1 + .../examples/account/update-push-target.md | 1 + .../examples/account/update-status.md | 1 + .../examples/messaging/create-subscriber.md | 1 + .../databases/update-boolean-attribute.md | 3 +- .../databases/update-datetime-attribute.md | 3 +- .../databases/update-email-attribute.md | 3 +- .../databases/update-enum-attribute.md | 3 +- .../databases/update-float-attribute.md | 3 +- .../databases/update-integer-attribute.md | 3 +- .../examples/databases/update-ip-attribute.md | 3 +- .../update-relationship-attribute.md | 1 + .../databases/update-string-attribute.md | 4 +- .../databases/update-url-attribute.md | 3 +- .../examples/messaging/create-push.md | 7 +- .../examples/messaging/update-push.md | 3 + .../projects/update-memberships-privacy.md | 5 + .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 13 +- .../examples/messaging/update-push.md | 7 +- .../projects/update-memberships-privacy.md | 16 + .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 9 +- .../examples/messaging/update-push.md | 3 + .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 13 +- .../examples/messaging/update-push.md | 7 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 12 +- .../examples/messaging/update-push.md | 6 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 9 +- .../examples/messaging/update-push.md | 3 + .../server-graphql/examples/account/create.md | 1 + .../server-graphql/examples/account/get.md | 1 + .../examples/account/update-email.md | 1 + .../examples/account/update-m-f-a.md | 1 + .../account/update-mfa-authenticator.md | 1 + .../examples/account/update-name.md | 1 + .../examples/account/update-password.md | 1 + .../examples/account/update-phone.md | 1 + .../examples/account/update-prefs.md | 1 + .../examples/account/update-status.md | 1 + .../databases/create-boolean-attribute.md | 2 + .../examples/databases/create-collection.md | 2 + .../databases/create-datetime-attribute.md | 2 + .../databases/create-email-attribute.md | 2 + .../databases/create-enum-attribute.md | 2 + .../databases/create-float-attribute.md | 2 + .../examples/databases/create-index.md | 2 + .../databases/create-integer-attribute.md | 2 + .../examples/databases/create-ip-attribute.md | 2 + .../create-relationship-attribute.md | 2 + .../databases/create-string-attribute.md | 2 + .../databases/create-url-attribute.md | 2 + .../examples/databases/get-collection.md | 2 + .../examples/databases/get-index.md | 2 + .../examples/databases/list-collections.md | 2 + .../examples/databases/list-indexes.md | 2 + .../databases/update-boolean-attribute.md | 2 + .../examples/databases/update-collection.md | 2 + .../databases/update-datetime-attribute.md | 2 + .../databases/update-email-attribute.md | 2 + .../databases/update-enum-attribute.md | 2 + .../databases/update-float-attribute.md | 2 + .../databases/update-integer-attribute.md | 2 + .../examples/databases/update-ip-attribute.md | 2 + .../update-relationship-attribute.md | 2 + .../databases/update-string-attribute.md | 4 +- .../databases/update-url-attribute.md | 2 + .../examples/messaging/create-push.md | 7 +- .../examples/messaging/create-subscriber.md | 1 + .../examples/messaging/get-subscriber.md | 1 + .../examples/messaging/list-subscribers.md | 1 + .../examples/messaging/list-targets.md | 1 + .../examples/messaging/update-push.md | 5 +- .../examples/users/create-argon2user.md | 1 + .../examples/users/create-bcrypt-user.md | 1 + .../examples/users/create-m-d5user.md | 1 + .../examples/users/create-p-h-pass-user.md | 1 + .../examples/users/create-s-h-a-user.md | 1 + .../users/create-scrypt-modified-user.md | 1 + .../examples/users/create-scrypt-user.md | 1 + .../examples/users/create-target.md | 1 + .../server-graphql/examples/users/create.md | 1 + .../users/delete-mfa-authenticator.md | 1 + .../examples/users/get-target.md | 1 + .../server-graphql/examples/users/get.md | 1 + .../examples/users/list-targets.md | 1 + .../server-graphql/examples/users/list.md | 1 + .../users/update-email-verification.md | 1 + .../examples/users/update-email.md | 1 + .../examples/users/update-labels.md | 1 + .../examples/users/update-mfa.md | 1 + .../examples/users/update-name.md | 1 + .../examples/users/update-password.md | 1 + .../users/update-phone-verification.md | 1 + .../examples/users/update-phone.md | 1 + .../examples/users/update-status.md | 1 + .../examples/users/update-target.md | 1 + .../java/databases/update-string-attribute.md | 2 +- .../java/messaging/create-push.md | 9 +- .../java/messaging/update-push.md | 3 + .../databases/update-string-attribute.md | 2 +- .../kotlin/messaging/create-push.md | 11 +- .../kotlin/messaging/update-push.md | 5 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 11 +- .../examples/messaging/update-push.md | 5 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 11 +- .../examples/messaging/update-push.md | 5 +- .../account/create-anonymous-session.md | 1 + .../account/create-email-password-session.md | 1 + .../examples/account/create-email-token.md | 1 + .../examples/account/create-j-w-t.md | 1 + .../account/create-magic-u-r-l-token.md | 1 + .../account/create-mfa-authenticator.md | 1 + .../examples/account/create-mfa-challenge.md | 1 + .../account/create-mfa-recovery-codes.md | 1 + .../examples/account/create-o-auth2token.md | 1 + .../examples/account/create-phone-token.md | 1 + .../account/create-phone-verification.md | 1 + .../examples/account/create-recovery.md | 1 + .../examples/account/create-session.md | 1 + .../examples/account/create-verification.md | 1 + .../server-python/examples/account/create.md | 1 + .../examples/account/delete-identity.md | 1 + .../account/delete-mfa-authenticator.md | 1 + .../examples/account/delete-session.md | 1 + .../examples/account/delete-sessions.md | 1 + .../account/get-mfa-recovery-codes.md | 1 + .../examples/account/get-prefs.md | 1 + .../examples/account/get-session.md | 1 + .../server-python/examples/account/get.md | 1 + .../examples/account/list-identities.md | 1 + .../examples/account/list-logs.md | 1 + .../examples/account/list-mfa-factors.md | 1 + .../examples/account/list-sessions.md | 1 + .../examples/account/update-email.md | 1 + .../examples/account/update-m-f-a.md | 1 + .../account/update-magic-u-r-l-session.md | 1 + .../account/update-mfa-authenticator.md | 1 + .../examples/account/update-mfa-challenge.md | 1 + .../account/update-mfa-recovery-codes.md | 1 + .../examples/account/update-name.md | 1 + .../examples/account/update-password.md | 1 + .../examples/account/update-phone-session.md | 1 + .../account/update-phone-verification.md | 1 + .../examples/account/update-phone.md | 1 + .../examples/account/update-prefs.md | 1 + .../examples/account/update-recovery.md | 1 + .../examples/account/update-session.md | 1 + .../examples/account/update-status.md | 1 + .../examples/account/update-verification.md | 1 + .../examples/avatars/get-browser.md | 1 + .../examples/avatars/get-credit-card.md | 1 + .../examples/avatars/get-favicon.md | 1 + .../examples/avatars/get-flag.md | 1 + .../examples/avatars/get-image.md | 1 + .../examples/avatars/get-initials.md | 1 + .../server-python/examples/avatars/get-q-r.md | 1 + .../databases/create-boolean-attribute.md | 1 + .../examples/databases/create-collection.md | 1 + .../databases/create-datetime-attribute.md | 1 + .../examples/databases/create-document.md | 1 + .../databases/create-email-attribute.md | 1 + .../databases/create-enum-attribute.md | 1 + .../databases/create-float-attribute.md | 1 + .../examples/databases/create-index.md | 1 + .../databases/create-integer-attribute.md | 1 + .../examples/databases/create-ip-attribute.md | 1 + .../create-relationship-attribute.md | 1 + .../databases/create-string-attribute.md | 1 + .../databases/create-url-attribute.md | 1 + .../examples/databases/create.md | 1 + .../examples/databases/delete-attribute.md | 1 + .../examples/databases/delete-collection.md | 1 + .../examples/databases/delete-document.md | 1 + .../examples/databases/delete-index.md | 1 + .../examples/databases/delete.md | 1 + .../examples/databases/get-attribute.md | 1 + .../examples/databases/get-collection.md | 1 + .../examples/databases/get-document.md | 1 + .../examples/databases/get-index.md | 1 + .../server-python/examples/databases/get.md | 1 + .../examples/databases/list-attributes.md | 1 + .../examples/databases/list-collections.md | 1 + .../examples/databases/list-documents.md | 1 + .../examples/databases/list-indexes.md | 1 + .../server-python/examples/databases/list.md | 1 + .../databases/update-boolean-attribute.md | 1 + .../examples/databases/update-collection.md | 1 + .../databases/update-datetime-attribute.md | 1 + .../examples/databases/update-document.md | 1 + .../databases/update-email-attribute.md | 1 + .../databases/update-enum-attribute.md | 1 + .../databases/update-float-attribute.md | 1 + .../databases/update-integer-attribute.md | 1 + .../examples/databases/update-ip-attribute.md | 1 + .../update-relationship-attribute.md | 1 + .../databases/update-string-attribute.md | 3 +- .../databases/update-url-attribute.md | 1 + .../examples/databases/update.md | 1 + .../examples/functions/create-build.md | 1 + .../examples/functions/create-deployment.md | 1 + .../examples/functions/create-execution.md | 1 + .../examples/functions/create-variable.md | 1 + .../examples/functions/create.md | 1 + .../examples/functions/delete-deployment.md | 1 + .../examples/functions/delete-execution.md | 1 + .../examples/functions/delete-variable.md | 1 + .../examples/functions/delete.md | 1 + .../functions/get-deployment-download.md | 1 + .../examples/functions/get-deployment.md | 1 + .../examples/functions/get-execution.md | 1 + .../examples/functions/get-variable.md | 1 + .../server-python/examples/functions/get.md | 1 + .../examples/functions/list-deployments.md | 1 + .../examples/functions/list-executions.md | 1 + .../examples/functions/list-runtimes.md | 1 + .../examples/functions/list-specifications.md | 1 + .../examples/functions/list-variables.md | 1 + .../server-python/examples/functions/list.md | 1 + .../functions/update-deployment-build.md | 1 + .../examples/functions/update-deployment.md | 1 + .../examples/functions/update-variable.md | 1 + .../examples/functions/update.md | 1 + .../examples/graphql/mutation.md | 1 + .../server-python/examples/graphql/query.md | 1 + .../examples/health/get-antivirus.md | 1 + .../examples/health/get-cache.md | 1 + .../examples/health/get-certificate.md | 1 + .../server-python/examples/health/get-d-b.md | 1 + .../examples/health/get-failed-jobs.md | 1 + .../examples/health/get-pub-sub.md | 1 + .../examples/health/get-queue-builds.md | 1 + .../examples/health/get-queue-certificates.md | 1 + .../examples/health/get-queue-databases.md | 1 + .../examples/health/get-queue-deletes.md | 1 + .../examples/health/get-queue-functions.md | 1 + .../examples/health/get-queue-logs.md | 1 + .../examples/health/get-queue-mails.md | 1 + .../examples/health/get-queue-messaging.md | 1 + .../examples/health/get-queue-migrations.md | 1 + .../examples/health/get-queue-usage-dump.md | 1 + .../examples/health/get-queue-usage.md | 1 + .../examples/health/get-queue-webhooks.md | 1 + .../examples/health/get-queue.md | 1 + .../examples/health/get-storage-local.md | 1 + .../examples/health/get-storage.md | 1 + .../server-python/examples/health/get-time.md | 1 + .../server-python/examples/health/get.md | 1 + .../server-python/examples/locale/get.md | 1 + .../examples/locale/list-codes.md | 1 + .../examples/locale/list-continents.md | 1 + .../examples/locale/list-countries-e-u.md | 1 + .../examples/locale/list-countries-phones.md | 1 + .../examples/locale/list-countries.md | 1 + .../examples/locale/list-currencies.md | 1 + .../examples/locale/list-languages.md | 1 + .../messaging/create-apns-provider.md | 1 + .../examples/messaging/create-email.md | 1 + .../examples/messaging/create-fcm-provider.md | 1 + .../messaging/create-mailgun-provider.md | 1 + .../messaging/create-msg91provider.md | 1 + .../examples/messaging/create-push.md | 12 +- .../messaging/create-sendgrid-provider.md | 1 + .../examples/messaging/create-sms.md | 1 + .../messaging/create-smtp-provider.md | 1 + .../examples/messaging/create-subscriber.md | 1 + .../messaging/create-telesign-provider.md | 1 + .../messaging/create-textmagic-provider.md | 1 + .../examples/messaging/create-topic.md | 1 + .../messaging/create-twilio-provider.md | 1 + .../messaging/create-vonage-provider.md | 1 + .../examples/messaging/delete-provider.md | 1 + .../examples/messaging/delete-subscriber.md | 1 + .../examples/messaging/delete-topic.md | 1 + .../examples/messaging/delete.md | 1 + .../examples/messaging/get-message.md | 1 + .../examples/messaging/get-provider.md | 1 + .../examples/messaging/get-subscriber.md | 1 + .../examples/messaging/get-topic.md | 1 + .../examples/messaging/list-message-logs.md | 1 + .../examples/messaging/list-messages.md | 1 + .../examples/messaging/list-provider-logs.md | 1 + .../examples/messaging/list-providers.md | 1 + .../messaging/list-subscriber-logs.md | 1 + .../examples/messaging/list-subscribers.md | 1 + .../examples/messaging/list-targets.md | 1 + .../examples/messaging/list-topic-logs.md | 1 + .../examples/messaging/list-topics.md | 1 + .../messaging/update-apns-provider.md | 1 + .../examples/messaging/update-email.md | 1 + .../examples/messaging/update-fcm-provider.md | 1 + .../messaging/update-mailgun-provider.md | 1 + .../messaging/update-msg91provider.md | 1 + .../examples/messaging/update-push.md | 6 +- .../messaging/update-sendgrid-provider.md | 1 + .../examples/messaging/update-sms.md | 1 + .../messaging/update-smtp-provider.md | 1 + .../messaging/update-telesign-provider.md | 1 + .../messaging/update-textmagic-provider.md | 1 + .../examples/messaging/update-topic.md | 1 + .../messaging/update-twilio-provider.md | 1 + .../messaging/update-vonage-provider.md | 1 + .../examples/storage/create-bucket.md | 1 + .../examples/storage/create-file.md | 1 + .../examples/storage/delete-bucket.md | 1 + .../examples/storage/delete-file.md | 1 + .../examples/storage/get-bucket.md | 1 + .../examples/storage/get-file-download.md | 1 + .../examples/storage/get-file-preview.md | 1 + .../examples/storage/get-file-view.md | 1 + .../examples/storage/get-file.md | 1 + .../examples/storage/list-buckets.md | 1 + .../examples/storage/list-files.md | 1 + .../examples/storage/update-bucket.md | 1 + .../examples/storage/update-file.md | 1 + .../examples/teams/create-membership.md | 1 + .../server-python/examples/teams/create.md | 1 + .../examples/teams/delete-membership.md | 1 + .../server-python/examples/teams/delete.md | 1 + .../examples/teams/get-membership.md | 1 + .../server-python/examples/teams/get-prefs.md | 1 + .../1.6.x/server-python/examples/teams/get.md | 1 + .../examples/teams/list-memberships.md | 1 + .../server-python/examples/teams/list.md | 1 + .../teams/update-membership-status.md | 1 + .../examples/teams/update-membership.md | 1 + .../examples/teams/update-name.md | 1 + .../examples/teams/update-prefs.md | 1 + .../examples/users/create-argon2user.md | 1 + .../examples/users/create-bcrypt-user.md | 1 + .../examples/users/create-j-w-t.md | 1 + .../examples/users/create-m-d5user.md | 1 + .../users/create-mfa-recovery-codes.md | 1 + .../examples/users/create-p-h-pass-user.md | 1 + .../examples/users/create-s-h-a-user.md | 1 + .../users/create-scrypt-modified-user.md | 1 + .../examples/users/create-scrypt-user.md | 1 + .../examples/users/create-session.md | 1 + .../examples/users/create-target.md | 1 + .../examples/users/create-token.md | 1 + .../server-python/examples/users/create.md | 1 + .../examples/users/delete-identity.md | 1 + .../users/delete-mfa-authenticator.md | 1 + .../examples/users/delete-session.md | 1 + .../examples/users/delete-sessions.md | 1 + .../examples/users/delete-target.md | 1 + .../server-python/examples/users/delete.md | 1 + .../examples/users/get-mfa-recovery-codes.md | 1 + .../server-python/examples/users/get-prefs.md | 1 + .../examples/users/get-target.md | 1 + .../1.6.x/server-python/examples/users/get.md | 1 + .../examples/users/list-identities.md | 1 + .../server-python/examples/users/list-logs.md | 1 + .../examples/users/list-memberships.md | 1 + .../examples/users/list-mfa-factors.md | 1 + .../examples/users/list-sessions.md | 1 + .../examples/users/list-targets.md | 1 + .../server-python/examples/users/list.md | 1 + .../users/update-email-verification.md | 1 + .../examples/users/update-email.md | 1 + .../examples/users/update-labels.md | 1 + .../users/update-mfa-recovery-codes.md | 1 + .../examples/users/update-mfa.md | 1 + .../examples/users/update-name.md | 1 + .../examples/users/update-password.md | 1 + .../users/update-phone-verification.md | 1 + .../examples/users/update-phone.md | 1 + .../examples/users/update-prefs.md | 1 + .../examples/users/update-status.md | 1 + .../examples/users/update-target.md | 1 + .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 7 +- .../examples/messaging/update-push.md | 5 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 11 +- .../examples/messaging/update-push.md | 5 +- .../databases/update-string-attribute.md | 2 +- .../examples/messaging/create-push.md | 12 +- .../examples/messaging/update-push.md | 6 +- docs/references/account/create-push-target.md | 1 + .../account/create-token-magic-url.md | 2 +- docs/references/account/delete-push-target.md | 1 + docs/references/account/update-push-target.md | 1 + docs/references/assistant/chat.md | 1 + .../databases/get-collection-usage.md | 1 + .../databases/get-database-usage.md | 1 + docs/references/databases/get-usage.md | 1 + docs/references/functions/create-build.md | 1 + .../functions/get-function-usage.md | 1 + .../functions/get-functions-usage.md | 1 + .../functions/update-deployment-build.md | 1 + docs/references/messaging/update-email.md | 2 +- docs/references/messaging/update-push.md | 2 +- docs/references/messaging/update-sms.md | 2 +- .../references/migrations/delete-migration.md | 1 + docs/references/migrations/get-migration.md | 1 + docs/references/migrations/list-migrations.md | 1 + .../migrations/migration-appwrite-report.md | 1 + .../migrations/migration-appwrite.md | 1 + .../migrations/migration-firebase-report.md | 1 + .../migrations/migration-firebase.md | 1 + .../migrations/migration-nhost-report.md | 1 + docs/references/migrations/migration-nhost.md | 1 + .../migrations/migration-supabase-report.md | 1 + .../migrations/migration-supabase.md | 1 + docs/references/migrations/retry-migration.md | 1 + docs/references/project/get-usage.md | 1 + docs/references/projects/create-jwt.md | 1 + docs/references/projects/create-key.md | 1 + docs/references/projects/create-platform.md | 1 + docs/references/projects/create-smtp-test.md | 1 + docs/references/projects/create-webhook.md | 1 + docs/references/projects/create.md | 1 + .../projects/delete-email-template.md | 1 + docs/references/projects/delete-key.md | 1 + docs/references/projects/delete-platform.md | 1 + .../projects/delete-sms-template.md | 1 + docs/references/projects/delete-webhook.md | 1 + docs/references/projects/delete.md | 1 + .../references/projects/get-email-template.md | 1 + docs/references/projects/get-key.md | 1 + docs/references/projects/get-platform.md | 1 + docs/references/projects/get-sms-template.md | 1 + docs/references/projects/get-webhook.md | 1 + docs/references/projects/get.md | 1 + docs/references/projects/list-keys.md | 1 + docs/references/projects/list-platforms.md | 1 + docs/references/projects/list-webhooks.md | 1 + docs/references/projects/list.md | 1 + .../projects/update-api-status-all.md | 1 + docs/references/projects/update-api-status.md | 1 + .../projects/update-auth-duration.md | 1 + docs/references/projects/update-auth-limit.md | 1 + .../update-auth-password-dictionary.md | 1 + .../projects/update-auth-password-history.md | 1 + .../projects/update-auth-sessions-limit.md | 1 + .../references/projects/update-auth-status.md | 1 + .../projects/update-email-template.md | 1 + docs/references/projects/update-key.md | 1 + .../projects/update-memberships-privacy.md | 1 + .../projects/update-mock-numbers.md | 1 + docs/references/projects/update-oauth2.md | 1 + .../projects/update-personal-data-check.md | 1 + docs/references/projects/update-platform.md | 1 + .../projects/update-service-status-all.md | 1 + .../projects/update-service-status.md | 1 + .../projects/update-session-alerts.md | 1 + .../projects/update-sms-template.md | 1 + docs/references/projects/update-smtp.md | 1 + docs/references/projects/update-team.md | 1 + .../projects/update-webhook-signature.md | 1 + docs/references/projects/update-webhook.md | 1 + docs/references/projects/update.md | 1 + .../proxy/update-rule-verification.md | 1 + docs/references/storage/get-bucket-usage.md | 1 + docs/references/storage/get-usage.md | 1 + docs/references/teams/get-team-member.md | 2 +- docs/references/teams/list-team-members.md | 2 +- docs/references/users/get-usage.md | 1 + .../vcs/create-github-installation.md | 1 + .../vcs/create-repository-detection.md | 1 + docs/references/vcs/create-repository.md | 1 + docs/references/vcs/delete-installation.md | 1 + docs/references/vcs/get-installation.md | 1 + .../references/vcs/get-repository-contents.md | 1 + docs/references/vcs/get-repository.md | 1 + docs/references/vcs/list-installations.md | 1 + docs/references/vcs/list-repositories.md | 1 + .../vcs/list-repository-branches.md | 1 + .../vcs/update-external-deployments.md | 1 + phpunit.xml | 1 + src/Appwrite/Auth/Auth.php | 7 + src/Appwrite/Auth/OAuth2/Amazon.php | 4 +- src/Appwrite/Auth/OAuth2/Firebase.php | 389 - src/Appwrite/Auth/Validator/Phone.php | 10 + src/Appwrite/Certificates/Adapter.php | 14 + src/Appwrite/Certificates/LetsEncrypt.php | 125 + src/Appwrite/Event/Audit.php | 38 +- src/Appwrite/Event/Build.php | 14 +- src/Appwrite/Event/Certificate.php | 14 +- src/Appwrite/Event/Database.php | 45 +- src/Appwrite/Event/Delete.php | 15 +- src/Appwrite/Event/Event.php | 98 +- src/Appwrite/Event/Func.php | 53 +- src/Appwrite/Event/Mail.php | 14 +- src/Appwrite/Event/Messaging.php | 17 +- src/Appwrite/Event/Migration.php | 15 +- src/Appwrite/Event/Realtime.php | 70 + src/Appwrite/Event/Usage.php | 25 +- src/Appwrite/Event/UsageDump.php | 13 +- src/Appwrite/Event/Webhook.php | 31 + src/Appwrite/Extend/Exception.php | 3 +- src/Appwrite/GraphQL/Schema.php | 43 +- src/Appwrite/GraphQL/Types/Mapper.php | 41 +- src/Appwrite/Messaging/Adapter/Realtime.php | 35 +- src/Appwrite/Migration/Migration.php | 1 + src/Appwrite/Platform/Tasks/Doctor.php | 2 + src/Appwrite/Platform/Tasks/Maintenance.php | 84 +- src/Appwrite/Platform/Tasks/Migrate.php | 20 +- src/Appwrite/Platform/Tasks/SDKs.php | 41 +- src/Appwrite/Platform/Tasks/ScheduleBase.php | 36 +- .../Platform/Tasks/ScheduleExecutions.php | 10 +- .../Platform/Tasks/ScheduleFunctions.php | 6 +- .../Platform/Tasks/ScheduleMessages.php | 8 +- src/Appwrite/Platform/Tasks/Specs.php | 92 +- src/Appwrite/Platform/Workers/Audits.php | 3 + src/Appwrite/Platform/Workers/Builds.php | 46 +- .../Platform/Workers/Certificates.php | 251 +- src/Appwrite/Platform/Workers/Databases.php | 240 +- src/Appwrite/Platform/Workers/Deletes.php | 225 +- src/Appwrite/Platform/Workers/Functions.php | 36 +- src/Appwrite/Platform/Workers/Messaging.php | 276 +- src/Appwrite/Platform/Workers/Migrations.php | 144 +- src/Appwrite/Platform/Workers/Usage.php | 30 +- src/Appwrite/Platform/Workers/UsageDump.php | 8 +- src/Appwrite/Platform/Workers/Webhooks.php | 55 +- src/Appwrite/PubSub/Adapter.php | 13 + src/Appwrite/PubSub/Adapter/Redis.php | 31 + src/Appwrite/SDK/AuthType.php | 11 + src/Appwrite/SDK/ContentType.php | 15 + src/Appwrite/SDK/Method.php | 286 + src/Appwrite/SDK/MethodType.php | 11 + src/Appwrite/SDK/Response.php | 27 + src/Appwrite/Specification/Format.php | 2 + .../Specification/Format/OpenAPI3.php | 213 +- .../Specification/Format/Swagger2.php | 209 +- .../Database/Validator/Queries/Migrations.php | 1 + src/Appwrite/Utopia/Request.php | 26 +- src/Appwrite/Utopia/Response/Model/Func.php | 2 +- .../Utopia/Response/Model/Membership.php | 6 +- .../Utopia/Response/Model/MetricBreakdown.php | 8 + .../Utopia/Response/Model/Migration.php | 8 +- .../Utopia/Response/Model/Project.php | 21 + src/Appwrite/Utopia/Response/Model/Target.php | 8 +- .../Utopia/Response/Model/UsageDatabase.php | 26 + .../Utopia/Response/Model/UsageDatabases.php | 26 + .../Utopia/Response/Model/UsageProject.php | 45 + tests/e2e/Client.php | 14 +- tests/e2e/General/CompressionTest.php | 137 + tests/e2e/General/UsageTest.php | 6 +- tests/e2e/Scopes/ProjectCustom.php | 2 + .../Account/AccountCustomClientTest.php | 41 + .../Databases/DatabasesConsoleClientTest.php | 2 +- .../Databases/DatabasesCustomServerTest.php | 2 +- .../Functions/FunctionsCustomServerTest.php | 2 +- .../FunctionsScheduleTest.php | 3 +- .../Health/HealthCustomServerTest.php | 4 +- .../Messaging/MessagingConsoleClientTest.php | 22 +- .../Services/Migrations/MigrationsBase.php | 895 +++ .../MigrationsConsoleClientTest.php | 12 + .../Projects/ProjectsConsoleClientTest.php | 139 +- .../Realtime/RealtimeCustomClientTest.php | 24 + tests/e2e/Services/Teams/TeamsBaseClient.php | 101 +- tests/e2e/Services/Teams/TeamsBaseServer.php | 74 +- .../Services/Teams/TeamsCustomClientTest.php | 103 + tests/e2e/Services/Users/UsersBase.php | 18 + tests/e2e/Services/Webhooks/WebhooksBase.php | 12 +- tests/resources/docker/docker-compose.yml | 1 + tests/unit/Auth/Validator/PhoneTest.php | 1 + tests/unit/Event/EventTest.php | 19 +- tests/unit/Usage/StatsTest.php | 19 +- tests/unit/Utopia/RequestTest.php | 10 +- 718 files changed, 26238 insertions(+), 27345 deletions(-) create mode 100644 .github/workflows/sdk-preview.yml create mode 100644 app/config/collections/common.php create mode 100644 app/config/collections/databases.php create mode 100644 app/config/collections/platform.php create mode 100644 app/config/collections/projects.php create mode 100644 docs/examples/1.6.x/console-cli/examples/projects/update-memberships-privacy.md create mode 100644 docs/examples/1.6.x/console-web/examples/projects/update-memberships-privacy.md create mode 100644 docs/references/account/create-push-target.md create mode 100644 docs/references/account/delete-push-target.md create mode 100644 docs/references/account/update-push-target.md create mode 100644 docs/references/assistant/chat.md create mode 100644 docs/references/databases/get-collection-usage.md create mode 100644 docs/references/databases/get-database-usage.md create mode 100644 docs/references/databases/get-usage.md create mode 100644 docs/references/functions/create-build.md create mode 100644 docs/references/functions/get-function-usage.md create mode 100644 docs/references/functions/get-functions-usage.md create mode 100644 docs/references/functions/update-deployment-build.md create mode 100644 docs/references/migrations/delete-migration.md create mode 100644 docs/references/migrations/get-migration.md create mode 100644 docs/references/migrations/list-migrations.md create mode 100644 docs/references/migrations/migration-appwrite-report.md create mode 100644 docs/references/migrations/migration-appwrite.md create mode 100644 docs/references/migrations/migration-firebase-report.md create mode 100644 docs/references/migrations/migration-firebase.md create mode 100644 docs/references/migrations/migration-nhost-report.md create mode 100644 docs/references/migrations/migration-nhost.md create mode 100644 docs/references/migrations/migration-supabase-report.md create mode 100644 docs/references/migrations/migration-supabase.md create mode 100644 docs/references/migrations/retry-migration.md create mode 100644 docs/references/project/get-usage.md create mode 100644 docs/references/projects/create-jwt.md create mode 100644 docs/references/projects/create-key.md create mode 100644 docs/references/projects/create-platform.md create mode 100644 docs/references/projects/create-smtp-test.md create mode 100644 docs/references/projects/create-webhook.md create mode 100644 docs/references/projects/create.md create mode 100644 docs/references/projects/delete-email-template.md create mode 100644 docs/references/projects/delete-key.md create mode 100644 docs/references/projects/delete-platform.md create mode 100644 docs/references/projects/delete-sms-template.md create mode 100644 docs/references/projects/delete-webhook.md create mode 100644 docs/references/projects/delete.md create mode 100644 docs/references/projects/get-email-template.md create mode 100644 docs/references/projects/get-key.md create mode 100644 docs/references/projects/get-platform.md create mode 100644 docs/references/projects/get-sms-template.md create mode 100644 docs/references/projects/get-webhook.md create mode 100644 docs/references/projects/get.md create mode 100644 docs/references/projects/list-keys.md create mode 100644 docs/references/projects/list-platforms.md create mode 100644 docs/references/projects/list-webhooks.md create mode 100644 docs/references/projects/list.md create mode 100644 docs/references/projects/update-api-status-all.md create mode 100644 docs/references/projects/update-api-status.md create mode 100644 docs/references/projects/update-auth-duration.md create mode 100644 docs/references/projects/update-auth-limit.md create mode 100644 docs/references/projects/update-auth-password-dictionary.md create mode 100644 docs/references/projects/update-auth-password-history.md create mode 100644 docs/references/projects/update-auth-sessions-limit.md create mode 100644 docs/references/projects/update-auth-status.md create mode 100644 docs/references/projects/update-email-template.md create mode 100644 docs/references/projects/update-key.md create mode 100644 docs/references/projects/update-memberships-privacy.md create mode 100644 docs/references/projects/update-mock-numbers.md create mode 100644 docs/references/projects/update-oauth2.md create mode 100644 docs/references/projects/update-personal-data-check.md create mode 100644 docs/references/projects/update-platform.md create mode 100644 docs/references/projects/update-service-status-all.md create mode 100644 docs/references/projects/update-service-status.md create mode 100644 docs/references/projects/update-session-alerts.md create mode 100644 docs/references/projects/update-sms-template.md create mode 100644 docs/references/projects/update-smtp.md create mode 100644 docs/references/projects/update-team.md create mode 100644 docs/references/projects/update-webhook-signature.md create mode 100644 docs/references/projects/update-webhook.md create mode 100644 docs/references/projects/update.md create mode 100644 docs/references/proxy/update-rule-verification.md create mode 100644 docs/references/storage/get-bucket-usage.md create mode 100644 docs/references/storage/get-usage.md create mode 100644 docs/references/users/get-usage.md create mode 100644 docs/references/vcs/create-github-installation.md create mode 100644 docs/references/vcs/create-repository-detection.md create mode 100644 docs/references/vcs/create-repository.md create mode 100644 docs/references/vcs/delete-installation.md create mode 100644 docs/references/vcs/get-installation.md create mode 100644 docs/references/vcs/get-repository-contents.md create mode 100644 docs/references/vcs/get-repository.md create mode 100644 docs/references/vcs/list-installations.md create mode 100644 docs/references/vcs/list-repositories.md create mode 100644 docs/references/vcs/list-repository-branches.md create mode 100644 docs/references/vcs/update-external-deployments.md delete mode 100644 src/Appwrite/Auth/OAuth2/Firebase.php create mode 100644 src/Appwrite/Certificates/Adapter.php create mode 100644 src/Appwrite/Certificates/LetsEncrypt.php create mode 100644 src/Appwrite/Event/Realtime.php create mode 100644 src/Appwrite/Event/Webhook.php create mode 100644 src/Appwrite/PubSub/Adapter.php create mode 100644 src/Appwrite/PubSub/Adapter/Redis.php create mode 100644 src/Appwrite/SDK/AuthType.php create mode 100644 src/Appwrite/SDK/ContentType.php create mode 100644 src/Appwrite/SDK/Method.php create mode 100644 src/Appwrite/SDK/MethodType.php create mode 100644 src/Appwrite/SDK/Response.php create mode 100644 tests/e2e/General/CompressionTest.php create mode 100644 tests/e2e/Services/Migrations/MigrationsBase.php create mode 100644 tests/e2e/Services/Migrations/MigrationsConsoleClientTest.php diff --git a/.env b/.env index f6a6a7f642..8f7d7996e7 100644 --- a/.env +++ b/.env @@ -2,6 +2,7 @@ _APP_ENV=development _APP_EDITION=self-hosted _APP_LOCALE=en _APP_WORKER_PER_CORE=6 +_APP_COMPRESSION_MIN_SIZE_BYTES=1024 _APP_CONSOLE_WHITELIST_ROOT=disabled _APP_CONSOLE_WHITELIST_EMAILS= _APP_CONSOLE_SESSION_ALERTS=enabled @@ -22,6 +23,7 @@ _APP_OPENSSL_KEY_V1=your-secret-key _APP_DOMAIN=traefik _APP_DOMAIN_FUNCTIONS=functions.localhost _APP_DOMAIN_TARGET=localhost +_APP_RULES_FORMAT=md5 _APP_REDIS_HOST=redis _APP_REDIS_PORT=6379 _APP_REDIS_PASS= @@ -107,3 +109,4 @@ _APP_MESSAGE_EMAIL_TEST_DSN= _APP_MESSAGE_PUSH_TEST_DSN= _APP_WEBHOOK_MAX_FAILED_ATTEMPTS=10 _APP_PROJECT_REGIONS=default +_APP_FUNCTIONS_CREATION_ABUSE_LIMIT=5000 diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml new file mode 100644 index 0000000000..92b4f454cb --- /dev/null +++ b/.github/workflows/sdk-preview.yml @@ -0,0 +1,33 @@ +name: "Console SDK Preview" + +on: + pull_request: + paths: + - 'app/config/specs/*-latest-console.json' + + +jobs: + setup: + name: Setup & Build Console SDK + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Load and Start Appwrite + run: | + docker compose build + docker compose up -d + docker compose exec appwrite sdks --platform=console --sdk=web --version=latest --git=no + sudo chown -R $USER:$USER ./app/sdks/console-web + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build and Publish SDK + working-directory: ./app/sdks/console-web + run: | + npm install + npm run build + npx pkg-pr-new publish --comment=update diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e895b051f..a5d7487848 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -125,8 +125,14 @@ jobs: Webhooks, VCS, Messaging, - Tokens, + Migrations, + Tokens ] + tables-mode: [ + 'Project', + 'Shared V1', + 'Shared V2', + ] steps: - name: checkout @@ -145,16 +151,33 @@ jobs: docker compose up -d sleep 30 - - name: Run ${{matrix.service}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug - - - name: Run ${{matrix.service}} Shared Tables Tests - run: _APP_DATABASE_SHARED_TABLES=database_db_main docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug + - name: Run ${{ matrix.service }} tests with ${{ matrix.tables-mode }} table mode + run: | + if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then + echo "Using shared tables V1" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1=database_db_main + elif [ "${{ matrix.tables-mode }}" == "Shared V2" ]; then + echo "Using shared tables V2" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1= + else + echo "Using project tables" + export _APP_DATABASE_SHARED_TABLES= + export _APP_DATABASE_SHARED_TABLES_V1= + fi + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug benchmarking: name: Benchmark runs-on: ubuntu-latest needs: setup + permissions: + pull-requests: write steps: - name: Checkout repository uses: actions/checkout@v4 @@ -215,6 +238,7 @@ jobs: path: benchmark.json retention-days: 7 - name: Find Comment + if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/find-comment@v3 id: fc with: @@ -222,9 +246,10 @@ jobs: comment-author: 'github-actions[bot]' body-includes: Benchmark results - name: Comment on PR + if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/create-or-update-comment@v4 with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body-path: benchmark.txt - edit-mode: replace + edit-mode: replace \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5ae03e2a56..0c19fd215e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ dev/yasd_init.php .phpunit.result.cache Makefile appwrite.json +/.zed/ \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 9b6172eeab..62db3d525e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,117 @@ +# Version 1.6.1 + +## What's Changed + +### Notable changes + +* Remove JPEG fallback for webp by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8746 +* Add heic and avif support by @lohanidamodar in https://github.com/appwrite/appwrite/pull/7718 +* Add new runtimes by @Meldiron in https://github.com/appwrite/appwrite/pull/8771 +* Remove audits deletion by @shimonewman in https://github.com/appwrite/appwrite/pull/8766 +* Bump assistant by @loks0n in https://github.com/appwrite/appwrite/pull/8801 +* Change max queries values to 500 by @fogelito in https://github.com/appwrite/appwrite/pull/8802 +* Allow '.wav' as 'audio/x-wav' as well by @basert in https://github.com/appwrite/appwrite/pull/8846 +* Use 1 instead of 0.5 cpu for default function specification by @loks0n in https://github.com/appwrite/appwrite/pull/8848 +* Update function runtimes by @christyjacob4 in https://github.com/appwrite/appwrite/pull/8781 +* Add a realtime heartbeat by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/8943 + +### Fixes + +* Trigger functions event only if event is not paused by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8526 +* Update docker-compose to restart usage-dump by @feschaffa in https://github.com/appwrite/appwrite/pull/8642 +* Fix typo in scheduler base by @fogelito in https://github.com/appwrite/appwrite/pull/8691 +* Add domain and force HTTPS env vars to mail worker by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8722 +* Fix webp by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8732 +* Ignore junction tables by @fogelito in https://github.com/appwrite/appwrite/pull/8728 +* Fix logger throwing fatal error by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8724 +* Fix missing protocol for testing SMTP by @byawitz in https://github.com/appwrite/appwrite/pull/8749 +* Make create execution async loose by @loks0n in https://github.com/appwrite/appwrite/pull/8707 +* Fix invalid cursor value by @fogelito in https://github.com/appwrite/appwrite/pull/8109 +* Fix target deletes by @abnegate in https://github.com/appwrite/appwrite/pull/8833 +* Fix translation commas by @loks0n in https://github.com/appwrite/appwrite/pull/8892 +* Fix Migrations having source creds being overwritten and add Migration tests by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8897 +* Fix validator usage for updating string size by @abnegate in https://github.com/appwrite/appwrite/pull/8890 +* Fix create user event not triggering by @loks0n in https://github.com/appwrite/appwrite/pull/8718 +* Improve error handling and logging in the database worker by @fogelito in https://github.com/appwrite/appwrite/pull/8944 +* Remove inaccurate info about leaving the URL parameter empty by @ebenezerdon in https://github.com/appwrite/appwrite/pull/8963 +* Ensure indexes are updated when updating an attribute key by @fogelito in https://github.com/appwrite/appwrite/pull/8971 +* Remove duplicate dart-2.16 runtime template by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8972 +* Fix team invites with existing session by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/9006 +* Improve handling of HTTP requests by dispatching to safe workers by @Meldiron in https://github.com/appwrite/appwrite/pull/9016 +* Fix users create session secret by @stnguyen90 in https://github.com/appwrite/appwrite/pull/9019 +* Fix swoole task warning by @Meldiron in https://github.com/appwrite/appwrite/pull/9025 + +### Miscellaneous + +* Update Init copy by @adityaoberai in https://github.com/appwrite/appwrite/pull/8557 +* Fix security scan permissions and comment by @EVDOG4LIFE in https://github.com/appwrite/appwrite/pull/8525 +* Add Trivy security scans by @btme0011 in https://github.com/appwrite/appwrite/pull/6876 +* Update database stack by @abnegate in https://github.com/appwrite/appwrite/pull/8564 +* Bump database by @abnegate in https://github.com/appwrite/appwrite/pull/8573 +* Sync main with 1.5.x by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8589 +* Add AWS to one-click installs by @byawitz in https://github.com/appwrite/appwrite/pull/8593 +* Update Init copy in readme by @adityaoberai in https://github.com/appwrite/appwrite/pull/8618 +* Sync main into 1.6.x by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8685 +* Sync 1.6.x into main by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8686 +* Feat coroutines by @Meldiron in https://github.com/appwrite/appwrite/pull/7826 +* Sync main into 1.6.x by @Meldiron in https://github.com/appwrite/appwrite/pull/8719 +* Sentence casing endpoint API reference by @choir241 in https://github.com/appwrite/appwrite/pull/8617 +* DB storage metrics by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8404 +* Fix exception thrown when optional array attribute does not exist by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8391 +* Add projects channels to realtime by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/8735 +* Base for console roles support by @lohanidamodar in https://github.com/appwrite/appwrite/pull/8565 +* Remove DB disk storage calculation by @christyjacob4 in https://github.com/appwrite/appwrite/pull/8745 +* Messaging adapter default values by @shimonewman in https://github.com/appwrite/appwrite/pull/8742 +* Add payload response type by @loks0n in https://github.com/appwrite/appwrite/pull/8720 +* Fix flaky functions tests by @loks0n in https://github.com/appwrite/appwrite/pull/8682 +* Migrations Backups by @fogelito in https://github.com/appwrite/appwrite/pull/8186 +* Add test for response and request filters by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8697 +* Bump version in SECURITY.md by @EVDOG4LIFE in https://github.com/appwrite/appwrite/pull/8755 +* Add originalId attribute to databases collection by @fogelito in https://github.com/appwrite/appwrite/pull/8764 +* Fix Walter References by @ItzNotABug in https://github.com/appwrite/appwrite/pull/8757 +* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8769 +* Move new attributes by @abnegate in https://github.com/appwrite/appwrite/pull/8777 +* Add ping endpoint by @loks0n in https://github.com/appwrite/appwrite/pull/8761 +* Fix GitHub action caching by @loks0n in https://github.com/appwrite/appwrite/pull/8772 +* Chore release ruby SDK by @abnegate in https://github.com/appwrite/appwrite/pull/8767 +* Call migration success on success by @abnegate in https://github.com/appwrite/appwrite/pull/8782 +* Update utopia-php/system to 0.9.0 by @basert in https://github.com/appwrite/appwrite/pull/8780 +* Move createDocument from api to worker by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8776 +* Add missing indexes by @christyjacob4 in https://github.com/appwrite/appwrite/pull/8803 +* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8809 +* Fix typo in BLR region by @stnguyen90 in https://github.com/appwrite/appwrite/pull/8756 +* Add tests for project variables by @vermakhushboo in https://github.com/appwrite/appwrite/pull/8815 +* Replace 'Expires' with 'Cache-Control: private' header to avoid CDN caching by @basert in https://github.com/appwrite/appwrite/pull/8836 +* Allow blocking based on resource attributes by @basert in https://github.com/appwrite/appwrite/pull/8812 +* Check if resource is blocked inside functions worker by @basert in https://github.com/appwrite/appwrite/pull/8855 +* Fix missing allow attribute by @abnegate in https://github.com/appwrite/appwrite/pull/8889 +* Revert function execution order by @basert in https://github.com/appwrite/appwrite/pull/8857 +* Use resource type constants by @basert in https://github.com/appwrite/appwrite/pull/8895 +* Update Database lib by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8680 +* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8917 +* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8923 +* Update database for transaction counter fixes with retries by @abnegate in https://github.com/appwrite/appwrite/pull/8927 +* Validate string permissions by @fogelito in https://github.com/appwrite/appwrite/pull/8929 +* Add PubSub adapter support by @basert in https://github.com/appwrite/appwrite/pull/8905 +* List memberships as client by @loks0n in https://github.com/appwrite/appwrite/pull/8913 +* Fix XDebug Extension not being removed by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8891 +* Update database by @abnegate in https://github.com/appwrite/appwrite/pull/8946 +* Use utopia compression by @loks0n in https://github.com/appwrite/appwrite/pull/8938 +* Make compression minimum size configurable by @loks0n in https://github.com/appwrite/appwrite/pull/8947 +* Revert "Update database" by @christyjacob4 in https://github.com/appwrite/appwrite/pull/8949 +* Fix setpaused by @loks0n in https://github.com/appwrite/appwrite/pull/8948 +* Use getDocument instead of find() for rules by @christyjacob4 in https://github.com/appwrite/appwrite/pull/8951 +* Remove double fetch from migrations worker by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8956 +* Fix memberships privacy MFA by @loks0n in https://github.com/appwrite/appwrite/pull/8969 +* Add telemetry by @basert in https://github.com/appwrite/appwrite/pull/8960 +* Send migration errors individually by @PineappleIOnic in https://github.com/appwrite/appwrite/pull/8959 +* Add console sdk previews by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/8990 +* Unset index length by @fogelito in https://github.com/appwrite/appwrite/pull/8978 +* Update base to 0.9.5 by @basert in https://github.com/appwrite/appwrite/pull/9005 +* Sync main into 1.6.x by @TorstenDittmann in https://github.com/appwrite/appwrite/pull/9011 +* Improved shared tables V2 by @abnegate in https://github.com/appwrite/appwrite/pull/9013 +* Ensure backwards compatibility for 1.6.x by @christyjacob4 in https://github.com/appwrite/appwrite/pull/9018 + # Version 1.6.0 ## What's Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b92361e51a..e89aa369cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -613,6 +613,18 @@ If you need to clear the cache, you can do so by running the following command: docker compose exec redis redis-cli FLUSHALL ``` +## Using preview domains locally + +Appwrite Functions are automatically given a domain you can visit to execute the function. This domain has format `[SOMETHING].functions.localhost` unless you changed `_APP_DOMAIN_FUNCTIONS` environment variable. This default value works great when running Appwrite locally, but it can be impossible to use preview domains with Cloud woekspaces such as Gitpod or GitHub Codespaces. + +To use preview domains on Cloud workspaces, you can visit hostname provided by them, and supply function's preview domain as URL parameter: + +``` +https://8080-appwrite-appwrite-mjeb3ebilwv.ws-eu116.gitpod.io/ping?preview=672b3c7eab1ac523ccf5.functions.localhost +``` + +The path was set to `/ping` intentionally. Visiting `/` for preview domains might trigger Console background worker, and trigger redirect to Console without our preview URL param. Visiting different path ensures this doesnt happen. + ## Tutorials From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials: diff --git a/Dockerfile b/Dockerfile index 13b018df0f..41810f5dc4 100755 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN composer install --ignore-platform-reqs --optimize-autoloader \ --no-plugins --no-scripts --prefer-dist \ `if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` -FROM appwrite/base:0.9.3 AS final +FROM appwrite/base:0.9.5 AS final LABEL maintainer="team@appwrite.io" @@ -92,10 +92,10 @@ RUN chmod +x /usr/local/bin/doctor && \ RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ # Enable Extensions -RUN if [ "$DEBUG" == "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi -RUN if [ "$DEBUG" == "true" ]; then mkdir -p /tmp/xdebug; fi +RUN if [ "$DEBUG" = "true" ]; then cp /usr/src/code/dev/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini; fi +RUN if [ "$DEBUG" = "true" ]; then mkdir -p /tmp/xdebug; fi RUN if [ "$DEBUG" = "false" ]; then rm -rf /usr/src/code/dev; fi -RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so; fi +RUN if [ "$DEBUG" = "false" ]; then rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so; fi EXPOSE 80 diff --git a/README-CN.md b/README-CN.md index a5eac1be03..92a9bf9806 100644 --- a/README-CN.md +++ b/README-CN.md @@ -67,7 +67,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` ### Windows @@ -79,7 +79,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` #### PowerShell @@ -89,7 +89,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index a9856a7310..ab57e65c4c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ docker run -it --rm \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \ --entrypoint="install" \ - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` ### Windows @@ -87,7 +87,7 @@ docker run -it --rm ^ --volume //var/run/docker.sock:/var/run/docker.sock ^ --volume "%cd%"/appwrite:/usr/src/code/appwrite:rw ^ --entrypoint="install" ^ - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` #### PowerShell @@ -97,7 +97,7 @@ docker run -it --rm ` --volume /var/run/docker.sock:/var/run/docker.sock ` --volume ${pwd}/appwrite:/usr/src/code/appwrite:rw ` --entrypoint="install" ` - appwrite/appwrite:1.6.0 + appwrite/appwrite:1.6.1 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/SECURITY.md b/SECURITY.md index a17a55e368..d5901533fb 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,6 +11,7 @@ | 1.3.x | :white_check_mark: | | 1.4.x | :white_check_mark: | | 1.5.x | :white_check_mark: | +| 1.6.x | :white_check_mark: | ## Reporting a Vulnerability diff --git a/app/cli.php b/app/cli.php index 23502ec402..47f4525f0b 100644 --- a/app/cli.php +++ b/app/cli.php @@ -52,7 +52,7 @@ CLI::setResource('pools', function (Registry $register) { return $register->get('pools'); }, ['register']); -CLI::setResource('dbForConsole', function ($pools, $cache) { +CLI::setResource('dbForPlatform', function ($pools, $cache) { $sleep = 3; $maxAttempts = 5; $attempts = 0; @@ -67,9 +67,9 @@ CLI::setResource('dbForConsole', function ($pools, $cache) { ->pop() ->getResource(); - $dbForConsole = new Database($dbAdapter, $cache); + $dbForPlatform = new Database($dbAdapter, $cache); - $dbForConsole + $dbForPlatform ->setNamespace('_console') ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console'); @@ -78,7 +78,7 @@ CLI::setResource('dbForConsole', function ($pools, $cache) { $collections = Config::getParam('collections', [])['console']; $last = \array_key_last($collections); - if (!($dbForConsole->exists($dbForConsole->getDatabase(), $last))) { /** TODO cache ready variable using registry */ + if (!($dbForPlatform->exists($dbForPlatform->getDatabase(), $last))) { /** TODO cache ready variable using registry */ throw new Exception('Tables not ready yet.'); } @@ -94,15 +94,15 @@ CLI::setResource('dbForConsole', function ($pools, $cache) { throw new Exception("Console is not ready yet. Please try again later."); } - return $dbForConsole; + return $dbForPlatform; }, ['pools', 'cache']); -CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, $cache) { +CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { $databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools - return function (Document $project) use ($pools, $dbForConsole, $cache, &$databases) { + return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) { if ($project->isEmpty() || $project->getId() === 'console') { - return $dbForConsole; + return $dbForPlatform; } try { @@ -114,8 +114,9 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, if (isset($databases[$dsn->getHost()])) { $database = $databases[$dsn->getHost()]; + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -136,10 +137,10 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, ->getResource(); $database = new Database($dbAdapter, $cache); - $databases[$dsn->getHost()] = $database; + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -157,7 +158,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, return $database; }; -}, ['pools', 'dbForConsole', 'cache']); +}, ['pools', 'dbForPlatform', 'cache']); CLI::setResource('queue', function (Group $pools) { return $pools->get('queue')->pop()->getResource(); @@ -180,7 +181,7 @@ CLI::setResource('logError', function (Registry $register) { $log = new Log(); $log->setNamespace($namespace); - $log->setServer(\gethostname()); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); $log->setVersion($version); $log->setType(Log::TYPE_ERROR); $log->setMessage($error->getMessage()); diff --git a/app/config/collections.php b/app/config/collections.php index 1379757b85..8c8356aafd 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1,12 +1,17 @@ $common['files']]; + +// no more required. +unset($common['files']); /** * $collection => id of the parent collection where this will be inserted @@ -17,6232 +22,11 @@ $auth = Config::getParam('auth', []); * indexes => list of indexes */ -$commonCollections = [ - 'cache' => [ - '$collection' => Database::METADATA, - '$id' => 'cache', - 'name' => 'Cache', - 'attributes' => [ - [ - '$id' => 'resource', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'resourceType', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('mimeType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'accessedAt', - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => 'signature', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => '_key_accessedAt', - 'type' => Database::INDEX_KEY, - 'attributes' => ['accessedAt'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => '_key_resource', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resource'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'users' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('users'), - 'name' => 'Users', - 'attributes' => [ - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('email'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 320, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('phone'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16, // leading '+' and 15 digitts maximum by E.164 format - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('labels'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('passwordHistory'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('password'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => 'hash', // Hashing algorithm used to hash the password - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => Auth::DEFAULT_ALGO, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('hashOptions'), // Configuration of hashing algorithm - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => Auth::DEFAULT_ALGO_OPTIONS, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('passwordUpdate'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('prefs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => new \stdClass(), - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('registration'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('emailVerification'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('phoneVerification'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('reset'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('mfa'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('mfaRecoveryCodes'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('authenticators'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryAuthenticators'], - ], - [ - '$id' => ID::custom('sessions'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQuerySessions'], - ], - [ - '$id' => ID::custom('tokens'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryTokens'], - ], - [ - '$id' => ID::custom('challenges'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryChallenges'], - ], - [ - '$id' => ID::custom('memberships'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryMemberships'], - ], - [ - '$id' => ID::custom('targets'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryTargets'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['userSearch'], - ], - [ - '$id' => ID::custom('accessedAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_email'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['email'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_phone'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['phone'], - 'lengths' => [16], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_status'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['status'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_passwordUpdate'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['passwordUpdate'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_registration'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['registration'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_emailVerification'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['emailVerification'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_phoneVerification'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['phoneVerification'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => '_key_accessedAt', - 'type' => Database::INDEX_KEY, - 'attributes' => ['accessedAt'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'tokens' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('tokens'), - 'name' => 'Tokens', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('expire'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('userAgent'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('ip'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 45, // https://stackoverflow.com/a/166157/2299554 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_user'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'authenticators' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('authenticators'), - 'name' => 'Authenticators', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('verified'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => false, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('data'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_userInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'challenges' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('challenges'), - 'name' => 'Challenges', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('token'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], [ - '$id' => ID::custom('code'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], [ - '$id' => ID::custom('expire'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_user'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'sessions' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('sessions'), - 'name' => 'Sessions', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('provider'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerUid'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerAccessToken'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('providerAccessTokenExpiry'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('providerRefreshToken'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('userAgent'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('ip'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 45, // https://stackoverflow.com/a/166157/2299554 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('countryCode'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('osCode'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('osName'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('osVersion'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientCode'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientName'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientVersion'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientEngine'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('clientEngineVersion'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deviceName'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deviceBrand'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deviceModel'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('factors'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('expire'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('mfaUpdatedAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_provider_providerUid'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['provider', 'providerUid'], - 'lengths' => [128, 128], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_user'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'identities' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('identities'), - 'name' => 'Identities', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('provider'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerUid'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerEmail'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 320, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerAccessToken'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('providerAccessTokenExpiry'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('providerRefreshToken'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - // Used to store data from provider that may or may not be sensitive - '$id' => ID::custom('secrets'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_userInternalId_provider_providerUid'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['userInternalId', 'provider', 'providerUid'], - 'lengths' => [11, 128, 128], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_provider_providerUid'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['provider', 'providerUid'], - 'lengths' => [128, 128], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_userId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_userInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_provider'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['provider'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerUid'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerUid'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerEmail'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerEmail'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerAccessTokenExpiry'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerAccessTokenExpiry'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'teams' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('teams'), - 'name' => 'Teams', - 'attributes' => [ - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('total'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('prefs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => new \stdClass(), - 'array' => false, - 'filters' => ['json'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_total'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['total'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'memberships' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('memberships'), - 'name' => 'Memberships', - 'attributes' => [ - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('teamInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('teamId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('roles'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('invited'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('joined'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('confirm'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_unique'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['teamInternalId', 'userInternalId'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_user'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_team'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['teamInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_userId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_teamId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['teamId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_invited'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['invited'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_joined'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['joined'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_confirm'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['confirm'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'buckets' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('buckets'), - 'name' => 'Buckets', - 'attributes' => [ - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => 128, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('fileSecurity'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 1, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('maximumFileSize'), - 'type' => Database::VAR_INTEGER, - 'signed' => false, - 'size' => 8, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('allowedFileExtensions'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => 64, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => true, - ], - [ - '$id' => 'compression', - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => 10, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('encryption'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('antivirus'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_fulltext_name'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['name'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_enabled'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_fileSecurity'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['fileSecurity'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_maximumFileSize'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['maximumFileSize'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_encryption'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['encryption'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_antivirus'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['antivirus'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ] - ], - - 'stats' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('stats'), - 'name' => 'Stats', - 'attributes' => [ - [ - '$id' => ID::custom('metric'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('region'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('value'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 8, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('time'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('period'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 4, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_time'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['time'], - 'lengths' => [], - 'orders' => [Database::ORDER_DESC], - ], - [ - '$id' => ID::custom('_key_period_time'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['period', 'time'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_metric_period_time'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['metric', 'period', 'time'], - 'lengths' => [], - 'orders' => [Database::ORDER_DESC], - ], - ], - ], - - 'providers' => [ - '$collection' => ID::custom(DATABASE::METADATA), - '$id' => ID::custom('providers'), - 'name' => 'Providers', - 'attributes' => [ - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('provider'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'default' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('credentials'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - [ - '$id' => ID::custom('options'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => ['providerSearch'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_provider'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['provider'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['name'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_type'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['type'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_enabled_type'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled', 'type'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ] - ], - ], - - 'messages' => [ - '$collection' => ID::custom(DATABASE::METADATA), - '$id' => ID::custom('messages'), - 'name' => 'Messages', - 'attributes' => [ - [ - '$id' => ID::custom('providerType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => 'processing', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('data'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('topics'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 21845, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('users'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 21845, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('targets'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 21845, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduledAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('scheduleInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduleId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deliveredAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('deliveryErrors'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('deliveredTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => ['messageSearch'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'topics' => [ - '$collection' => ID::custom(DATABASE::METADATA), - '$id' => ID::custom('topics'), - 'name' => 'Topics', - 'attributes' => [ - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('subscribe'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('emailTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('smsTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('pushTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('targets'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryTopicTargets'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => ['topicSearch'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['name'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'subscribers' => [ - '$collection' => ID::custom(DATABASE::METADATA), - '$id' => ID::custom('subscribers'), - 'name' => 'Subscribers', - 'attributes' => [ - [ - '$id' => ID::custom('targetId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('targetInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('topicId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('topicInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_targetId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['targetId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_targetInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['targetInternalId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_userId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_userInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_topicId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['topicId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_topicInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['topicInternalId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_unique_target_topic'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['targetInternalId', 'topicInternalId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'targets' => [ - '$collection' => ID::custom(DATABASE::METADATA), - '$id' => ID::custom('targets'), - 'name' => 'Targets', - 'attributes' => [ - [ - '$id' => ID::custom('userId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('userInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('sessionId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('sessionInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('identifier'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('expired'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => false, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_userId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userId'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_userInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['userInternalId'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_providerInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerInternalId'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_identifier'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['identifier'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], -]; - -$projectCollections = array_merge([ - 'databases' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('databases'), - 'name' => 'Databases', - 'attributes' => [ - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'size' => 256, - 'required' => true, - 'signed' => true, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('originalId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => null, - 'array' => false, - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'attributes' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('attributes'), - 'name' => 'Attributes', - 'attributes' => [ - [ - '$id' => ID::custom('databaseInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('databaseId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => false, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('collectionInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('collectionId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('key'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('error'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('size'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('required'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('default'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['casting'], - ], - [ - '$id' => ID::custom('signed'), - 'type' => Database::VAR_BOOLEAN, - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('array'), - 'type' => Database::VAR_BOOLEAN, - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('format'), - 'type' => Database::VAR_STRING, - 'size' => 64, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('formatOptions'), - 'type' => Database::VAR_STRING, - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => new stdClass(), - 'array' => false, - 'filters' => ['json', 'range', 'enum'], - ], - [ - '$id' => ID::custom('filters'), - 'type' => Database::VAR_STRING, - 'size' => 64, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('options'), - 'type' => Database::VAR_STRING, - 'size' => 16384, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_db_collection'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['databaseInternalId', 'collectionInternalId'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - ], - ], - - 'indexes' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('indexes'), - 'name' => 'Indexes', - 'attributes' => [ - [ - '$id' => ID::custom('databaseInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('databaseId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => false, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('collectionInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('collectionId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('key'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('error'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('attributes'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('lengths'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('orders'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 4, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_db_collection'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['databaseInternalId', 'collectionInternalId'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - ], - ], - - 'functions' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('functions'), - 'name' => 'Functions', - 'attributes' => [ - [ - '$id' => ID::custom('execute'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('live'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('installationId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('installationInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerRepositoryId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('repositoryId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('repositoryInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerBranch'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerRootDirectory'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerSilentMode'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('logging'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('runtime'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deployment'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('vars'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryVariables'], - ], - [ - '$id' => ID::custom('varsProject'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryProjectVariables'], - ], - [ - '$id' => ID::custom('events'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduleInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduleId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('schedule'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('timeout'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('version'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 8, - 'signed' => true, - 'required' => false, - 'default' => 'v4', - 'array' => false, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('entrypoint'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('commands'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('specification'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => false, - 'required' => false, - 'default' => APP_FUNCTION_SPECIFICATION_DEFAULT, - 'filters' => [], - ], - [ - '$id' => ID::custom('scopes'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_enabled'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_installationId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_installationInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerRepositoryId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerRepositoryId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_repositoryId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['repositoryId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_repositoryInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['repositoryInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_runtime'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['runtime'], - 'lengths' => [64], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_deployment'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['deployment'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'deployments' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('deployments'), - 'name' => 'Deployments', - 'attributes' => [ - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('buildInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('buildId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('entrypoint'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('commands'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - '$id' => ID::custom('path'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('installationId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('installationInternalId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerRepositoryId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('repositoryId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('repositoryInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerRepositoryName'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerRepositoryOwner'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerRepositoryUrl'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommitHash'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommitAuthorUrl'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommitAuthor'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommitMessage'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommitUrl'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerBranch'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerBranchUrl'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerRootDirectory'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('providerCommentId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => 2048, - 'format' => '', - 'filters' => [], - 'required' => false, - 'array' => false, - ], - [ - '$id' => ID::custom('size'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('metadata'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, // https://tools.ietf.org/html/rfc4288#section-4.2 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('chunksTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('chunksUploaded'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('activate'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => false, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_resource'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_resource_type'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_size'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['size'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_buildId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['buildId'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_activate'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['activate'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'builds' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('builds'), - 'name' => 'Builds', - 'attributes' => [ - [ - '$id' => ID::custom('startTime'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('endTime'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('duration'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('size'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('runtime'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => true, - 'default' => 'processing', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('path'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('logs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('sourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => 'local', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('source'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => true, - 'default' => '', - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_deployment'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['deploymentId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'executions' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('executions'), - 'name' => 'Executions', - 'attributes' => [ - [ - '$id' => ID::custom('functionInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('functionId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('deploymentId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('trigger'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('duration'), - 'type' => Database::VAR_FLOAT, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('errors'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('logs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('requestMethod'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('requestPath'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - '$id' => ID::custom('requestHeaders'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('responseStatusCode'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('responseHeaders'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduledAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('scheduleInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('scheduleId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_function'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['functionId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_trigger'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['trigger'], - 'lengths' => [32], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_status'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['status'], - 'lengths' => [32], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_requestMethod'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['requestMethod'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_requestPath'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['requestPath'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_deployment'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['deploymentId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_responseStatusCode'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['responseStatusCode'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_duration'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['duration'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'variables' => [ - '$collection' => Database::METADATA, - '$id' => 'variables', - 'name' => 'variables', - 'attributes' => [ - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'key', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'value', - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 8192, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'] - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => false, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => '_key_resourceInternalId', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [], - ], - [ - '$id' => '_key_resourceType', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resourceId_resourceType', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId', 'resourceType'], - 'lengths' => [Database::LENGTH_KEY, 100], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => '_key_uniqueKey', - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['resourceId', 'key', 'resourceType'], - 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY, 100], - 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC, Database::ORDER_ASC], - ], - [ - '$id' => '_key_key', - 'type' => Database::INDEX_KEY, - 'attributes' => ['key'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'migrations' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('migrations'), - 'name' => 'Migrations', - 'attributes' => [ - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('stage'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('source'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 8192, // reduce size - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('destination'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, // make true after patch script - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('credentials'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65536, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - [ - '$id' => ID::custom('resources'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => [], - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('statusCounters'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 3000, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('resourceData'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 131070, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('errors'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => '_key_status', - 'type' => Database::INDEX_KEY, - 'attributes' => ['status'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_stage', - 'type' => Database::INDEX_KEY, - 'attributes' => ['stage'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_source', - 'type' => Database::INDEX_KEY, - 'attributes' => ['source'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ] - ], - ], - - 'resourceTokens' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('resourceTokens'), - 'name' => 'Resource Tokens', - 'attributes' => [ - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('expire'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => '_key_expiry_date', - 'type' => Database::INDEX_KEY, - 'attributes' => ['expire'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - - ], - ], -], $commonCollections); - -$consoleCollections = array_merge([ - 'projects' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('projects'), - 'name' => 'Projects', - 'attributes' => [ - [ - '$id' => ID::custom('teamInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('teamId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('region'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('description'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('database'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('logo'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('url'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('version'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalName'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalCountry'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalState'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalCity'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalAddress'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('legalTaxId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => 'accessedAt', - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('services'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('apis'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('smtp'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - [ - '$id' => ID::custom('templates'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, // TODO make sure size fits - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('auths'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('oAuthProviders'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => [], - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - [ - '$id' => ID::custom('platforms'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryPlatforms'], - ], - [ - '$id' => ID::custom('webhooks'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryWebhooks'], - ], - [ - '$id' => ID::custom('keys'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['subQueryKeys'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('pingCount'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('pingedAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_team'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['teamId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_pingCount'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['pingCount'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_pingedAt'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['pingedAt'], - 'lengths' => [], - 'orders' => [], - ] - ], - ], - - 'schedules' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('schedules'), - 'name' => 'schedules', - 'attributes' => [ - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceUpdatedAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('schedule'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('data'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 65535, - 'signed' => true, - 'required' => false, - 'default' => new \stdClass(), - 'array' => false, - 'filters' => ['json', 'encrypt'], - ], - [ - '$id' => ID::custom('active'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => null, - 'array' => false, - ], - [ - '$id' => ID::custom('region'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 10, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_region_resourceType_resourceUpdatedAt'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['region', 'resourceType', 'resourceUpdatedAt'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_region_resourceType_projectId_resourceId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['region', 'resourceType', 'projectId', 'resourceId'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'platforms' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('platforms'), - 'name' => 'platforms', - 'attributes' => [ - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('type'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('key'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('store'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('hostname'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_project'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'keys' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('keys'), - 'name' => 'keys', - 'attributes' => [ - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('scopes'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('secret'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 512, // var_dump of \bin2hex(\random_bytes(128)) => string(256) doubling for encryption - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('expire'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('accessedAt'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('sdks'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_project'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_accessedAt', - 'type' => Database::INDEX_KEY, - 'attributes' => ['accessedAt'], - 'lengths' => [], - 'orders' => [], - ], - ], - ], - - 'webhooks' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('webhooks'), - 'name' => 'webhooks', - 'attributes' => [ - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('url'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('httpUser'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('httpPass'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, // TODO will the length suffice after encryption? - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['encrypt'], - ], - [ - '$id' => ID::custom('security'), - 'type' => Database::VAR_BOOLEAN, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('events'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - [ - '$id' => ID::custom('signatureKey'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => true, - 'array' => false, - ], - [ - '$id' => ID::custom('logs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => '', - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('attempts'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => 0, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_project'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'certificates' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('certificates'), - 'name' => 'Certificates', - 'attributes' => [ - [ - '$id' => ID::custom('domain'), - 'type' => Database::VAR_STRING, - 'format' => '', - // The maximum total length of a domain name or number is 255 characters. - // https://datatracker.ietf.org/doc/html/rfc2821#section-4.5.3.1 - // https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.2 - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('issueDate'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('renewDate'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('attempts'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('logs'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 1000000, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('updated'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_domain'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['domain'], - 'lengths' => [255], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'realtime' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('realtime'), - 'name' => 'Realtime Connections', - 'attributes' => [ - [ - '$id' => ID::custom('container'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('timestamp'), - 'type' => Database::VAR_DATETIME, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['datetime'], - ], - [ - '$id' => ID::custom('value'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], //TODO: use json filter - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_timestamp'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['timestamp'], - 'lengths' => [], - 'orders' => [Database::ORDER_DESC], - ], - ] - ], - - 'rules' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('rules'), - 'name' => 'Rules', - 'attributes' => [ - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('domain'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 100, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('certificateId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ] - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_domain'), - 'type' => Database::INDEX_UNIQUE, - 'attributes' => ['domain'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resourceInternalId', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resourceId', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resourceType', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'installations' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('installations'), - 'name' => 'installations', - 'attributes' => [ - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerInstallationId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('organization'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('provider'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('personal'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => false, - 'default' => false, - 'array' => false, - ], - ], - 'indexes' => [ - - [ - '$id' => ID::custom('_key_projectInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerInstallationId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerInstallationId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'repositories' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('repositories'), - 'name' => 'repositories', - 'attributes' => [ - [ - '$id' => ID::custom('installationId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('installationInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerRepositoryId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('resourceId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('resourceType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('providerPullRequestIds'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 128, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => true, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_installationId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_installationInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerRepositoryId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerRepositoryId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_resourceId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => '_key_resourceInternalId', - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_resourceType'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ] - ], - ], - - 'vcsComments' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('vcsComments'), - 'name' => 'vcsComments', - 'attributes' => [ - [ - '$id' => ID::custom('installationId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('installationInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('projectId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('projectInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('providerRepositoryId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('providerCommentId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('providerPullRequestId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - [ - '$id' => ID::custom('providerBranch'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [] - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_installationId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_installationInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['installationInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectInternalId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectInternalId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_projectId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['projectId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerRepositoryId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerRepositoryId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerPullRequestId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerPullRequestId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_providerBranch'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['providerBranch'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - ], - ], - - 'vcsCommentLocks' => [ - '$collection' => ID::custom(Database::METADATA), - '$id' => ID::custom('vcsCommentLocks'), - 'name' => 'vcsCommentLocks', - 'attributes' => [], - 'indexes' => [] - ], -], $commonCollections); - -$bucketCollections = [ - 'files' => [ - '$collection' => ID::custom('buckets'), - '$id' => ID::custom('files'), - '$name' => 'Files', - 'attributes' => [ - [ - 'array' => false, - '$id' => ID::custom('bucketId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => false, - 'default' => null, - 'filters' => [], - ], - [ - 'array' => false, - '$id' => ID::custom('bucketInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'filters' => [], - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('path'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('signature'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('mimeType'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('metadata'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 75000, // https://tools.ietf.org/html/rfc4288#section-4.2 - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => ['json'], - ], - [ - '$id' => ID::custom('sizeOriginal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 8, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('sizeActual'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 8, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('algorithm'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 255, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('comment'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('openSSLVersion'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 64, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('openSSLCipher'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 64, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('openSSLTag'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('openSSLIV'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 2048, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('chunksTotal'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('chunksUploaded'), - 'type' => Database::VAR_INTEGER, - 'format' => '', - 'size' => 0, - 'signed' => false, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_bucket'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['bucketId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_signature'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['signature'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_mimeType'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['mimeType'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_sizeOriginal'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['sizeOriginal'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_chunksTotal'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['chunksTotal'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_chunksUploaded'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['chunksUploaded'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ] - ], -]; - -$dbCollections = [ - 'collections' => [ - '$collection' => ID::custom('databases'), - '$id' => ID::custom('collections'), - 'name' => 'Collections', - 'attributes' => [ - [ - '$id' => ID::custom('databaseInternalId'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => Database::LENGTH_KEY, - 'signed' => true, - 'required' => true, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('databaseId'), - 'type' => Database::VAR_STRING, - 'signed' => true, - 'size' => Database::LENGTH_KEY, - 'format' => '', - 'filters' => [], - 'required' => true, - 'default' => null, - 'array' => false, - ], - [ - '$id' => ID::custom('name'), - 'type' => Database::VAR_STRING, - 'size' => 256, - 'required' => true, - 'signed' => true, - 'array' => false, - 'filters' => [], - ], - [ - '$id' => ID::custom('enabled'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'default' => null, - 'array' => false, - ], - [ - '$id' => ID::custom('documentSecurity'), - 'type' => Database::VAR_BOOLEAN, - 'signed' => true, - 'size' => 0, - 'format' => '', - 'filters' => [], - 'required' => true, - 'default' => null, - 'array' => false, - ], - [ - '$id' => ID::custom('attributes'), - 'type' => Database::VAR_STRING, - 'size' => 1000000, - 'required' => false, - 'signed' => true, - 'array' => false, - 'filters' => ['subQueryAttributes'], - ], - [ - '$id' => ID::custom('indexes'), - 'type' => Database::VAR_STRING, - 'size' => 1000000, - 'required' => false, - 'signed' => true, - 'array' => false, - 'filters' => ['subQueryIndexes'], - ], - [ - '$id' => ID::custom('search'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 16384, - 'signed' => true, - 'required' => false, - 'default' => null, - 'array' => false, - 'filters' => [], - ], - ], - 'indexes' => [ - [ - '$id' => ID::custom('_fulltext_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [256], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_enabled'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_documentSecurity'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['documentSecurity'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - ], - ] -]; - - $collections = [ - 'projects' => $projectCollections, - 'console' => $consoleCollections, - 'buckets' => $bucketCollections, - 'databases' => $dbCollections + 'buckets' => $buckets, + 'databases' => $databases, + 'projects' => array_merge($projects, $common), + 'console' => array_merge($platform, $common), ]; return $collections; diff --git a/app/config/collections/common.php b/app/config/collections/common.php new file mode 100644 index 0000000000..f68400e226 --- /dev/null +++ b/app/config/collections/common.php @@ -0,0 +1,2640 @@ + [ + '$collection' => Database::METADATA, + '$id' => 'cache', + 'name' => 'Cache', + 'attributes' => [ + [ + '$id' => 'resource', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'resourceType', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('mimeType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'accessedAt', + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => 'signature', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => '_key_resource', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resource'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'users' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('users'), + 'name' => 'Users', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('email'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 320, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('phone'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, // leading '+' and 15 digitts maximum by E.164 format + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('labels'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('passwordHistory'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('password'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => 'hash', // Hashing algorithm used to hash the password + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => Auth::DEFAULT_ALGO, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('hashOptions'), // Configuration of hashing algorithm + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => Auth::DEFAULT_ALGO_OPTIONS, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('passwordUpdate'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('prefs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => new \stdClass(), + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('registration'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('emailVerification'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('phoneVerification'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('reset'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('mfa'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('mfaRecoveryCodes'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('authenticators'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryAuthenticators'], + ], + [ + '$id' => ID::custom('sessions'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQuerySessions'], + ], + [ + '$id' => ID::custom('tokens'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryTokens'], + ], + [ + '$id' => ID::custom('challenges'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryChallenges'], + ], + [ + '$id' => ID::custom('memberships'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryMemberships'], + ], + [ + '$id' => ID::custom('targets'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryTargets'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['userSearch'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_email'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['email'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_phone'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['phone'], + 'lengths' => [16], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_status'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['status'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_passwordUpdate'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['passwordUpdate'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_registration'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['registration'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_emailVerification'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['emailVerification'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_phoneVerification'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['phoneVerification'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'tokens' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('tokens'), + 'name' => 'Tokens', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('userAgent'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('ip'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 45, // https://stackoverflow.com/a/166157/2299554 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_user'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'authenticators' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('authenticators'), + 'name' => 'Authenticators', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('verified'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => false, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('data'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_userInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'challenges' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('challenges'), + 'name' => 'Challenges', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('token'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], [ + '$id' => ID::custom('code'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_user'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'sessions' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('sessions'), + 'name' => 'Sessions', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('provider'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerUid'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerAccessToken'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('providerAccessTokenExpiry'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('providerRefreshToken'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // https://www.tutorialspoint.com/how-long-is-the-sha256-hash-in-mysql (512 for encryption) + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('userAgent'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('ip'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 45, // https://stackoverflow.com/a/166157/2299554 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('countryCode'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('osCode'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('osName'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('osVersion'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientCode'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientName'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientVersion'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientEngine'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('clientEngineVersion'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deviceName'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deviceBrand'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deviceModel'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('factors'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('mfaUpdatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_provider_providerUid'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['provider', 'providerUid'], + 'lengths' => [128, 128], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_user'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'identities' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('identities'), + 'name' => 'Identities', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('provider'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerUid'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerEmail'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 320, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerAccessToken'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('providerAccessTokenExpiry'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('providerRefreshToken'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + // Used to store data from provider that may or may not be sensitive + '$id' => ID::custom('secrets'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_userInternalId_provider_providerUid'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['userInternalId', 'provider', 'providerUid'], + 'lengths' => [11, 128, 128], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_provider_providerUid'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['provider', 'providerUid'], + 'lengths' => [128, 128], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_userId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_userInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_provider'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['provider'], + 'lengths' => [128], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerUid'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerUid'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerEmail'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerEmail'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerAccessTokenExpiry'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerAccessTokenExpiry'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'teams' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('teams'), + 'name' => 'Teams', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('total'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('prefs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => new \stdClass(), + 'array' => false, + 'filters' => ['json'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [128], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_total'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['total'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'memberships' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('memberships'), + 'name' => 'Memberships', + 'attributes' => [ + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('teamInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('teamId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('roles'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('invited'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('joined'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('confirm'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_unique'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['teamInternalId', 'userInternalId'], + 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_user'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_team'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['teamInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_userId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_teamId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['teamId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_invited'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['invited'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_joined'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['joined'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_confirm'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['confirm'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'buckets' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('buckets'), + 'name' => 'Buckets', + 'attributes' => [ + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => 128, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('fileSecurity'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 1, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('maximumFileSize'), + 'type' => Database::VAR_INTEGER, + 'signed' => false, + 'size' => 8, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('allowedFileExtensions'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => 64, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => true, + ], + [ + '$id' => 'compression', + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => 10, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('encryption'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('antivirus'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_fulltext_name'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['name'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_enabled'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['enabled'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_fileSecurity'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['fileSecurity'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_maximumFileSize'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['maximumFileSize'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_encryption'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['encryption'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_antivirus'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['antivirus'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ] + ], + + 'stats' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('stats'), + 'name' => 'Stats', + 'attributes' => [ + [ + '$id' => ID::custom('metric'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('region'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('value'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 8, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('time'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('period'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 4, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_time'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['time'], + 'lengths' => [], + 'orders' => [Database::ORDER_DESC], + ], + [ + '$id' => ID::custom('_key_period_time'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['period', 'time'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_metric_period_time'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['metric', 'period', 'time'], + 'lengths' => [], + 'orders' => [Database::ORDER_DESC], + ], + ], + ], + + 'providers' => [ + '$collection' => ID::custom(DATABASE::METADATA), + '$id' => ID::custom('providers'), + 'name' => 'Providers', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('provider'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'default' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('credentials'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + [ + '$id' => ID::custom('options'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => ['providerSearch'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_provider'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['provider'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['name'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_type'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['type'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_enabled_type'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['enabled', 'type'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ] + ], + ], + + 'messages' => [ + '$collection' => ID::custom(DATABASE::METADATA), + '$id' => ID::custom('messages'), + 'name' => 'Messages', + 'attributes' => [ + [ + '$id' => ID::custom('providerType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => 'processing', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('data'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('topics'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 21845, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('users'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 21845, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('targets'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 21845, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduledAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('scheduleInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduleId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deliveredAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('deliveryErrors'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('deliveredTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => ['messageSearch'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'topics' => [ + '$collection' => ID::custom(DATABASE::METADATA), + '$id' => ID::custom('topics'), + 'name' => 'Topics', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('subscribe'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('emailTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('smsTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('pushTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('targets'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryTopicTargets'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => ['topicSearch'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['name'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'subscribers' => [ + '$collection' => ID::custom(DATABASE::METADATA), + '$id' => ID::custom('subscribers'), + 'name' => 'Subscribers', + 'attributes' => [ + [ + '$id' => ID::custom('targetId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('targetInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('topicId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('topicInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_targetId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['targetId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_targetInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['targetInternalId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_userId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_userInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_topicId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['topicId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_topicInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['topicInternalId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_unique_target_topic'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['targetInternalId', 'topicInternalId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'targets' => [ + '$collection' => ID::custom(DATABASE::METADATA), + '$id' => ID::custom('targets'), + 'name' => 'Targets', + 'attributes' => [ + [ + '$id' => ID::custom('userId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('userInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('sessionId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('sessionInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('identifier'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('expired'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => false, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_userId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userId'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_userInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['userInternalId'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_providerInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerInternalId'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_identifier'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['identifier'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + // note that this is not required for console & projects. + 'files' => [ + '$collection' => ID::custom('buckets'), + '$id' => ID::custom('files'), + '$name' => 'Files', + 'attributes' => [ + [ + 'array' => false, + '$id' => ID::custom('bucketId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('bucketInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('path'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('signature'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('mimeType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('metadata'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 75000, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('sizeOriginal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 8, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('sizeActual'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 8, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('algorithm'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('comment'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('openSSLVersion'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 64, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('openSSLCipher'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 64, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('openSSLTag'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('openSSLIV'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('chunksTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('chunksUploaded'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'transformedAt', + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_bucket'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['bucketId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_signature'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['signature'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_mimeType'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['mimeType'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_sizeOriginal'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['sizeOriginal'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_chunksTotal'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['chunksTotal'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_chunksUploaded'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['chunksUploaded'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_transformedAt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['transformedAt'], + 'lengths' => [], + 'orders' => [], + ] + ] + ], +]; diff --git a/app/config/collections/databases.php b/app/config/collections/databases.php new file mode 100644 index 0000000000..995caecb7f --- /dev/null +++ b/app/config/collections/databases.php @@ -0,0 +1,126 @@ + [ + '$collection' => ID::custom('databases'), + '$id' => ID::custom('collections'), + 'name' => 'Collections', + 'attributes' => [ + [ + '$id' => ID::custom('databaseInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('databaseId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => true, + 'default' => null, + 'array' => false, + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'size' => 256, + 'required' => true, + 'signed' => true, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'default' => null, + 'array' => false, + ], + [ + '$id' => ID::custom('documentSecurity'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'default' => null, + 'array' => false, + ], + [ + '$id' => ID::custom('attributes'), + 'type' => Database::VAR_STRING, + 'size' => 1000000, + 'required' => false, + 'signed' => true, + 'array' => false, + 'filters' => ['subQueryAttributes'], + ], + [ + '$id' => ID::custom('indexes'), + 'type' => Database::VAR_STRING, + 'size' => 1000000, + 'required' => false, + 'signed' => true, + 'array' => false, + 'filters' => ['subQueryIndexes'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_enabled'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['enabled'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_documentSecurity'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['documentSecurity'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ] +]; diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php new file mode 100644 index 0000000000..a5fedb6461 --- /dev/null +++ b/app/config/collections/platform.php @@ -0,0 +1,1534 @@ + [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('projects'), + 'name' => 'Projects', + 'attributes' => [ + [ + '$id' => ID::custom('teamInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('teamId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('region'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('description'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('database'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('logo'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('url'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('version'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalName'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalCountry'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalState'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalCity'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalAddress'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('legalTaxId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'accessedAt', + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('services'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('apis'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('smtp'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + [ + '$id' => ID::custom('templates'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, // TODO make sure size fits + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('auths'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('oAuthProviders'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + [ + '$id' => ID::custom('platforms'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryPlatforms'], + ], + [ + '$id' => ID::custom('webhooks'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryWebhooks'], + ], + [ + '$id' => ID::custom('keys'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryKeys'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('pingCount'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('pingedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [128], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_team'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['teamId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_pingCount'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['pingCount'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_pingedAt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['pingedAt'], + 'lengths' => [], + 'orders' => [], + ] + ], + ], + + 'schedules' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('schedules'), + 'name' => 'schedules', + 'attributes' => [ + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceUpdatedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('schedule'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('data'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => false, + 'default' => new \stdClass(), + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + [ + '$id' => ID::custom('active'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => null, + 'array' => false, + ], + [ + '$id' => ID::custom('region'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 10, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_region_resourceType_resourceUpdatedAt'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'resourceType', 'resourceUpdatedAt'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_region_resourceType_projectId_resourceId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['region', 'resourceType', 'projectId', 'resourceId'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'platforms' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('platforms'), + 'name' => 'platforms', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('key'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('store'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('hostname'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'keys' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('keys'), + 'name' => 'keys', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('scopes'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, // var_dump of \bin2hex(\random_bytes(128)) => string(256) doubling for encryption + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('accessedAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('sdks'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_accessedAt', + 'type' => Database::INDEX_KEY, + 'attributes' => ['accessedAt'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'webhooks' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('webhooks'), + 'name' => 'webhooks', + 'attributes' => [ + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('url'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('httpUser'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('httpPass'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, // TODO will the length suffice after encryption? + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('security'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('events'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('signatureKey'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('logs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('attempts'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => 0, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_project'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'certificates' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('certificates'), + 'name' => 'Certificates', + 'attributes' => [ + [ + '$id' => ID::custom('domain'), + 'type' => Database::VAR_STRING, + 'format' => '', + // The maximum total length of a domain name or number is 255 characters. + // https://datatracker.ietf.org/doc/html/rfc2821#section-4.5.3.1 + // https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.2 + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('issueDate'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('renewDate'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('attempts'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('logs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('updated'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_domain'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['domain'], + 'lengths' => [255], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'realtime' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('realtime'), + 'name' => 'Realtime Connections', + 'attributes' => [ + [ + '$id' => ID::custom('container'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('timestamp'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('value'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], //TODO: use json filter + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_timestamp'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['timestamp'], + 'lengths' => [], + 'orders' => [Database::ORDER_DESC], + ], + ] + ], + + 'rules' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('rules'), + 'name' => 'Rules', + 'attributes' => [ + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('domain'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('certificateId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_domain'), + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['domain'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_resourceInternalId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_resourceId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_resourceType', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceType'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'installations' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('installations'), + 'name' => 'installations', + 'attributes' => [ + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerInstallationId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('organization'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('provider'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('personal'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => false, + 'array' => false, + ], + ], + 'indexes' => [ + + [ + '$id' => ID::custom('_key_projectInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerInstallationId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerInstallationId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'repositories' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('repositories'), + 'name' => 'repositories', + 'attributes' => [ + [ + '$id' => ID::custom('installationId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('installationInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerRepositoryId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('providerPullRequestIds'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_installationId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerRepositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerRepositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_resourceId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_resourceInternalId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_resourceType'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceType'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'vcsComments' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('vcsComments'), + 'name' => 'vcsComments', + 'attributes' => [ + [ + '$id' => ID::custom('installationId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('installationInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('projectId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('projectInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerRepositoryId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('providerCommentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('providerPullRequestId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + [ + '$id' => ID::custom('providerBranch'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [] + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_installationId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_projectId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['projectId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerRepositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerRepositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerPullRequestId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerPullRequestId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerBranch'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerBranch'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'vcsCommentLocks' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('vcsCommentLocks'), + 'name' => 'vcsCommentLocks', + 'attributes' => [], + 'indexes' => [] + ] +]; diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php new file mode 100644 index 0000000000..b760c337cc --- /dev/null +++ b/app/config/collections/projects.php @@ -0,0 +1,1957 @@ + [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('databases'), + 'name' => 'Databases', + 'attributes' => [ + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'size' => 256, + 'required' => true, + 'signed' => true, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('originalId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => null, + 'array' => false, + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'attributes' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('attributes'), + 'name' => 'Attributes', + 'attributes' => [ + [ + '$id' => ID::custom('databaseInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('databaseId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => false, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('collectionInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('collectionId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('key'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('error'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('size'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('required'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('default'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['casting'], + ], + [ + '$id' => ID::custom('signed'), + 'type' => Database::VAR_BOOLEAN, + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('array'), + 'type' => Database::VAR_BOOLEAN, + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('format'), + 'type' => Database::VAR_STRING, + 'size' => 64, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('formatOptions'), + 'type' => Database::VAR_STRING, + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => new stdClass(), + 'array' => false, + 'filters' => ['json', 'range', 'enum'], + ], + [ + '$id' => ID::custom('filters'), + 'type' => Database::VAR_STRING, + 'size' => 64, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('options'), + 'type' => Database::VAR_STRING, + 'size' => 16384, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_db_collection'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['databaseInternalId', 'collectionInternalId'], + 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + ], + ], + + 'indexes' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('indexes'), + 'name' => 'Indexes', + 'attributes' => [ + [ + '$id' => ID::custom('databaseInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('databaseId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => false, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('collectionInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('collectionId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('key'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('error'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('attributes'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('lengths'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('orders'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 4, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_db_collection'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['databaseInternalId', 'collectionInternalId'], + 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + ], + ], + + 'functions' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('functions'), + 'name' => 'Functions', + 'attributes' => [ + [ + '$id' => ID::custom('execute'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('name'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('enabled'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('live'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('installationId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('installationInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerRepositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerBranch'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRootDirectory'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerSilentMode'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => false, + 'default' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('logging'), + 'type' => Database::VAR_BOOLEAN, + 'signed' => true, + 'size' => 0, + 'format' => '', + 'filters' => [], + 'required' => true, + 'array' => false, + ], + [ + '$id' => ID::custom('runtime'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deployment'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('vars'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryVariables'], + ], + [ + '$id' => ID::custom('varsProject'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['subQueryProjectVariables'], + ], + [ + '$id' => ID::custom('events'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduleInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduleId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('schedule'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('timeout'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('version'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 8, + 'signed' => true, + 'required' => false, + 'default' => 'v4', + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('entrypoint'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('commands'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('specification'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => false, + 'required' => false, + 'default' => APP_FUNCTION_SPECIFICATION_DEFAULT, + 'filters' => [], + ], + [ + '$id' => ID::custom('scopes'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_name'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['name'], + 'lengths' => [256], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_enabled'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['enabled'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_installationInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['installationInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_providerRepositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['providerRepositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_repositoryId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['repositoryId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_repositoryInternalId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['repositoryInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_runtime'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['runtime'], + 'lengths' => [64], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_deployment'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['deployment'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'deployments' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('deployments'), + 'name' => 'Deployments', + 'attributes' => [ + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('buildId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('entrypoint'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('commands'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('path'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('type'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('installationId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('installationInternalId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRepositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('repositoryInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('providerRepositoryName'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRepositoryOwner'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRepositoryUrl'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommitHash'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommitAuthorUrl'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommitAuthor'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommitMessage'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommitUrl'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerBranch'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerBranchUrl'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerRootDirectory'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => Database::LENGTH_KEY, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('providerCommentId'), + 'type' => Database::VAR_STRING, + 'signed' => true, + 'size' => 2048, + 'format' => '', + 'filters' => [], + 'required' => false, + 'array' => false, + ], + [ + '$id' => ID::custom('size'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('metadata'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, // https://tools.ietf.org/html/rfc4288#section-4.2 + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('chunksTotal'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('chunksUploaded'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('activate'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => false, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_resource'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_resource_type'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceType'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_size'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['size'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_buildId'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['buildId'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_activate'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['activate'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'builds' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('builds'), + 'name' => 'Builds', + 'attributes' => [ + [ + '$id' => ID::custom('startTime'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('endTime'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('duration'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('size'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('runtime'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => true, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 256, + 'signed' => true, + 'required' => true, + 'default' => 'processing', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('path'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('logs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => '', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('sourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => true, + 'default' => 'local', + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('source'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => true, + 'default' => '', + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_deployment'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ] + ], + ], + + 'executions' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('executions'), + 'name' => 'Executions', + 'attributes' => [ + [ + '$id' => ID::custom('functionInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('functionId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('deploymentId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('trigger'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('duration'), + 'type' => Database::VAR_FLOAT, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('errors'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('logs'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 1000000, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('requestMethod'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + 'array' => false, + '$id' => ID::custom('requestPath'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 2048, + 'signed' => true, + 'required' => false, + 'default' => null, + 'filters' => [], + ], + [ + '$id' => ID::custom('requestHeaders'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('responseStatusCode'), + 'type' => Database::VAR_INTEGER, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('responseHeaders'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduledAt'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 0, + 'signed' => false, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => ['datetime'], + ], + [ + '$id' => ID::custom('scheduleInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('scheduleId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => ID::custom('_key_function'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['functionId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + [ + '$id' => ID::custom('_key_trigger'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['trigger'], + 'lengths' => [32], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_status'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['status'], + 'lengths' => [32], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_requestMethod'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['requestMethod'], + 'lengths' => [128], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_requestPath'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['requestPath'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_deployment'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['deploymentId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_responseStatusCode'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['responseStatusCode'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_key_duration'), + 'type' => Database::INDEX_KEY, + 'attributes' => ['duration'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + ], + ], + + 'variables' => [ + '$collection' => Database::METADATA, + '$id' => 'variables', + 'name' => 'variables', + 'attributes' => [ + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'key', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => 'value', + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 8192, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'] + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_BOOLEAN, + 'format' => '', + 'size' => 0, + 'signed' => true, + 'required' => false, + 'default' => false, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + ], + 'indexes' => [ + [ + '$id' => '_key_resourceInternalId', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceInternalId'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [], + ], + [ + '$id' => '_key_resourceType', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceType'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_resourceId_resourceType', + 'type' => Database::INDEX_KEY, + 'attributes' => ['resourceId', 'resourceType'], + 'lengths' => [Database::LENGTH_KEY, 100], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => '_key_uniqueKey', + 'type' => Database::INDEX_UNIQUE, + 'attributes' => ['resourceId', 'key', 'resourceType'], + 'lengths' => [Database::LENGTH_KEY, Database::LENGTH_KEY, 100], + 'orders' => [Database::ORDER_ASC, Database::ORDER_ASC, Database::ORDER_ASC], + ], + [ + '$id' => '_key_key', + 'type' => Database::INDEX_KEY, + 'attributes' => ['key'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], + ], + ], + + 'migrations' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('migrations'), + 'name' => 'Migrations', + 'attributes' => [ + [ + '$id' => ID::custom('status'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('stage'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('source'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 8192, // reduce size + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('destination'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => false, // make true after patch script + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('credentials'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65536, + 'signed' => true, + 'required' => false, + 'default' => [], + 'array' => false, + 'filters' => ['json', 'encrypt'], + ], + [ + '$id' => ID::custom('resources'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => [], + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('statusCounters'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 3000, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('resourceData'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 131070, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['json'], + ], + [ + '$id' => ID::custom('errors'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 65535, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => true, + 'filters' => [], + ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => '_key_status', + 'type' => Database::INDEX_KEY, + 'attributes' => ['status'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_stage', + 'type' => Database::INDEX_KEY, + 'attributes' => ['stage'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => '_key_source', + 'type' => Database::INDEX_KEY, + 'attributes' => ['source'], + 'lengths' => [Database::LENGTH_KEY], + 'orders' => [Database::ORDER_ASC], + ], + [ + '$id' => ID::custom('_fulltext_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ] + ], + ], + + 'resourceTokens' => [ + '$collection' => ID::custom(Database::METADATA), + '$id' => ID::custom('resourceTokens'), + 'name' => 'Resource Tokens', + 'attributes' => [ + [ + '$id' => ID::custom('resourceId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceInternalId'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => Database::LENGTH_KEY, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('resourceType'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 100, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => [], + ], + [ + '$id' => ID::custom('secret'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 512, + 'signed' => true, + 'required' => true, + 'default' => null, + 'array' => false, + 'filters' => ['encrypt'], + ], + [ + '$id' => ID::custom('expire'), + 'type' => Database::VAR_DATETIME, + 'format' => '', + 'size' => 255, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ] + ], + 'indexes' => [ + [ + '$id' => '_key_expiry_date', + 'type' => Database::INDEX_KEY, + 'attributes' => ['expire'], + 'lengths' => [], + 'orders' => [Database::ORDER_ASC], + ], + + ], + ], +]; diff --git a/app/config/errors.php b/app/config/errors.php index fc79599b12..461521f5e0 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -24,6 +24,11 @@ return [ 'description' => 'Access to this API is forbidden.', 'code' => 401, ], + Exception::GENERAL_RESOURCE_BLOCKED => [ + 'name' => Exception::GENERAL_RESOURCE_BLOCKED, + 'description' => 'Access to this resource is blocked.', + 'code' => 401, + ], Exception::GENERAL_UNKNOWN_ORIGIN => [ 'name' => Exception::GENERAL_UNKNOWN_ORIGIN, 'description' => 'The request originated from an unknown origin. If you trust this domain, please list it as a trusted platform in the Appwrite console.', @@ -344,11 +349,6 @@ return [ 'description' => 'Team with the requested ID could not be found.', 'code' => 404, ], - Exception::TEAM_INVITE_ALREADY_EXISTS => [ - 'name' => Exception::TEAM_INVITE_ALREADY_EXISTS, - 'description' => 'User has already been invited or is already a member of this team', - 'code' => 409, - ], Exception::TEAM_INVITE_NOT_FOUND => [ 'name' => Exception::TEAM_INVITE_NOT_FOUND, 'description' => 'The requested team invitation could not be found.', @@ -681,7 +681,7 @@ return [ ], Exception::ATTRIBUTE_LIMIT_EXCEEDED => [ 'name' => Exception::ATTRIBUTE_LIMIT_EXCEEDED, - 'description' => 'The maximum number of attributes has been reached.', + 'description' => 'The maximum number or size of attributes for this collection has been reached.', 'code' => 400, ], Exception::ATTRIBUTE_VALUE_INVALID => [ @@ -726,6 +726,11 @@ return [ 'description' => 'Index invalid.', 'code' => 400, ], + Exception::INDEX_DEPENDENCY => [ + 'name' => Exception::INDEX_DEPENDENCY, + 'description' => 'Attribute cannot be renamed or deleted. Please remove the associated index first.', + 'code' => 409, + ], /** Project Errors */ Exception::PROJECT_NOT_FOUND => [ diff --git a/app/config/function-templates.php b/app/config/function-templates.php index 762c33dd9a..4bd8b83f4d 100644 --- a/app/config/function-templates.php +++ b/app/config/function-templates.php @@ -11,7 +11,7 @@ const TEMPLATE_RUNTIMES = [ ], 'DART' => [ 'name' => 'dart', - 'versions' => ['3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16', '2.16'] + 'versions' => ['3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16'] ], 'GO' => [ 'name' => 'go', @@ -1567,7 +1567,8 @@ return [ 'required' => false, 'type' => 'number' ] - ] + ], + 'scopes' => [] ], [ 'icon' => 'icon-chip', diff --git a/app/config/locale/templates/email-inner-base.tpl b/app/config/locale/templates/email-inner-base.tpl index 52e1093ffb..8cef391d2f 100644 --- a/app/config/locale/templates/email-inner-base.tpl +++ b/app/config/locale/templates/email-inner-base.tpl @@ -1,9 +1,9 @@ -

{{hello}},

+

{{hello}}

{{body}}

{{redirect}}

{{footer}}

- {{thanks}}, + {{thanks}}
{{signature}}

\ No newline at end of file diff --git a/app/config/locale/templates/email-magic-url.tpl b/app/config/locale/templates/email-magic-url.tpl index def1ea2395..21988c5bc1 100644 --- a/app/config/locale/templates/email-magic-url.tpl +++ b/app/config/locale/templates/email-magic-url.tpl @@ -1,4 +1,4 @@ -

{{hello}},

+

{{hello}}

{{optionButton}}

diff --git a/app/config/locale/templates/email-mfa-challenge.tpl b/app/config/locale/templates/email-mfa-challenge.tpl index e3cb6b444d..3e55227055 100644 --- a/app/config/locale/templates/email-mfa-challenge.tpl +++ b/app/config/locale/templates/email-mfa-challenge.tpl @@ -1,4 +1,4 @@ -

{{hello}},

+

{{hello}}

{{description}}

diff --git a/app/config/locale/templates/email-otp.tpl b/app/config/locale/templates/email-otp.tpl index 9552185f84..84802c1603 100644 --- a/app/config/locale/templates/email-otp.tpl +++ b/app/config/locale/templates/email-otp.tpl @@ -1,4 +1,4 @@ -

{{hello}},

+

{{hello}}

{{description}}

diff --git a/app/config/locale/templates/email-session-alert.tpl b/app/config/locale/templates/email-session-alert.tpl index 20cecf212d..bd2f52af79 100644 --- a/app/config/locale/templates/email-session-alert.tpl +++ b/app/config/locale/templates/email-session-alert.tpl @@ -1,4 +1,4 @@ -

{{hello}},

+

{{hello}}

{{body}}

diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index 238c6777bd..e68fda2c75 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s span", "emails.verification.subject": "Rekening Bevestiging", - "emails.verification.hello": "Goeie dag {{user}}", + "emails.verification.hello": "Goeie dag {{user}},", "emails.verification.body": "Volg hierdie skakel om u e-pos adres te bevestig.", "emails.verification.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u adres te bevestig nie.", - "emails.verification.thanks": "Baie dankie", + "emails.verification.thanks": "Baie dankie,", "emails.verification.signature": "Die {{project}} span", "emails.magicSession.subject": "Teken aan", - "emails.magicSession.hello": "Goeie dag", + "emails.magicSession.hello": "Goeie dag,", "emails.magicSession.body": "Volg hierdie skakel om in te teken.", "emails.magicSession.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om met die' adres in te teken nie.", - "emails.magicSession.thanks": "Baie dankie", + "emails.magicSession.thanks": "Baie dankie,", "emails.magicSession.signature": "Die {{project}} span", "emails.recovery.subject": "Herstel Wagwoord", - "emails.recovery.hello": "Goeie dag {{user}}", + "emails.recovery.hello": "Goeie dag {{user}},", "emails.recovery.body": "Volg hierdie skakel om u {{project}} wagwoord te herstel.", "emails.recovery.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u wagwoord te herstel nie.", - "emails.recovery.thanks": "Baie dankie", + "emails.recovery.thanks": "Baie dankie,", "emails.recovery.signature": "Die {{project}} span", "emails.invitation.subject": "Uitnodiging om by die %s span aan te sluit by %s", "emails.invitation.hello": "Goeie dag,", "emails.invitation.body": "Hierdie boodskap is aan u gestuur omdat {{owner}} u uitnooi om 'n lid van die {{team}} groep by die {{project}} projek te wees.", "emails.invitation.footer": "As u nie belang stel nie, kan u gerus hierdie boodskap ignoreer.", - "emails.invitation.thanks": "Baie dankie", + "emails.invitation.thanks": "Baie dankie,", "emails.invitation.signature": "Die {{project}} span", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Die veiligheidsfrase vir hierdie e-pos is {{phrase}}. Jy kan hierdie e-pos vertrou as hierdie frase ooreenstem met die frase wat gewys is tydens aanmelding.", "emails.otpSession.thanks": "Dankie,", "emails.otpSession.signature": "{{project}} span" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ar-ma.json b/app/config/locale/translations/ar-ma.json index 453de25c80..efd2e95c31 100644 --- a/app/config/locale/translations/ar-ma.json +++ b/app/config/locale/translations/ar-ma.json @@ -4,34 +4,34 @@ "settings.direction": "rtl", "emails.sender": "فرقة %s", "emails.verification.subject": "التيْقان ديال الحساب", - "emails.verification.hello": "السلام {{user}}", + "emails.verification.hello": "السلام {{user}}،", "emails.verification.body": "تبّع هاد الوصلة باش تيقّن لادريسة تاع ليميل ديالك.", "emails.verification.footer": "إلا ماشي نتا اللي طلبتي تيقّن هاد لادريسة تاع ليميل، ممكن تنخّل هاد البرية.", - "emails.verification.thanks": "شكرا", + "emails.verification.thanks": "شكرا،", "emails.verification.signature": "فرقة {{project}}", "emails.magicSession.subject": "تكونيكطا", - "emails.magicSession.hello": "السلام,", + "emails.magicSession.hello": "السلام،", "emails.magicSession.body": "تبّع هاد الوصلة باش تتكونيكطا.", "emails.magicSession.footer": "إلا ماشي نتا اللي طلبتي تتكونيكطا بهاد ليميل، ممكن تنخّل هاد البرية.", - "emails.magicSession.thanks": "شكرا", + "emails.magicSession.thanks": "شكرا،", "emails.magicSession.signature": "فرقة {{project}}", "emails.recovery.subject": "تبدال كلمة السر", - "emails.recovery.hello": "السلام {{user}}", + "emails.recovery.hello": "السلام {{user}}،", "emails.recovery.body": "تبّع هاد الوصلة باش تبدّل كلمة السر تاع {{project}}.", "emails.recovery.footer": "إلا ماشي نتا اللي طلبتي تبدّل كلمة السر، ممكن تنخّل هاد البرية.", - "emails.recovery.thanks": "شكرا", + "emails.recovery.thanks": "شكرا،", "emails.recovery.signature": "فرقة {{project}}", "emails.invitation.subject": "عراضة ل فرقة %s ف %s", - "emails.invitation.hello": "السلام", + "emails.invitation.hello": "السلام،", "emails.invitation.body": "هاد البرية تصيفطات ليك حيت {{owner}} بغى يعرض عليك تولّي عضو ف فرقة {{team}} عند {{project}}.", "emails.invitation.footer": "إلا كنتي ما مسوّقش, ممكن تنخّل هاد البرية.", - "emails.invitation.thanks": "شكرا", + "emails.invitation.thanks": "شكرا،", "emails.invitation.signature": "فرقة {{project}}", "emails.certificate.subject": "السرتافيكة فشلات ل %s", - "emails.certificate.hello": "السلام", + "emails.certificate.hello": "السلام،", "emails.certificate.body": "السرتافيكة ديال الضومين ديالك '{{domain}}' ما قدّاتش تجينيرا. هادي هي المحاولة نمرة {{attempt}}, السبب ديال هاد الفشل هو: {{error}}", "emails.certificate.footer": "السرتافيكة الفايتة ديالك غاتبقى مزيانة لمدة 30 يوم من عند أول فشل. كانشجعوك بزاف أنك تبقشش فهاد الموضوع, وا إلّا الضومين ديالك ما غايبقاش خدّام فيه الـ SSL.", - "emails.certificate.thanks": "شكرا", + "emails.certificate.thanks": "شكرا،", "emails.certificate.signature": "فرقة {{project}}", "locale.country.unknown": "ما معروفش", "countries.af": "أفغانستان", diff --git a/app/config/locale/translations/ar.json b/app/config/locale/translations/ar.json index cd45b32e02..1d67c2ecf7 100644 --- a/app/config/locale/translations/ar.json +++ b/app/config/locale/translations/ar.json @@ -4,28 +4,28 @@ "settings.direction": "rtl", "emails.sender": "فريق %s", "emails.verification.subject": "تأكيد الحساب", - "emails.verification.hello": "مرحبا {{user}}", + "emails.verification.hello": "مرحبا {{user}}،", "emails.verification.body": "برجاء اتباع الرابط التالي لتأكيد بريدك الإلكتروني", "emails.verification.footer": "لو لم تطلب تأكيد هذا البريد الإلكتروني، يمكنك تجاهل هذه الرسالة", - "emails.verification.thanks": "شكرا", + "emails.verification.thanks": "شكرا،", "emails.verification.signature": "فريق {{project}}", "emails.magicSession.subject": "تسجيل الدخول", - "emails.magicSession.hello": "أهلا", + "emails.magicSession.hello": "أهلا،", "emails.magicSession.body": "اتبع هذا الرابط لتسجيل الدخول", "emails.magicSession.footer": "لو لم تطلب تسجيل الدخول بهذا البريد الاكتروني ، يمكنك تجاهل هذه الرسالة", - "emails.magicSession.thanks": "شكرا", + "emails.magicSession.thanks": "شكرا،", "emails.magicSession.signature": "فريق {{project}}", "emails.recovery.subject": "تغيير كلمة السر", - "emails.recovery.hello": "أهلا {{user}}", + "emails.recovery.hello": "أهلا {{user}}،", "emails.recovery.body": "برجاء اتباع الراط التالي لتغيير كلمة السر الخاصة بـ{{project}}", "emails.recovery.footer": "لولم تطلب تغيير كلمة السر، يمكنك تجاهل هذه الرسالة", - "emails.recovery.thanks": "شكرا", + "emails.recovery.thanks": "شكرا،", "emails.recovery.signature": "فريق {{project}}", "emails.invitation.subject": "دعوة لفريق %s في %s", - "emails.invitation.hello": "أهلا", + "emails.invitation.hello": "أهلا،", "emails.invitation.body": "هذة الرسالة تم ارسالها لك لأن {{owner}} ارسل لك دعوة لتكون عضوا بفريق {{team}} في {{project}}", "emails.invitation.footer": "اذا كنت غير مهتم، يمكنك تجاهل هذه الرسالة", - "emails.invitation.thanks": "شكرا", + "emails.invitation.thanks": "شكرا،", "emails.invitation.signature": "فريق {{project}}", "locale.country.unknown": "مجهول", "countries.af": "أفغانستان", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "عبارة الأمان لهذا البريد الإلكتروني هي {{phrase}}. يمكنك الوثوق بهذا البريد الإلكتروني إذا كانت هذه العبارة تتطابق مع العبارة المعروضة أثناء تسجيل الدخول.", "emails.otpSession.thanks": "شكرًا،", "emails.otpSession.signature": "فريق {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/as.json b/app/config/locale/translations/as.json index aa42483dde..572ed80f1a 100644 --- a/app/config/locale/translations/as.json +++ b/app/config/locale/translations/as.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s দল", "emails.verification.subject": "একাউণ্ট প্ৰমাণীকৰণ", - "emails.verification.hello": "নমস্কাৰ {{user}}", + "emails.verification.hello": "নমস্কাৰ {{user}},", "emails.verification.body": "আপোনাৰ ইমেইল ঠিকনা প্ৰমাণিত কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", "emails.verification.footer": "যদি আপুনি এই ঠিকনাটো সত্যাপিত কৰিবলৈ কোৱা নাই, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", - "emails.verification.thanks": "ধন্যবাদ", + "emails.verification.thanks": "ধন্যবাদ,", "emails.verification.signature": "{{project}} দল", "emails.magicSession.subject": "লগইন", - "emails.magicSession.hello": "নমস্কাৰ", + "emails.magicSession.hello": "নমস্কাৰ,", "emails.magicSession.body": "লগইন কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", "emails.magicSession.footer": "যদি আপুনি এই ইমেইল ব্যৱহাৰ কৰি লগইন কৰিবলৈ কোৱা নাছিল, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", - "emails.magicSession.thanks": "ধন্যবাদ", + "emails.magicSession.thanks": "ধন্যবাদ,", "emails.magicSession.signature": "{{project}} দল", "emails.recovery.subject": "পাছৱাৰ্ড ৰিছেট", - "emails.recovery.hello": "ধন্যবাদ {{user}}", + "emails.recovery.hello": "ধন্যবাদ {{user}},", "emails.recovery.body": "আপোনাৰ {{project}} পাছৱৰ্ড ৰিছেট কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।.", "emails.recovery.footer": "যদি আপুনি আপোনাৰ পাছৱৰ্ড ৰিছেট কৰিবলৈ কোৱা নাছিল, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", - "emails.recovery.thanks": "ধন্যবাদ", + "emails.recovery.thanks": "ধন্যবাদ,", "emails.recovery.signature": "{{project}} দল", "emails.invitation.subject": "%s বছৰত %s দললৈ নিমন্ত্ৰণ", - "emails.invitation.hello": "নমস্কাৰ", + "emails.invitation.hello": "নমস্কাৰ,", "emails.invitation.body": "এই মেইলটো আপোনালৈ প্ৰেৰণ কৰা হৈছিল কাৰণ {{owner}} জনে আপোনাক {{project}} বছৰবয়সত {{team}} দলৰ সদস্য হ'বলৈ আমন্ত্ৰণ জনাব বিচাৰিছিল।", "emails.invitation.footer": "যদি আপুনি আগ্ৰহী নহয়, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", - "emails.invitation.thanks": "ধন্যবাদ", + "emails.invitation.thanks": "ধন্যবাদ,", "emails.invitation.signature": "{{project}} দল", "locale.country.unknown": "অজ্ঞাত ", "countries.af": "আফগানিস্তান ", @@ -245,10 +245,10 @@ "emails.otpSession.thanks": "ধন্যবাদ,", "emails.otpSession.signature": "{{project}} দল", "emails.certificate.subject": "%sৰ বাবে প্ৰমাণপত্ৰ ব্যৰ্থতা", - "emails.certificate.hello": "নমস্কাৰ", + "emails.certificate.hello": "নমস্কাৰ,", "emails.certificate.body": "আপোনাৰ ডোমেইন '{{domain}}' ৰ বাবে প্ৰমাণপত্ৰটো উত্‌পন্ন কৰিব পৰা নগ'ল। এয়া প্ৰচেষ্টা নম্বৰ {{attempt}}, আৰু বিফলতাৰ কাৰণ হ'ল: {{error}}", "emails.certificate.footer": "আপোনাৰ পূৰ্বৰ প্ৰমাণপত্ৰটো প্ৰথম ব্ৰিফল হোৱাৰ দিনৰ পৰা ৩০ দিনলৈ বৈধ থাকিব। আমি এই ঘটনাটোৰ তদন্ত কৰিবলৈ উচ্চ পৰামৰ্শ দিয়ে, অন্যথা আপোনাৰ ডোমেইনটো অবৈধ SSL যোগাযোগ অবিহনে থাকিব।", - "emails.certificate.thanks": "ধন্যবাদ", + "emails.certificate.thanks": "ধন্যবাদ,", "emails.certificate.signature": "{{project}} দল", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/az.json b/app/config/locale/translations/az.json index df1264fe8d..5988c51786 100644 --- a/app/config/locale/translations/az.json +++ b/app/config/locale/translations/az.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Komandası", "emails.verification.subject": "Hesab Doğrulama", - "emails.verification.hello": "Salam {{user}}", + "emails.verification.hello": "Salam {{user}},", "emails.verification.body": "E-poçt ünvanınızı təsdiq etmək üçün bu linki izləyin.", "emails.verification.footer": "Bu ünvanı doğrulamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", - "emails.verification.thanks": "Təşəkkürlər", + "emails.verification.thanks": "Təşəkkürlər,", "emails.verification.signature": "{{project}} komandası", "emails.magicSession.subject": "Daxil Olmaq", - "emails.magicSession.hello": "Salam", + "emails.magicSession.hello": "Salam,", "emails.magicSession.body": "Daxil olmaq üçün bu linki izləyin.", "emails.magicSession.footer": "Bu e-poçtdan istifadə edərək giriş istəməmisinizsə, bu mesajı görməməzlikdən gələ bilərsiniz.", - "emails.magicSession.thanks": "Təşəkkürlər", + "emails.magicSession.thanks": "Təşəkkürlər,", "emails.magicSession.signature": "{{project}} komandası", "emails.recovery.subject": "Şifrə Sıfırlanması", - "emails.recovery.hello": "Salam {{user}}", + "emails.recovery.hello": "Salam {{user}},", "emails.recovery.body": "{{project}} şifrənizi sıfırlamaq üçün bu linki izləyin.", "emails.recovery.footer": "Şifrənizi sıfırlamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", - "emails.recovery.thanks": "Təşəkkürlər", + "emails.recovery.thanks": "Təşəkkürlər,", "emails.recovery.signature": "{{project}} komandası", "emails.invitation.subject": "%s Komandasına Dəvət %sdə", - "emails.invitation.hello": "Salam", + "emails.invitation.hello": "Salam,", "emails.invitation.body": "{{owner}}, {{project}}də {{team}} komandasına üzv olmağa dəvət etmək istədiyi üçün bu məktub sizə göndərildi.", "emails.invitation.footer": "Əgər maraqlanmırsınızsa, bu mesajı gözardı edə bilərsiniz.", - "emails.invitation.thanks": "Təşəkkürlər", + "emails.invitation.thanks": "Təşəkkürlər,", "emails.invitation.signature": "{{project}} komandası", "locale.country.unknown": "Naməlum", "countries.af": "Əfqanıstan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Bu e-poçtun təhlükəsizlik ifadəsi {{phrase}}-dir. Əgər bu ifadə daxil olarkən göstərilən ifadə ilə üst-üstə düşürsə, bu e-poçta etibar edə bilərsiniz.", "emails.otpSession.thanks": "Sağ olun,", "emails.otpSession.signature": "{{project}} komandası" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/be.json b/app/config/locale/translations/be.json index a33916f623..f03a9d5bef 100644 --- a/app/config/locale/translations/be.json +++ b/app/config/locale/translations/be.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Каманда %s", "emails.verification.subject": "Верыфікацыя акаўнта", - "emails.verification.hello": "Прывітанне {{user}}", + "emails.verification.hello": "Прывітанне {{user}},", "emails.verification.body": "Перайдзіце па гэтай спасылцы, каб пацвердзіць свой адрас электроннай пошты", "emails.verification.footer": "Калі вы не запытвалі пацвярджэнне гэтага адрасу, праігнаруйце гэтае паведамленне.", - "emails.verification.thanks": "Дзякуем", + "emails.verification.thanks": "Дзякуем,", "emails.verification.signature": "каманда {{project}}", "emails.magicSession.subject": "Лагін", - "emails.magicSession.hello": "Прывітанне", + "emails.magicSession.hello": "Прывітанне,", "emails.magicSession.body": "Перайдзіце па спасылцы, каб увайсці.", "emails.magicSession.footer": "Калі вы не прасілі ўвайсці, выкарыстоўваючы гэты адрас электроннай пошты, праігнаруйце гэтае паведамленне.", - "emails.magicSession.thanks": "Дзякуем", + "emails.magicSession.thanks": "Дзякуем,", "emails.magicSession.signature": "каманда {{project}}", "emails.recovery.subject": "Скід пароля", - "emails.recovery.hello": "Прывітанне, {{user}}", + "emails.recovery.hello": "Прывітанне, {{user}},", "emails.recovery.body": "Перайдзіце па гэтай спасылцы, каб скінуць пароль для праекта {{project}}.", "emails.recovery.footer": "Калі вы не прасілі скінуць пароль, вы можаце праігнараваць гэта паведамленне.", - "emails.recovery.thanks": "Дзякуем", + "emails.recovery.thanks": "Дзякуем,", "emails.recovery.signature": "каманда {{project}}", "emails.invitation.subject": "Запрошення до Команди %s у %s", - "emails.invitation.hello": "Прывітанне", + "emails.invitation.hello": "Прывітанне,", "emails.invitation.body": "Гэта паведамленне было адпраўлена вам, таму што {{owner}} хацеў запрасіць вас стаць членам каманды {{team}} у {{project}}.", "emails.invitation.footer": "Калі вам гэта не цікава, вы можаце праігнараваць гэтае паведамленне.", - "emails.invitation.thanks": "Дзякуем", + "emails.invitation.thanks": "Дзякуем,", "emails.invitation.signature": "каманда {{project}}", "locale.country.unknown": "Невядомы", "countries.af": "Афганістан", @@ -245,10 +245,10 @@ "emails.otpSession.thanks": "Дзякуй,", "emails.otpSession.signature": "каманда {{project}}", "emails.certificate.subject": "Сведчанне няўдалае для %s", - "emails.certificate.hello": "Прывітанне", + "emails.certificate.hello": "Прывітанне,", "emails.certificate.body": "Сертыфікат для вашага дамена '{{domain}}' не можа быць створаны. Гэта спроба нумар {{attempt}}, і прычынай няўдачы з'яўляецца: {{error}}", "emails.certificate.footer": "Ваш папярэдні сертыфікат будзе дзейнічаць 30 дзён з моманту першай няўдачы. Мы высока рэкамендуем расследаваць гэтую сітуацыю, інакш ваш дамен апынецца без дзейнага сертыфіката SSL-злучэння.", - "emails.certificate.thanks": "Дзякуй", + "emails.certificate.thanks": "Дзякуй,", "emails.certificate.signature": "каманда {{project}}", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/bg.json b/app/config/locale/translations/bg.json index 2dad3aecbe..086c6b283e 100644 --- a/app/config/locale/translations/bg.json +++ b/app/config/locale/translations/bg.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Екип", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Неизвестно", "countries.af": "Афганистан", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Фразата за сигурност за този имейл е {{phrase}}. Можете да се доверите на този имейл, ако тази фраза съвпада с фразата, показана по време на вписването.", "emails.otpSession.thanks": "Благодаря,", "emails.otpSession.signature": "екип на {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index 347f6f5d31..5cf06bd1dd 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s टीम", "emails.verification.subject": "खाता प्रमाणिकरण", - "emails.verification.hello": "नमस्ते {{user}}", + "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "ईमेल प्रमाणिकरण करे क लेल दिहल गइल लिंक फॉलो करें|", "emails.verification.footer": "अगर ई पता को सत्यापित करे के लिए ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", - "emails.verification.thanks": "धन्यवाद", + "emails.verification.thanks": "धन्यवाद,", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन करीं|", - "emails.magicSession.hello": "प्रणाम", + "emails.magicSession.hello": "प्रणाम,", "emails.magicSession.body": "लॉग इन करें लेल दिहल गइल लिंक फॉलो करें|", "emails.magicSession.footer": "अगर लॉग इन करे के लिए ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", - "emails.magicSession.thanks": "धन्यवाद", + "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} टीम", "emails.recovery.subject": "पासवर्ड बदल क लेल|", - "emails.recovery.hello": "प्रणाम {{user}}", + "emails.recovery.hello": "प्रणाम {{user}},", "emails.recovery.body": "पासवर्ड बदल क लेल दिहल गइल लिंक फॉलो करें|", "emails.recovery.footer": "अगर पासवर्ड बदल क लेल ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", - "emails.recovery.thanks": "धन्यवाद", + "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.signature": "{{project}} टीम", "emails.invitation.subject": "%s टीम क %s पे न्योता देवे क लेल|", - "emails.invitation.hello": "प्रणाम", + "emails.invitation.hello": "प्रणाम,", "emails.invitation.body": "ई मेल आपके एही लेल भेजल गईल रहल काहे क {{owner}} आपके {{project}} क {{team}} टीम का सदस्य बनावे चाहित रहे|", "emails.invitation.footer": "अगर आवे क इच्छा ना होवत, तो आप ई संदेश क अनदेखा कर सकत अछि।", - "emails.invitation.thanks": "धन्यवाद", + "emails.invitation.thanks": "धन्यवाद,", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अनजान", "countries.af": "अफ़ग़ानिस्तान", @@ -242,13 +242,13 @@ "emails.otpSession.description": "जब आपको सुरक्षित रूप से अपना {{project}} खाता में साइन इन करे खातिर कहल जाए तऽ निम्नलिखित सत्यापन कोड दर्ज करीं। ई 15 मिनट में खत्म हो जई।", "emails.otpSession.clientInfo": "एह साइन इन के अनुरोध {{agentClient}} पर {{agentDevice}} {{agentOs}} का प्रयोग करि कऽ कइल गइल बा। यदि तूँ एह साइन इन के अनुरोध ना कइले रहीं, त तूँ एह ईमेल के नजरअंदाज कर सकेला।", "emails.otpSession.securityPhrase": "एही ईमेल खातिर सुरक्षा वाक्य {{phrase}} हऽ। अगर ई वाक्य साइन इन कइला के समय देखावल गेल वाक्य से मेल खाता, त एह ईमेल पर भरोसा कर सकैत छी।", - "emails.otpSession.thanks": "धन्यवाद", + "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टीम", "emails.certificate.subject": "%s लेल प्रमाणपत्र असफलта", - "emails.certificate.hello": "नमस्ते", + "emails.certificate.hello": "नमस्ते,", "emails.certificate.body": "आपके डोमेन '{{domain}}' के लिए प्रमाणपत्र नहीं बनाया जा सका। ई प्रयास संख्या {{attempt}} है, और ई असफलता के कारण रहे: {{error}}", "emails.certificate.footer": "तोहार पिछलका प्रमाणपत्र पहिल असफलता से 30 दिन धरी मान्य होईत। हम बहुत जोर देके सलाह देतानी कि एह मामला के जांच करीं, नहीं त तोहार डोमेन बिना कोनो मान्य SSL संवाद के रहि जाईत।", - "emails.certificate.thanks": "धन्यवाद", + "emails.certificate.thanks": "धन्यवाद,", "emails.certificate.signature": "{{project}} टीम", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/bn.json b/app/config/locale/translations/bn.json index 897faea7c1..495f56e012 100644 --- a/app/config/locale/translations/bn.json +++ b/app/config/locale/translations/bn.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s টীম", "emails.verification.subject": "বিষয়", - "emails.verification.hello": "নমস্কার {{user}}", + "emails.verification.hello": "নমস্কার {{user}},", "emails.verification.body": "এই লিঙ্কের মাধ্যমে ইমেইল যাচাই করুন।", "emails.verification.footer": "আপনি যদি এই ঠিকানা যাচাই করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", - "emails.verification.thanks": "ধন্যবাদ", + "emails.verification.thanks": "ধন্যবাদ,", "emails.verification.signature": "{{project}} টীম", "emails.magicSession.subject": "লগ ইন", - "emails.magicSession.hello": "নমস্কার", + "emails.magicSession.hello": "নমস্কার,", "emails.magicSession.body": "এই লিঙ্কের মাধ্যমে লগ ইন করুন।", "emails.magicSession.footer": "আপনি যদি এই ইমেলটি ব্যবহার করে লগইন করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", - "emails.magicSession.thanks": "ধন্যবাদ", + "emails.magicSession.thanks": "ধন্যবাদ,", "emails.magicSession.signature": "{{project}} টীম", "emails.recovery.subject": "পাসওয়ার্ড রিসেট", - "emails.recovery.hello": "নমস্কার {{user}}", + "emails.recovery.hello": "নমস্কার {{user}},", "emails.recovery.body": "এই লিঙ্কের মাধ্যমে আপনার {{project}} পাসওয়ার্ড পুনরায় সেট করুন।", "emails.recovery.footer": "আপনি যদি আপনার পাসওয়ার্ড পুনরায় সেট করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", - "emails.recovery.thanks": "ধন্যবাদ", + "emails.recovery.thanks": "ধন্যবাদ,", "emails.recovery.signature": "{{project}} টীম", "emails.invitation.subject": "%s টিমকে %s তে আমন্ত্রণ জানান", - "emails.invitation.hello": "নমস্কার", + "emails.invitation.hello": "নমস্কার,", "emails.invitation.body": "এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আপনাকে {{project}} এর সাথে যুক্ত {{team}} টিমের সদস্য হওয়ার জন্য আমন্ত্রণ জানাতে চেয়েছিলেন।", "emails.invitation.footer": "যদি এটি আপনার জন্য প্রয়োজনীয় না হয়, আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", - "emails.invitation.thanks": "ধন্যবাদ", + "emails.invitation.thanks": "ধন্যবাদ,", "emails.invitation.signature": "{{project}} টীম", "locale.country.unknown": "অজানা", "countries.af": "আফগানিস্তান", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "এই ইমেইলের জন্য সুরক্ষা বাক্য হলো {{phrase}}। যদি এই বাক্যটি সাইন ইনের সময় দেখানো বাক্যের সাথে মেলে, তাহলে আপনি এই ইমেইলটিকে বিশ্বাস করতে পারেন।", "emails.otpSession.thanks": "ধন্যবাদ,", "emails.otpSession.signature": "{{project}} দল" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/bs.json b/app/config/locale/translations/bs.json index 1ce2d57a3e..1c69619c01 100644 --- a/app/config/locale/translations/bs.json +++ b/app/config/locale/translations/bs.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Tim", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Nepoznat", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Sigurnosna fraza za ovaj email je {{phrase}}. Možete vjerovati ovom emailu ako se ova fraza podudara sa frazom prikazanom prilikom prijave.", "emails.otpSession.thanks": "Hvala,", "emails.otpSession.signature": "tim {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ca.json b/app/config/locale/translations/ca.json index 94e3ae24c5..98940a4a48 100644 --- a/app/config/locale/translations/ca.json +++ b/app/config/locale/translations/ca.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Equip", "emails.verification.subject": "Verificació del compte", - "emails.verification.hello": "Hola {{user}}", + "emails.verification.hello": "Hola {{user}},", "emails.verification.body": "Accedeix a aquest enllaç per tal de verificar la teva adreça electrònica.", "emails.verification.footer": "Si no has sol·licitat la verificació d'aquesta adreça electrònica, pots ignorar aquest missatge.", - "emails.verification.thanks": "Gràcies", + "emails.verification.thanks": "Gràcies,", "emails.verification.signature": "Equip {{project}}", "emails.magicSession.subject": "Entrar", - "emails.magicSession.hello": "Hola", + "emails.magicSession.hello": "Hola,", "emails.magicSession.body": "Accedeix a aquest enllaç per a entrar.", "emails.magicSession.footer": "Si no has sol·licitat entrar amb aquesta adreça electrònica, pots ignorar aquest missatge.", - "emails.magicSession.thanks": "Gràcies", + "emails.magicSession.thanks": "Gràcies,", "emails.magicSession.signature": "Equip {{project}}", "emails.recovery.subject": "Reinicialitzar contrasenya", - "emails.recovery.hello": "Hola {{user}}", + "emails.recovery.hello": "Hola {{user}},", "emails.recovery.body": "Accedeix a aquest enllaç per a reinicialitzar la teva contrasenya de {{project}}.", "emails.recovery.footer": "Si no has sol·licitat reinicialitzar la teva contrasenya, pots ignorar aquest missatge.", - "emails.recovery.thanks": "Gràcies", + "emails.recovery.thanks": "Gràcies,", "emails.recovery.signature": "Equip {{project}}", "emails.invitation.subject": "Invitació a l'equip %s a s%", - "emails.invitation.hello": "Hola", + "emails.invitation.hello": "Hola,", "emails.invitation.body": "Aquest correu se t'ha enviat perquè {{owner}} vol convidar-te a formar part de l'equip {{team}} al {{project}}.", "emails.invitation.footer": "Si no és del teu interès, pots ignorar aquest missatge.", - "emails.invitation.thanks": "Gràcies", + "emails.invitation.thanks": "Gràcies,", "emails.invitation.signature": "Equip {{project}}", "locale.country.unknown": "Desconegut", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "La frase de seguretat d'aquest correu electrònic és {{phrase}}. Podeu confiar en aquest correu electrònic si aquesta frase coincideix amb la frase mostrada durant l'inici de sessió.", "emails.otpSession.thanks": "Gràcies,", "emails.otpSession.signature": "equip {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/cs.json b/app/config/locale/translations/cs.json index 4e3c533c77..c67e9299da 100644 --- a/app/config/locale/translations/cs.json +++ b/app/config/locale/translations/cs.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s tým", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Neznámý", "countries.af": "Afghánistán", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Bezpečnostní fráze pro tento e-mail je {{phrase}}. Tomuto e-mailu můžete důvěřovat, pokud se tato fráze shoduje s frází zobrazenou při přihlášení.", "emails.otpSession.thanks": "Děkuji,", "emails.otpSession.signature": "tým {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/da.json b/app/config/locale/translations/da.json index d50d9c46c6..9cec74dbed 100644 --- a/app/config/locale/translations/da.json +++ b/app/config/locale/translations/da.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Konto Verifikation", - "emails.verification.hello": "Hej {{user}}", + "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Følg dette link, for at verificere din email adresse.", "emails.verification.footer": "Hvis du ikke har bedt om at verificere denne adresse, ignorer venligst denne besked.", - "emails.verification.thanks": "Tak", + "emails.verification.thanks": "Tak,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Hej", + "emails.magicSession.hello": "Hej,", "emails.magicSession.body": "Følg dette link for at logge ind.", "emails.magicSession.footer": "Hvis du ikke har bedt om at logge ind med denne email, ignorer venligst denne besked.", - "emails.magicSession.thanks": "Tak", + "emails.magicSession.thanks": "Tak,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nulstil Password", - "emails.recovery.hello": "Hej {{user}}", + "emails.recovery.hello": "Hej {{user}},", "emails.recovery.body": "Følg dette link for at nulstille koden til {{project}}.", "emails.recovery.footer": "Hvis du ikke har bedt om at nulstille dit password, ignorer venligst denne besked.", - "emails.recovery.thanks": "Tak", + "emails.recovery.thanks": "Tak,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitation til %s Team på %s", - "emails.invitation.hello": "Hej", + "emails.invitation.hello": "Hej,", "emails.invitation.body": "Denne mail blev sendt til dig, fordi {{owner}} vil invitere dig til at blive medlem af {{team}} teamet på {{project}}.", "emails.invitation.footer": "Hvis du ikke er interesseret, ignorer venligst denne besked.", - "emails.invitation.thanks": "Tak", + "emails.invitation.thanks": "Tak,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukendt", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Sikkerhedsfrasen for denne e-mail er {{phrase}}. Du kan stole på denne e-mail, hvis denne frase matcher frasen vist under login.", "emails.otpSession.thanks": "Tak,", "emails.otpSession.signature": "{{project}} team" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/de.json b/app/config/locale/translations/de.json index 2279fcf4c0..38b1e46870 100644 --- a/app/config/locale/translations/de.json +++ b/app/config/locale/translations/de.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Kontoverifizierung", - "emails.verification.hello": "Hey {{user}}", + "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Folge diesem Link, um deine E-Mail-Adresse zu bestätigen.", "emails.verification.footer": "Solltest du keine Verifizierung dieser E-Mail-Adresse angefordert haben, kannst du diese Nachricht ignorieren.", - "emails.verification.thanks": "Danke", + "emails.verification.thanks": "Danke,", "emails.verification.signature": "{{project}}-Team", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Hey", + "emails.magicSession.hello": "Hey,", "emails.magicSession.body": "Folge diesem Link, um dich einzuloggen.", "emails.magicSession.footer": "Solltest du keinen Login für diese E-Mail-Adresse angefordert haben, kannst du diese Nachricht ignorieren.", - "emails.magicSession.thanks": "Danke", + "emails.magicSession.thanks": "Danke,", "emails.magicSession.signature": "{{project}}-Team", "emails.recovery.subject": "Kennwort zurücksetzen", - "emails.recovery.hello": "Hallo {{user}}", + "emails.recovery.hello": "Hallo {{user}},", "emails.recovery.body": "Folge diesem Link, um dein {{project}}-Kennwort zurückzusetzen.", "emails.recovery.footer": "Solltest du keine Kennwort-Zurücksetzung angefordert haben, kannst du diese Nachricht ignorieren.", - "emails.recovery.thanks": "Danke", + "emails.recovery.thanks": "Danke,", "emails.recovery.signature": "{{project}}-Team", "emails.invitation.subject": "Einladung zum %s-Team auf %s", - "emails.invitation.hello": "Hello", + "emails.invitation.hello": "Hello,", "emails.invitation.body": "Du erhälst diese E-Mail, weil {{owner}} dich in das Team {{team}} auf {{project}} eingeladen hat.", "emails.invitation.footer": "Wenn du nicht interessiert bist, kannst du diese Nachricht ignorieren.", - "emails.invitation.thanks": "Danke", + "emails.invitation.thanks": "Danke,", "emails.invitation.signature": "{{project}}-Team", "locale.country.unknown": "Unbekannt", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Die Sicherheitsphrase für diese E-Mail lautet {{phrase}}. Sie können dieser E-Mail vertrauen, wenn diese Phrase mit der Phrase übereinstimmt, die beim Anmelden angezeigt wird.", "emails.otpSession.thanks": "Danke,", "emails.otpSession.signature": "{{project}} Team" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/el.json b/app/config/locale/translations/el.json index 16c165ea39..1ef9cd30df 100644 --- a/app/config/locale/translations/el.json +++ b/app/config/locale/translations/el.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Ομάδα %s", "emails.verification.subject": "Επαλήθευση Λογαριασμού", - "emails.verification.hello": "Γεια σου {{user}}", + "emails.verification.hello": "Γεια σου {{user}},", "emails.verification.body": "Ακολουθήστε αυτό το link για να επαληθεύσετε τη δ/νση του email σας", "emails.verification.footer": "Εάν δεν ζητήσατε επαλήθευση αυτής της δ/νσης email, μπορείτε να αγνοήσετε αυτό το μήνυμα", - "emails.verification.thanks": "Ευχαριστούμε", + "emails.verification.thanks": "Ευχαριστούμε,", "emails.verification.signature": "Η ομάδα του {{project}}", "emails.magicSession.subject": "Είσοδος", - "emails.magicSession.hello": "Γεια σου", + "emails.magicSession.hello": "Γεια σου,", "emails.magicSession.body": "Ακολουθήστε αυτό το link για να συνδεθείτε", "emails.magicSession.footer": "Εάν δεν ζητήσατε να συνδεθείτε χρησιμοποιώντας αυτό το email, μπορείτε να αγνοήσετε αυτό το μήνυμα.", - "emails.magicSession.thanks": "Ευχαριστούμε", + "emails.magicSession.thanks": "Ευχαριστούμε,", "emails.magicSession.signature": "Η ομάδα του {{project}}", "emails.recovery.subject": "Αλλαγή κωδικού πρόσβασης", - "emails.recovery.hello": "Γεια σου {{user}}", + "emails.recovery.hello": "Γεια σου {{user}},", "emails.recovery.body": "Ακολουθήστε αυτό το link για να αλλάξετε τον {{project}} κωδικό σας", "emails.recovery.footer": "Εάν δεν ζητήσατε αλλαγή του κωδικού σας πρόσβασης, μπορείτε να αγνοήσετε αυτό το μήνυμα", - "emails.recovery.thanks": "Ευχαριστούμε", + "emails.recovery.thanks": "Ευχαριστούμε,", "emails.recovery.signature": "Η ομάδα του {{project}}", "emails.invitation.subject": "Πρόσκληση στην %s Ομάδα στον %s", - "emails.invitation.hello": "Γεια σου", + "emails.invitation.hello": "Γεια σου,", "emails.invitation.body": "Αυτό το email στάλθηκε επειδή ο/η {{owner}} θέλει να σας προσκαλέσει να γίνετε μέλος της ομάδας {{team}} του {{project}}.", "emails.invitation.footer": "Εάν δεν ενδιαφέρεστε, μπορείτε να αγνοήσετε αυτό το μήνυμα.", - "emails.invitation.thanks": "Ευχαριστούμε", + "emails.invitation.thanks": "Ευχαριστούμε,", "emails.invitation.signature": "Η ομάδα του {{project}}", "locale.country.unknown": "Άγνωστο", "countries.af": "Αφγανιστάν", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Η φράση ασφαλείας για αυτό το email είναι {{phrase}}. Μπορείτε να εμπιστευτείτε αυτό το email αν αυτή η φράση ταιριάζει με τη φράση που εμφανίστηκε κατά την είσοδο.", "emails.otpSession.thanks": "Ευχαριστώ,", "emails.otpSession.signature": "ομάδα {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index 937ab298de..d9dfddb017 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -4,13 +4,13 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Account Verification", - "emails.verification.hello": "Hello {{user}}", + "emails.verification.hello": "Hello {{user}},", "emails.verification.body": "Follow this link to verify your email address to your {{b}}{{project}}{{/b}} account.", "emails.verification.footer": "If you didn’t ask to verify this address, you can ignore this message.", - "emails.verification.thanks": "Thanks", + "emails.verification.thanks": "Thanks,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "{{project}} Login", - "emails.magicSession.hello": "Hello {{user}}", + "emails.magicSession.hello": "Hello {{user}},", "emails.magicSession.optionButton": "Click the button below to securely sign in to your {{b}}{{project}}{{/b}} account. This link will expire in 1 hour.", "emails.magicSession.buttonText": "Sign in to {{project}}", "emails.magicSession.optionUrl": "If you are unable to sign in using the button above, please visit the following link:", @@ -19,44 +19,44 @@ "emails.magicSession.thanks": "Thanks,", "emails.magicSession.signature": "{{project}} team", "emails.sessionAlert.subject": "Security alert: new session on your {{project}} account", - "emails.sessionAlert.hello":"Hello {{user}}", + "emails.sessionAlert.hello": "Hello {{user}},", "emails.sessionAlert.body": "A new session has been created on your {{b}}{{project}}{{/b}} account, {{b}}on {{date}}, {{year}} at {{time}} UTC{{/b}}.\nHere are the details of the new session: ", "emails.sessionAlert.listDevice": "Device: {{b}}{{device}}{{/b}}", "emails.sessionAlert.listIpAddress": "IP Address: {{b}}{{ipAddress}}{{/b}}", "emails.sessionAlert.listCountry": "Country: {{b}}{{country}}{{/b}}", - "emails.sessionAlert.footer": "If this was you, there's nothing more you need to do.\nIf you didn't initiate this session or suspect any unauthorized activity, please secure your account.", + "emails.sessionAlert.footer": "If this was you, there's nothing more you need to do.\nIf you didn't initiate this session or suspect any unauthorized activity, please secure your account.", "emails.sessionAlert.thanks": "Thanks,", "emails.sessionAlert.signature": "{{project}} team", "emails.otpSession.subject": "OTP for {{project}} Login", - "emails.otpSession.hello": "Hello {{user}}", + "emails.otpSession.hello": "Hello {{user}},", "emails.otpSession.description": "Enter the following verification code when prompted to securely sign in to your {{b}}{{project}}{{/b}} account. This code will expire in 15 minutes.", "emails.otpSession.clientInfo": "This sign in was requested using {{b}}{{agentClient}}{{/b}} on {{b}}{{agentDevice}}{{/b}} {{b}}{{agentOs}}{{/b}}. If you didn't request the sign in, you can safely ignore this email.", "emails.otpSession.securityPhrase": "Security phrase for this email is {{b}}{{phrase}}{{/b}}. You can trust this email if this phrase matches the phrase shown during sign in.", "emails.otpSession.thanks": "Thanks,", "emails.otpSession.signature": "{{project}} team", "emails.mfaChallenge.subject": "Verification Code for {{project}}", - "emails.mfaChallenge.hello": "Hello {{user}}", + "emails.mfaChallenge.hello": "Hello {{user}},", "emails.mfaChallenge.description": "Enter the following verification code to verify your email and activate two-step verification in {{b}}{{project}}{{/b}}. This code will expire in 15 minutes.", "emails.mfaChallenge.clientInfo": "This verification code was requested using {{b}}{{agentClient}}{{/b}} on {{b}}{{agentDevice}}{{/b}} {{b}}{{agentOs}}{{/b}}. If you didn't request the verification code, you can safely ignore this email.", "emails.mfaChallenge.thanks": "Thanks,", "emails.mfaChallenge.signature": "{{project}} team", "emails.recovery.subject": "Password Reset", - "emails.recovery.hello": "Hello {{user}}", + "emails.recovery.hello": "Hello {{user}},", "emails.recovery.body": "Follow this link to reset your {{b}}{{project}}{{/b}} password.", "emails.recovery.footer": "If you didn't ask to reset your password, you can ignore this message.", - "emails.recovery.thanks": "Thanks", + "emails.recovery.thanks": "Thanks,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitation to %s Team at %s", - "emails.invitation.hello": "Hello {{user}}", + "emails.invitation.hello": "Hello {{user}},", "emails.invitation.body": "This mail was sent to you because {{b}}{{owner}}{{/b}} wanted to invite you to become a member of the {{b}}{{team}}{{/b}} team at {{b}}{{project}}{{/b}}.", "emails.invitation.footer": "If you are not interested, you can ignore this message.", - "emails.invitation.thanks": "Thanks", + "emails.invitation.thanks": "Thanks,", "emails.invitation.signature": "{{project}} team", "emails.certificate.subject": "Certificate failure for %s", - "emails.certificate.hello": "Hello", + "emails.certificate.hello": "Hello,", "emails.certificate.body": "Certificate for your domain '{{domain}}' could not be generated. This is attempt no. {{attempt}}, and the failure was caused by: {{error}}", "emails.certificate.footer": "Your previous certificate will be valid for 30 days since the first failure. We highly recommend investigating this case, otherwise your domain will end up without a valid SSL communication.", - "emails.certificate.thanks": "Thanks", + "emails.certificate.thanks": "Thanks,", "emails.certificate.signature": "{{project}} team", "sms.verification.body": "{{secret}}", "locale.country.unknown": "Unknown", diff --git a/app/config/locale/translations/eo.json b/app/config/locale/translations/eo.json index 406bd4f52c..ba80bc602d 100644 --- a/app/config/locale/translations/eo.json +++ b/app/config/locale/translations/eo.json @@ -3,28 +3,28 @@ "settings.direction": "ltr", "emails.sender": "Teamo %s", "emails.verification.subject": "Konta Konfirmo", - "emails.verification.hello": "Saluton {{user}}", + "emails.verification.hello": "Saluton {{user}},", "emails.verification.body": "Alklaku ĉi tiun ligon por kontroli vian retpoŝtan adreson.", "emails.verification.footer": "Se vi ne petis ĉi tiun konfirmon de ĉi tiu retpoŝto, vi povas ignori ĉi tiun mesaĝon.", - "emails.verification.thanks": "Dankegon.", + "emails.verification.thanks": "Dankegon.,", "emails.verification.signature": "Teamo {{project}}", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Saluton", + "emails.magicSession.hello": "Saluton,", "emails.magicSession.body": "Alklaku ĉi tiun ligon por eniri.", "emails.magicSession.footer": "Se vi ne petis ĉi tiun konfirmon de ĉi tiu retpoŝto, vi povas ignori ĉi tiun mesaĝon.", - "emails.magicSession.thanks": "Dankegon", + "emails.magicSession.thanks": "Dankegon,", "emails.magicSession.signature": "Teamo {{project}}", "emails.recovery.subject": "Parsvorta Restarigo", - "emails.recovery.hello": "Saluton {{user}}", + "emails.recovery.hello": "Saluton {{user}},", "emails.recovery.body": "Alklaku ĉi tiun ligon por reagordi vian pasvorton. {{project}}", "emails.recovery.footer": "Se vi ne petis reagordi vian pasvorton, vi povas ignori ĉi tiun mesaĝon.", - "emails.recovery.thanks": "Dankegon", + "emails.recovery.thanks": "Dankegon,", "emails.recovery.signature": "Teamo {{project}}", "emails.invitation.subject": "Invito al la Teamo %s em %s", - "emails.invitation.hello": "Dankegon", + "emails.invitation.hello": "Dankegon,", "emails.invitation.body": "Ĉi tiu retpoŝto estis sendita ĉar la {{owner}} volas inviti vin fariĝi membro de la Teamo {{team}} en {{project}}.", "emails.invitation.footer": "Se vi ne interesiĝas, vi povas ignori ĉi tiun mesaĝon.", - "emails.invitation.thanks": "Dankegon", + "emails.invitation.thanks": "Dankegon,", "emails.invitation.signature": "Teamo {{project}}", "locale.country.unknown": "Unknown", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Sekureca frazo por ĉi tiu retpoŝto estas {{phrase}}. Vi povas fidi ĉi tiun retpoŝton se tiu ĉi frazo kongruas kun la frazo montrita dum ensaluto.", "emails.otpSession.thanks": "Dankon,", "emails.otpSession.signature": "teamo de {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/es.json b/app/config/locale/translations/es.json index 0e02f816fe..ff98fd28c7 100644 --- a/app/config/locale/translations/es.json +++ b/app/config/locale/translations/es.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "El equipo de %s", "emails.verification.subject": "Verificación de cuenta", - "emails.verification.hello": "Hola, {{name}}.", + "emails.verification.hello": "Hola, {{name}}.,", "emails.verification.body": "Haz clic en este enlace para verificar tu correo:", "emails.verification.footer": "Si no has solicitado verificar este correo, puedes ignorar este mensaje.", - "emails.verification.thanks": "Gracias.", + "emails.verification.thanks": "Gracias.,", "emails.verification.signature": "El equipo de {{project}}.", "emails.magicSession.subject": "Inicio de sesión", - "emails.magicSession.hello": "Hola", + "emails.magicSession.hello": "Hola,", "emails.magicSession.body": "Haz clic en este enlace para iniciar sesión:", "emails.magicSession.footer": "Si no has solicitado iniciar sesión usando este correo, puedes ignorar este mensaje.", - "emails.magicSession.thanks": "Gracias.", + "emails.magicSession.thanks": "Gracias.,", "emails.magicSession.signature": "El equipo de {{project}}", "emails.recovery.subject": "Restablecer contraseña", - "emails.recovery.hello": "Hola, {{name}}.", + "emails.recovery.hello": "Hola, {{name}}.,", "emails.recovery.body": "Haz clic en este enlace para restablecer la contraseña de {{project}}:", "emails.recovery.footer": "Si no has solicitado restablecer la contraseña, puedes ignorar este mensaje.", - "emails.recovery.thanks": "Gracias.", + "emails.recovery.thanks": "Gracias.,", "emails.recovery.signature": "El equipo de {{project}}", "emails.invitation.subject": "Invitación al equipo %s en %s", - "emails.invitation.hello": "Hola", + "emails.invitation.hello": "Hola,", "emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quién quiere invitarte a formar parte del equipo {{team}} en {{project}}.", "emails.invitation.footer": "Si no estás interesado, puedes ignorar este mensaje.", - "emails.invitation.thanks": "Gracias.", + "emails.invitation.thanks": "Gracias.,", "emails.invitation.signature": "El equipo de {{project}}", "locale.country.unknown": "Desconocido", "countries.af": "Afganistán", @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "La frase de seguridad para este correo electrónico es {{phrase}}. Puedes confiar en este correo electrónico si esta frase coincide con la frase que se muestra durante el inicio de sesión.", "emails.magicSession.optionUrl": "Si no puedes iniciar sesión utilizando el botón anterior, visita el siguiente enlace:", "emails.otpSession.subject": "Inicio de sesión en {{project}}", - "emails.otpSession.hello": "Hola", + "emails.otpSession.hello": "Hola,", "emails.otpSession.description": "Ingrese el siguiente código de verificación cuando se le solicite para iniciar sesión de forma segura en su cuenta de {{project}}. Expirará en 15 minutos.", "emails.otpSession.clientInfo": "Este inicio de sesión fue solicitado usando {{agentClient}} en {{agentDevice}} {{agentOs}}. Si no solicitaste el inicio de sesión, puedes ignorar este correo electrónico de forma segura.", "emails.otpSession.securityPhrase": "La frase de seguridad para este correo electrónico es {{phrase}}. Puedes confiar en este correo si esta frase coincide con la frase mostrada durante el inicio de sesión.", - "emails.otpSession.thanks": "Gracias.", + "emails.otpSession.thanks": "Gracias.,", "emails.otpSession.signature": "El equipo de {{project}}" } diff --git a/app/config/locale/translations/fa.json b/app/config/locale/translations/fa.json index 9620b2c3f0..f826a75118 100644 --- a/app/config/locale/translations/fa.json +++ b/app/config/locale/translations/fa.json @@ -4,28 +4,28 @@ "settings.direction": "rtl", "emails.sender": "تیم %s", "emails.verification.subject": "تأیید حساب", - "emails.verification.hello": "سلام {{user}}", + "emails.verification.hello": "سلام {{user}}،", "emails.verification.body": "برای تأیید ایمیل‌تان پیوند زیر را دنبال کنید.", "emails.verification.footer": "اگر شما درخواست تأیید حساب نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", - "emails.verification.thanks": "سپاس فراوان", + "emails.verification.thanks": "سپاس فراوان،", "emails.verification.signature": "تیم {{user}}", "emails.magicSession.subject": "ورود به حساب کاربری", "emails.magicSession.hello": "سلام،", "emails.magicSession.body": "برای ورود به حساب‌تان پیوند زیر را دنبال کنید.", "emails.magicSession.footer": "اگر شما درخواست ورود به حساب کاربری با استفاده از این ایمیل را نداد‌ه‌اید، می‌توانید این پیام را نادیده بگیرید.", - "emails.magicSession.thanks": "سپاس فراوان", + "emails.magicSession.thanks": "سپاس فراوان،", "emails.magicSession.signature": "تیم {{user}}", "emails.recovery.subject": "بازیابی گذرواژه", - "emails.recovery.hello": "سلام {{user}}", + "emails.recovery.hello": "سلام {{user}}،", "emails.recovery.body": "برای بازیابی گذرواژه‌تان پیوند زیر را دنبال کنید.", "emails.recovery.footer": "اگر شما درخواست بازیابی گذرواژه نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", - "emails.recovery.thanks": "سپاس فراوان", + "emails.recovery.thanks": "سپاس فراوان،", "emails.recovery.signature": "تیم {{user}}", "emails.invitation.subject": "دعوت به تیم %s در %s", - "emails.invitation.hello": "سلام", + "emails.invitation.hello": "سلام،", "emails.invitation.body": "این ایمیل برای شما فرستاده شده‌است زیرا {{owner}} می‌خواهد شما را به تیم {{team}} در پروژه‌ی {{project}} بیفزاید.", "emails.invitation.footer": "اگر علاقه ندارید، می‌توانید این پیام را نادیده بگیرید.", - "emails.invitation.thanks": "سپاس فراوان", + "emails.invitation.thanks": "سپاس فراوان،", "emails.invitation.signature": "تیم {{user}}", "locale.country.unknown": "ناشناخته", "countries.af": "افغانستان", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "عبارت امنیتی برای این ایمیل {{phrase}} است. اگر این عبارت با عبارت نشان داده شده هنگام ورود به سیستم مطابقت داشته باشد، می‌توانید به این ایمیل اعتماد کنید.", "emails.otpSession.thanks": "متشکرم،", "emails.otpSession.signature": "تیم {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/fi.json b/app/config/locale/translations/fi.json index d86810d925..ca61a95653 100644 --- a/app/config/locale/translations/fi.json +++ b/app/config/locale/translations/fi.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Tiimi", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Unknown", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Tämän sähköpostin turvalause on {{phrase}}. Voit luottaa tähän sähköpostiin, jos tämä lause vastaa kirjautumisen yhteydessä näytettyä lausetta.", "emails.otpSession.thanks": "Kiitos,", "emails.otpSession.signature": "{{project}} -tiimi" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/fo.json b/app/config/locale/translations/fo.json index 3853dbab9f..a982fd0590 100644 --- a/app/config/locale/translations/fo.json +++ b/app/config/locale/translations/fo.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Lið", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Ókjent", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Trygdarorðið fyri hesa teldupostin er {{phrase}}. Tú kanst líta á hesa teldupostin um hetta orðið passar við orðið víst tá tú ritaði inn.", "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}} lið" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index d73f4e7c81..1b60cb1910 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Équipe %s", "emails.verification.subject": "Vérification du compte", - "emails.verification.hello": "Bonjour {{user}}", + "emails.verification.hello": "Bonjour {{user}},", "emails.verification.body": "Suivez ce lien pour vérifier votre adresse e-mail.", "emails.verification.footer": "Si vous n'avez pas demandé à vérifier cette adresse, vous pouvez ignorer ce message.", - "emails.verification.thanks": "Merci", + "emails.verification.thanks": "Merci,", "emails.verification.signature": "Équipe {{project}}", "emails.magicSession.subject": "Connexion", - "emails.magicSession.hello": "Bonjour", + "emails.magicSession.hello": "Bonjour,", "emails.magicSession.body": "Suivez ce lien pour vous connecter.", "emails.magicSession.footer": "Si vous n'avez pas demandé à vous connecter en utilisant cet e-mail, vous pouvez ignorer ce message.", - "emails.magicSession.thanks": "Merci", + "emails.magicSession.thanks": "Merci,", "emails.magicSession.signature": "L'équipe {{project}}", "emails.recovery.subject": "Réinitialisation du mot de passe", - "emails.recovery.hello": "Bonjour {{user}}", + "emails.recovery.hello": "Bonjour {{user}},", "emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{project}}.", "emails.recovery.footer": "Si vous n'avez pas demandé à réinitialiser votre mot de passe, vous pouvez ignorer ce message.", - "emails.recovery.thanks": "Merci", + "emails.recovery.thanks": "Merci,", "emails.recovery.signature": "L'équipe {{project}}", "emails.invitation.subject": "Invitation à l'équipe %s de %s", - "emails.invitation.hello": "Bonjour", + "emails.invitation.hello": "Bonjour,", "emails.invitation.body": "Cet e-mail vous a été envoyé parce que {{owner}} souhaite vous inviter à devenir membre de l'équipe {{team}} pour {{project}}.", "emails.invitation.footer": "Si vous n'êtes pas intéressé, vous pouvez ignorer ce message.", - "emails.invitation.thanks": "Merci", + "emails.invitation.thanks": "Merci,", "emails.invitation.signature": "L'équipe {{project}}", "locale.country.unknown": "Inconnu", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "La phrase de sécurité pour cet e-mail est {{phrase}}. Vous pouvez faire confiance à cet e-mail si cette phrase correspond à celle affichée lors de la connexion.", "emails.otpSession.thanks": "Merci,", "emails.otpSession.signature": "équipe {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ga.json b/app/config/locale/translations/ga.json index b7a641ac01..3ed68ad8c3 100644 --- a/app/config/locale/translations/ga.json +++ b/app/config/locale/translations/ga.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Foireann", "emails.verification.subject": "Fíoraithe cuntais", - "emails.verification.hello": "Haigh {{user}}", + "emails.verification.hello": "Haigh {{user}},", "emails.verification.body": "Lean an nasc seo chun do ríomhphost a fhíorú.", "emails.verification.footer": "Mura ndearna tú iarratas an seoladh seo a fhíoru, déan neamhaird den teachtaireacht seo.", - "emails.verification.thanks": "Go raibh maith agat", + "emails.verification.thanks": "Go raibh maith agat,", "emails.verification.signature": "{{project}} foireann", "emails.magicSession.subject": "Logáil isteach", - "emails.magicSession.hello": "Haigh", + "emails.magicSession.hello": "Haigh,", "emails.magicSession.body": "Lean an nasc seo chun logáil isteach.", "emails.magicSession.footer": "Mura ndearna tú iarratas logáil isteach leis an ríomhphost seo, déan neamhaird den teachtaireacht seo.", - "emails.magicSession.thanks": "Go raibh maith agat", + "emails.magicSession.thanks": "Go raibh maith agat,", "emails.magicSession.signature": "{{project}} foireann", "emails.recovery.subject": "Athshocrú pasfhocail", - "emails.recovery.hello": "Haigh {{user}}", + "emails.recovery.hello": "Haigh {{user}},", "emails.recovery.body": "Lean an nasc seo chun do pasfhocal {{project}} a athshocrú.", "emails.recovery.footer": "Mura ndearna tú iarratas do pasfhocal a athshocrú, déan neamhaird den teachtaireacht seo.", - "emails.recovery.thanks": "Go raibh maith agat", + "emails.recovery.thanks": "Go raibh maith agat,", "emails.recovery.signature": "{{project}} foireann", "emails.invitation.subject": "Cuireadh do %s foireann ag %s", - "emails.invitation.hello": "Haigh", + "emails.invitation.hello": "Haigh,", "emails.invitation.body": "Seoladh an ríomhphost seo chugat mar ba mhaith le {{owner}} cuireadh a thabhairt duit bheith mar bhall den fhoireann {{team}} ag obair ar {{project}}.", "emails.invitation.footer": "Is cuma leat? Déan neamhaird den teachtaireacht seo.", - "emails.invitation.thanks": "Go raibh maith agat", + "emails.invitation.thanks": "Go raibh maith agat,", "emails.invitation.signature": "{{project}} foireann", "locale.country.unknown": "Neamhaithnid", "countries.af": "An Afganastáin", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Frása slándála don ríomhphost seo ná {{phrase}}. Is féidir muinín a bheith agat as an ríomhphost seo má mheaitseálann an frása seo leis an bhfrása a taispeántar le linn síniú isteach.", "emails.otpSession.thanks": "Go raibh maith agat,", "emails.otpSession.signature": "foireann {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/gu.json b/app/config/locale/translations/gu.json index 8c41c76c54..54378caa9e 100644 --- a/app/config/locale/translations/gu.json +++ b/app/config/locale/translations/gu.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ટીમ", "emails.verification.subject": "ખાતાની ચકાસણી", - "emails.verification.hello": "નમસ્કાર {{user}}", + "emails.verification.hello": "નમસ્કાર {{user}},", "emails.verification.body": "તમારું ઇમેઇલ સરનામું ચકાસવા માટે આ લિંકને અનુસરો.", "emails.verification.footer": "જો તમે આ સરનામાંની ચકાસણી કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", - "emails.verification.thanks": "આભાર", + "emails.verification.thanks": "આભાર,", "emails.verification.signature": "{{project}} ટીમ", "emails.magicSession.subject": "પ્રવેશ કરો", - "emails.magicSession.hello": "નમસ્કાર", + "emails.magicSession.hello": "નમસ્કાર,", "emails.magicSession.body": "પ્રવેશ કરવા માટે આ લિંકને અનુસરો.", "emails.magicSession.footer": "જો તમે આ ઇમેઇલનો ઉપયોગ કરીને પ્રવેશ કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", - "emails.magicSession.thanks": "આભાર", + "emails.magicSession.thanks": "આભાર,", "emails.magicSession.signature": "{{project}} ટીમ", "emails.recovery.subject": "પાસવર્ડ ફરીથી સેટ કરો", - "emails.recovery.hello": "નમસ્કાર {{user}}", + "emails.recovery.hello": "નમસ્કાર {{user}},", "emails.recovery.body": "તમારો {{project}} પાસવર્ડ ફરીથી સેટ કરવા માટે આ લિંકને અનુસરો.", "emails.recovery.footer": "જો તમે તમારો પાસવર્ડ ફરીથી સેટ કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", - "emails.recovery.thanks": "આભાર", + "emails.recovery.thanks": "આભાર,", "emails.recovery.signature": "{{project}} ટીમ", "emails.invitation.subject": "%s ટીમને %s પર આમંત્રણ", - "emails.invitation.hello": "નમસ્કાર", + "emails.invitation.hello": "નમસ્કાર,", "emails.invitation.body": "આ મેઇલ તમને મોકલવામાં આવ્યો હતો કારણ કે {{owner}} તમને {{project}} માં {{team}} ટીમના સભ્ય બનવા માટે આમંત્રિત કરવા માંગતા હતો.", "emails.invitation.footer": "જો તમને રસ નથી, તો તમે આ સંદેશને અવગણી શકો છો.", - "emails.invitation.thanks": "આભાર", + "emails.invitation.thanks": "આભાર,", "emails.invitation.signature": "{{project}} ટીમ", "locale.country.unknown": "અજાણ", "countries.af": "અફઘાનિસ્તાન", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "આ ઇમેઇલ માટેનો સુરક્ષા શબ્દ {{phrase}} છે. જો આ શબ્દ સાઇન ઇન વખતે દર્શાવેલા શબ્દ સાથે મેળ ખાતો હોય તો તમે આ ઇમેઇલ પર વિશ્વાસ કરી શકો છો.", "emails.otpSession.thanks": "આભાર,", "emails.otpSession.signature": "{{project}} ટીમ" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/he.json b/app/config/locale/translations/he.json index 81705d3492..b3d4dea2a8 100644 --- a/app/config/locale/translations/he.json +++ b/app/config/locale/translations/he.json @@ -4,28 +4,28 @@ "settings.direction": "rtl", "emails.sender": "צוות %s", "emails.verification.subject": "אימות חשבון", - "emails.verification.hello": "שלום {{user}}", + "emails.verification.hello": "שלום {{user}},", "emails.verification.body": "לחץ על קישור זה כדי לאמת את כתובת הדוא\"ל שלך.", "emails.verification.footer": "אם לא ביקשת לאמת כתובת זו, תוכל להתעלם מהודעה זו.", - "emails.verification.thanks": "תודה", + "emails.verification.thanks": "תודה,", "emails.verification.signature": "צוות {{project}}", "emails.magicSession.subject": "כניסה למערכת", - "emails.magicSession.hello": "שלום", + "emails.magicSession.hello": "שלום,", "emails.magicSession.body": "לחץ על קישור זה כדי להיכנס.", "emails.magicSession.footer": "אם לא ביקשת להיכנס באמצעות דוא\"ל זה, תוכל להתעלם מהודעה זו.", - "emails.magicSession.thanks": "תודה", + "emails.magicSession.thanks": "תודה,", "emails.magicSession.signature": "צוות {{project}}", "emails.recovery.subject": "איפוס סיסמא", - "emails.recovery.hello": "שלום {{user}}", + "emails.recovery.hello": "שלום {{user}},", "emails.recovery.body": "עקוב אחר קישור זה כדי לאפס את סיסמתך ב-{{project}}.", "emails.recovery.footer": "אם לא ביקשת לאפס את הסיסמה, תוכל להתעלם מהודעה זו.", - "emails.recovery.thanks": "תודה", + "emails.recovery.thanks": "תודה,", "emails.recovery.signature": "צוות {{project}}", "emails.invitation.subject": "הזמנה לצוות %s ב- %s", - "emails.invitation.hello": "שלום", + "emails.invitation.hello": "שלום,", "emails.invitation.body": "דואר זה נשלח אליך מכיוון ש {{owner}} רצה להזמין אותך להיות חבר בצוות {{team}} ב-{{project}}.", "emails.invitation.footer": "אם אינך מעוניין, תוכל להתעלם מהודעה זו.", - "emails.invitation.thanks": "תודה", + "emails.invitation.thanks": "תודה,", "emails.invitation.signature": "צוות {{project}}", "locale.country.unknown": "לא ידוע", "countries.af": "אפגניסטן", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "משפט האבטחה למייל זה הוא {{phrase}}. אתה יכול לסמוך על המייל הזה אם המשפט הזה תואם את המשפט שהוצג במהלך הכניסה למערכת.", "emails.otpSession.thanks": "תודה,", "emails.otpSession.signature": "צוות {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/hi.json b/app/config/locale/translations/hi.json index d764205ad6..1c4d531d60 100644 --- a/app/config/locale/translations/hi.json +++ b/app/config/locale/translations/hi.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s टीम", "emails.verification.subject": "अकाउंट वेरिफिकेशन ", - "emails.verification.hello": "नमस्ते {{user}}", + "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।", "emails.verification.footer": "यदि आप इस पते को सत्यापित नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", - "emails.verification.thanks": "धन्यवाद", + "emails.verification.thanks": "धन्यवाद,", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन", - "emails.magicSession.hello": "नमस्ते", + "emails.magicSession.hello": "नमस्ते,", "emails.magicSession.body": "इस लिंक के माध्यम से लॉग-इन करें।", "emails.magicSession.footer": "यदि आप इस ईमेल द्वारा लॉगिन नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", - "emails.magicSession.thanks": "धन्यवाद", + "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} टीम", "emails.recovery.subject": "पासवर्ड रीसेट", - "emails.recovery.hello": "नमस्ते {{user}}", + "emails.recovery.hello": "नमस्ते {{user}},", "emails.recovery.body": "इस लिंक के माध्यम से अपना {{project}} पासवर्ड रीसेट करें।", "emails.recovery.footer": "यदि आप अपना पासवर्ड रीसेट नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", - "emails.recovery.thanks": "धन्यवाद", + "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.signature": "{{project}} टीम", "emails.invitation.subject": "%s टीम का यहाँ %s पर आमंत्रण", - "emails.invitation.hello": "नमस्ते", + "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "यह मेल आपको इसलिए भेजा गया है क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते है, जो {{project}} से जुड़ा हुआ है।", "emails.invitation.footer": "यदि आप इसमें रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", - "emails.invitation.thanks": "धन्यवाद", + "emails.invitation.thanks": "धन्यवाद,", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अज्ञात", "countries.af": "अफ़ग़ानिस्तान", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "इस ईमेल के लिए सुरक्षा वाक्यांश {{phrase}} है। अगर यह वाक्यांश साइन इन के दौरान दिखाए गए वाक्यांश से मेल खाता है, तो आप इस ईमेल पर भरोसा कर सकते हैं।", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टीम" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/hr.json b/app/config/locale/translations/hr.json index 8e537f12ec..e5bf4719a9 100644 --- a/app/config/locale/translations/hr.json +++ b/app/config/locale/translations/hr.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Tim", "emails.verification.subject": "Verifikacija računa", - "emails.verification.hello": "Pozdrav {{user}}", + "emails.verification.hello": "Pozdrav {{user}},", "emails.verification.body": "Slijedite ovu poveznicu da biste potvrdili svoju adresu e-pošte.", "emails.verification.footer": "Ukoliko niste zatražili potvrdu ove adrese, možete zanemariti ovu poruku.", - "emails.verification.thanks": "Hvala", + "emails.verification.thanks": "Hvala,", "emails.verification.signature": "{{project}} tim", "emails.magicSession.subject": "Prijavite se", - "emails.magicSession.hello": "Pozdrav", + "emails.magicSession.hello": "Pozdrav,", "emails.magicSession.body": "Slijedite ovu poveznicu za prijavu.", "emails.magicSession.footer": "Ako niste zatražili prijavu putem ove e-pošte, možete zanemariti ovu poruku.", - "emails.magicSession.thanks": "Hvala", + "emails.magicSession.thanks": "Hvala,", "emails.magicSession.signature": "{{project}} tim", "emails.recovery.subject": "Ponovno postavljanje lozinke", - "emails.recovery.hello": "Pozdrav {{user}}", + "emails.recovery.hello": "Pozdrav {{user}},", "emails.recovery.body": "Slijedite ovu poveznicu za ponovno postavljanje {{project}} lozinke.", "emails.recovery.footer": "Ako niste zatražili ponovno postavljanje Vaše lozinke, možete zanemariti ovu poruku.", - "emails.recovery.thanks": "Hvala", + "emails.recovery.thanks": "Hvala,", "emails.recovery.signature": "{{project}} tim", "emails.invitation.subject": "Pozivnica za %s tim na %s", - "emails.invitation.hello": "Pozdrav", + "emails.invitation.hello": "Pozdrav,", "emails.invitation.body": "Ova poruka Vam je poslana jer Vas je {{owner}} htio pozvati da postanete član {{team}} tima na {{project}}.", "emails.invitation.footer": "Ukoliko niste zainteresirani, možete zanemariti ovu poruku.", - "emails.invitation.thanks": "Hvala", + "emails.invitation.thanks": "Hvala,", "emails.invitation.signature": "{{project}} tim", "locale.country.unknown": "Nepoznato", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Sigurnosna fraza za ovaj e-mail je {{phrase}}. Možete vjerovati ovom e-mailu ako se ova fraza podudara s frazom prikazanom prilikom prijave.", "emails.otpSession.thanks": "Hvala,", "emails.otpSession.signature": "tim {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/hu.json b/app/config/locale/translations/hu.json index fded03aee1..589cb61859 100644 --- a/app/config/locale/translations/hu.json +++ b/app/config/locale/translations/hu.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Csapat", "emails.verification.subject": "Fiók Megerősítése", - "emails.verification.hello": "Szia {{user}}", + "emails.verification.hello": "Szia {{user}},", "emails.verification.body": "Kattints a linkre, hogy megerősítsd az email címedet.", "emails.verification.footer": "Ha nem te kérted a címed megerősítését, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", - "emails.verification.thanks": "Köszönettel", + "emails.verification.thanks": "Köszönettel,", "emails.verification.signature": "a {{project}} csapat", "emails.magicSession.subject": "Bejelentkezés", - "emails.magicSession.hello": "Szia", + "emails.magicSession.hello": "Szia,", "emails.magicSession.body": "Kattints a linkre a bejelentkezéshez.", "emails.magicSession.footer": "Ha nem te szerettél volna bejelentkezni ezzel az email címmel, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", - "emails.magicSession.thanks": "Köszönettel", + "emails.magicSession.thanks": "Köszönettel,", "emails.magicSession.signature": "a {{project}} csapat", "emails.recovery.subject": "Jelszó Visszaállítása", - "emails.recovery.hello": "Hahó, {{user}}", + "emails.recovery.hello": "Hahó, {{user}},", "emails.recovery.body": "Kattints a linkre a {{project}} jelszavad visszaállításához.", "emails.recovery.footer": "Ha nem te kezdeményezted a jelszavad visszaállítását, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", - "emails.recovery.thanks": "Köszönettel", + "emails.recovery.thanks": "Köszönettel,", "emails.recovery.signature": "a {{project}} csapat", "emails.invitation.subject": "Meghívó a(z) %s csapatba, a(z) %s projektbe", - "emails.invitation.hello": "Szia", + "emails.invitation.hello": "Szia,", "emails.invitation.body": "Ezt a levelet azért kaptad, mert {{owner}} meghívott, hogy légy a {{team}} csapat tagja a {{project}} projektben.", "emails.invitation.footer": "Ha nem érdekel a lehetőség, nyugodtan hagyd figyelmen kívül ezt az üzenetet.", - "emails.invitation.thanks": "Köszönettel", + "emails.invitation.thanks": "Köszönettel,", "emails.invitation.signature": "a {{project}} csapat", "locale.country.unknown": "Ismeretlen", "countries.af": "Afganisztán", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Az e-mailhez tartozó biztonsági kód: {{phrase}}. Ennek az e-mailnek megbízhat, ha a megjelenített kód megegyezik a bejelentkezéskor megjelenő kóddal.", "emails.otpSession.thanks": "Köszönöm,", "emails.otpSession.signature": "{{project}} csapat" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/hy.json b/app/config/locale/translations/hy.json index 2c4e72ebe3..c845526607 100644 --- a/app/config/locale/translations/hy.json +++ b/app/config/locale/translations/hy.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Թիմ %s", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Անհայտ", "countries.af": "Աֆղանստան", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Այս էլ.փոստի անվտանգության արտահայտությունը {{phrase}} է: Կարող եք վստահել այս էլ.փոստին, եթե այս արտահայտությունը համընկնում է մուտք գործելու պահին տրված արտահայտության հետ։", "emails.otpSession.thanks": "Շնորհակալ եմ,", "emails.otpSession.signature": "{{project}} թիմ" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/id.json b/app/config/locale/translations/id.json index 90b096e39e..c28b15f15d 100644 --- a/app/config/locale/translations/id.json +++ b/app/config/locale/translations/id.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Tim %s", "emails.verification.subject": "Verifikasi Akun", - "emails.verification.hello": "Hai {{user}}", + "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Ikuti tautan ini untuk memverifikasi alamat email Anda.", "emails.verification.footer": "Jika Anda tidak meminta untuk memverifikasi alamat email ini, Anda dapat mengabaikan pesan ini.", - "emails.verification.thanks": "Terima kasih", + "emails.verification.thanks": "Terima kasih,", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", - "emails.magicSession.hello": "Hai", + "emails.magicSession.hello": "Hai,", "emails.magicSession.body": "Ikuti tautan ini untuk masuk.", "emails.magicSession.footer": "Jika Anda tidak meminta untuk masuk menggunakan email ini, Anda dapat mengabaikan pesan ini.", - "emails.magicSession.thanks": "Terima kasih", + "emails.magicSession.thanks": "Terima kasih,", "emails.magicSession.signature": "Tim {{project}}", "emails.recovery.subject": "Atur Ulang Kata Sandi", - "emails.recovery.hello": "Halo {{user}}", + "emails.recovery.hello": "Halo {{user}},", "emails.recovery.body": "Ikuti tautan ini untuk menyetel ulang kata sandi {{project}} Anda.", "emails.recovery.footer": "Jika Anda tidak meminta untuk menyetel ulang kata sandi, Anda dapat mengabaikan pesan ini.", - "emails.recovery.thanks": "Terima kasih", + "emails.recovery.thanks": "Terima kasih,", "emails.recovery.signature": "Tim {{project}}", "emails.invitation.subject": "Undangan ke Tim %s di %s", - "emails.invitation.hello": "Halo", + "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email ini dikirimkan kepada Anda karena {{owner}} ingin mengundang Anda untuk menjadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Jika Anda tidak tertarik, Anda dapat mengabaikan pesan ini.", - "emails.invitation.thanks": "Terima kasih", + "emails.invitation.thanks": "Terima kasih,", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Tidak diketahui", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Frasa keamanan untuk email ini adalah {{phrase}}. Anda dapat mempercayai email ini jika frasa tersebut cocok dengan frasa yang ditampilkan saat masuk.", "emails.otpSession.thanks": "Terima kasih,", "emails.otpSession.signature": "tim {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/is.json b/app/config/locale/translations/is.json index 039d6849b7..5fede4dda0 100644 --- a/app/config/locale/translations/is.json +++ b/app/config/locale/translations/is.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Teymi", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Óþekktur", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Öryggissetning fyrir þetta tölvupóst er {{phrase}}. Þú getur treyst þessum tölvupósti ef þessi setning passar við setninguna sem birtist við innskráningu.", "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}} liðið" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/it.json b/app/config/locale/translations/it.json index d0716dd1e2..8d45de9903 100644 --- a/app/config/locale/translations/it.json +++ b/app/config/locale/translations/it.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Team %s", "emails.verification.subject": "Verifica account", - "emails.verification.hello": "Ciao {{user}}", + "emails.verification.hello": "Ciao {{user}},", "emails.verification.body": "Clicca questo link per verificare il tuo indirizzo email.", "emails.verification.footer": "Se non hai richiesto la verifica dell’indirizzo email, puoi ignorare questo messaggio.", - "emails.verification.thanks": "Grazie", + "emails.verification.thanks": "Grazie,", "emails.verification.signature": "Il team {{project}}", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Ciao", + "emails.magicSession.hello": "Ciao,", "emails.magicSession.body": "Clicca questo link per accedere.", "emails.magicSession.footer": "Se non hai richiesto di effettuare l’accesso, puoi ignorare questo messaggio.", - "emails.magicSession.thanks": "Grazie", + "emails.magicSession.thanks": "Grazie,", "emails.magicSession.signature": "Il team {{project}}", "emails.recovery.subject": "Reimpostazione password", - "emails.recovery.hello": "Ciao {{user}}", + "emails.recovery.hello": "Ciao {{user}},", "emails.recovery.body": "Clicca questo link per reimpostare la tua password di {{project}}.", "emails.recovery.footer": "Se non hai richiesto la reimpostazione della password, puoi ignorare questo messaggio.", - "emails.recovery.thanks": "Grazie", + "emails.recovery.thanks": "Grazie,", "emails.recovery.signature": "Il team {{project}}", "emails.invitation.subject": "Invito al Team %s per %s", - "emails.invitation.hello": "Ciao", + "emails.invitation.hello": "Ciao,", "emails.invitation.body": "Hai ricevuto questa email perché {{owner}} ti ha invitato a diventare un membro del team {{team}} di {{project}}.", "emails.invitation.footer": "Ignora questo messaggio se non sei interessatə.", - "emails.invitation.thanks": "Grazie", + "emails.invitation.thanks": "Grazie,", "emails.invitation.signature": "Il team {{project}}", "locale.country.unknown": "Sconosciuto", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "La frase di sicurezza per questa email è {{phrase}}. Puoi fidarti di questa email se questa frase corrisponde alla frase mostrata durante l'accesso.", "emails.otpSession.thanks": "Grazie,", "emails.otpSession.signature": "team {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ja.json b/app/config/locale/translations/ja.json index 6482488cf5..76d9a0cb1f 100644 --- a/app/config/locale/translations/ja.json +++ b/app/config/locale/translations/ja.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s チーム", "emails.verification.subject": "アカウント認証", - "emails.verification.hello": "こんにちは{{user}}さん", + "emails.verification.hello": "こんにちは{{user}}さん、", "emails.verification.body": "メールアドレスを有効化するためには下記リンクをクリックして下さい。", "emails.verification.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", - "emails.verification.thanks": "ご利用いただきありがとうございます。", + "emails.verification.thanks": "ご利用いただきありがとうございます。、", "emails.verification.signature": "{{project}}チーム", "emails.magicSession.subject": "ログイン", - "emails.magicSession.hello": "こんにちは", + "emails.magicSession.hello": "こんにちは、", "emails.magicSession.body": "ログインするためには下記リンクをクリックしてください。", "emails.magicSession.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", - "emails.magicSession.thanks": "ご利用いただきありがとうございます。", + "emails.magicSession.thanks": "ご利用いただきありがとうございます。、", "emails.magicSession.signature": "{{project}}チーム", "emails.recovery.subject": "パスワードリセット", - "emails.recovery.hello": "こんにちは{{user}}さん", + "emails.recovery.hello": "こんにちは{{user}}さん、", "emails.recovery.body": "パスワードをリセットするためには下記リンクをクリックしてください。", "emails.recovery.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", - "emails.recovery.thanks": "ご利用いただきありがとうございます。", + "emails.recovery.thanks": "ご利用いただきありがとうございます。、", "emails.recovery.signature": "{{project}}チーム", "emails.invitation.subject": "%sチームへの招待が%sから来ました。", - "emails.invitation.hello": "こんにちは", + "emails.invitation.hello": "こんにちは、", "emails.invitation.body": "{{owner}}さんが{{project}}の{{team}}チームにあなたを招待しています。", "emails.invitation.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", - "emails.invitation.thanks": "ご利用いただきありがとうございます。", + "emails.invitation.thanks": "ご利用いただきありがとうございます。、", "emails.invitation.signature": "{{project}}チーム", "locale.country.unknown": "不明", "countries.af": "アフガニスタン", @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "このメールのセキュリティフレーズは{{phrase}}です。サインイン時に表示されたフレーズと一致する場合、このメールは信頼できます。", "emails.magicSession.optionUrl": "上記のボタンを使用してサインインすることができない場合は、次のリンクにアクセスしてください:", "emails.otpSession.subject": "プロジェクト ログイン", - "emails.otpSession.hello": "こんにちは。", + "emails.otpSession.hello": "こんにちは。、", "emails.otpSession.description": "以下の確認コードを入力して、{{project}}アカウントに安全にサインインしてください。このコードは15分後に失効します。", "emails.otpSession.clientInfo": "このサインインは、{{agentClient}} を使い {{agentDevice}} {{agentOs}} で要求されました。サインインを要求していない場合、このメールを無視しても安全です。", "emails.otpSession.securityPhrase": "このメールのセキュリティフレーズは{{phrase}}です。サインイン時に表示されたフレーズと一致する場合、このメールを信頼できます。", - "emails.otpSession.thanks": "ありがとうございます。", + "emails.otpSession.thanks": "ありがとうございます。、", "emails.otpSession.signature": "{{project}} チーム" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/jv.json b/app/config/locale/translations/jv.json index 7f91a8dcef..889e968b4d 100644 --- a/app/config/locale/translations/jv.json +++ b/app/config/locale/translations/jv.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Tim %s", "emails.verification.subject": "Verifikasi Akun", - "emails.verification.hello": "Hai {{user}}", + "emails.verification.hello": "Hai {{user}},", "emails.verification.body": "Klik link iki kanggo verifikasi alamat email sampeyan.", "emails.verification.footer": "Yen sampeyan ora njaluk verifikasi alamat iki, sampeyan iso nglirwakake pesen iki.", - "emails.verification.thanks": "Matur nuwun", + "emails.verification.thanks": "Matur nuwun,", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", - "emails.magicSession.hello": "Hai", + "emails.magicSession.hello": "Hai,", "emails.magicSession.body": "Klik link iki kanggo masuk.", "emails.magicSession.footer": "Yen sampeyan ora njaluk masuk nggunakake alamat email iki, sampeyan iso nglirwakake pesen iki.", - "emails.magicSession.thanks": "Matur nuwun", + "emails.magicSession.thanks": "Matur nuwun,", "emails.magicSession.signature": "Tim {{project}}", "emails.recovery.subject": "Setel ulang sandi", - "emails.recovery.hello": "Halo {{user}}", + "emails.recovery.hello": "Halo {{user}},", "emails.recovery.body": "Klik link iki kanggo setel ulang sandi {{project}}.", "emails.recovery.footer": "Yen sampeyan ora njaluk setel ulang sandi, sampeyan iso nglirwakake pesen iki.", - "emails.recovery.thanks": "Matur nuwun", + "emails.recovery.thanks": "Matur nuwun,", "emails.recovery.signature": "Tim {{project}}", "emails.invitation.subject": "Undangan ke Tim %s di %s", - "emails.invitation.hello": "Halo", + "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Yen sampeyan ora tertarik, sampeyan iso nglirwakake pesen iki.", - "emails.invitation.thanks": "Matur nuwun", + "emails.invitation.thanks": "Matur nuwun,", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Ora dingerteni", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Tembung keamanan kanggo email iki yaiku {{phrase}}. Sampeyan bisa percaya email iki menawa tembung kasebut cocog karo tembung sing ditampilake nalika mlebu.", "emails.otpSession.thanks": "Matur nuwun,", "emails.otpSession.signature": "tim {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/km.json b/app/config/locale/translations/km.json index 72c362a77c..12ac05e8da 100644 --- a/app/config/locale/translations/km.json +++ b/app/config/locale/translations/km.json @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "ឃ្លាសម្ងាត់សម្រាប់អ៊ីមែលនេះគឺ {{phrase}}។ អ្នកអាចទុកចិត្តលើអ៊ីមែលនេះប្រសិនបើឃ្លានេះត្រូវគ្នាជាមួយឃ្លាដែលបង្ហាញឡើងពេលចូលប្រើ។", "emails.magicSession.optionUrl": "ប្រសិនបើអ្នកមិនអាចចូលប្រើប្រាស់ដោយប្រើប៊ូតុងខាងលើនេះទេ សូមចូលទៅកាន់តំណភ្ជាប់ខាងក្រោម៖", "emails.otpSession.subject": "ការចូល {{project}}", - "emails.otpSession.hello": "ជំរាបសួរ,", + "emails.otpSession.hello": "ជំរាបសួរ", "emails.otpSession.description": "បញ្ចូលលេខកូដផ្ទៀងផ្ទាត់ខាងក្រោមនេះនៅពេលដែលបានស្នើ ដើម្បីចូលទៅកាន់គណនី {{project}} របស់អ្នកដោយមានសុវត្ថិភាព។ វានឹងផុតកំណត់ក្នុងរយៈពេល 15 នាទី។", "emails.otpSession.clientInfo": "ការចូលប្រព័ន្ធនេះត្រូវបានស្នើរបស់អ្នកប្រើប្រាស់តាមរយៈ {{agentClient}} នៅលើ {{agentDevice}} {{agentOs}}។ ប្រសិនបើអ្នកមិនបានស្នើរការចូលប្រព័ន្ធនេះទេ អ្នកអាចមិនអើពើអ៊ីម៉ែលនេះបាន។", "emails.otpSession.securityPhrase": "ឃ្លាសម្រាប់សុវត្ថិភាពអ៊ីមែលនេះគឺ {{phrase}}។ អ្នកអាចទុកចិត្តនូវអ៊ីមែលនេះប្រសិនបើឃ្លានេះត្រូវគ្នាជាមួយឃ្លាដែលបានបង្ហាញពេលចូលគណនី។", - "emails.otpSession.thanks": "អរគុណ,", + "emails.otpSession.thanks": "អរគុណ", "emails.otpSession.signature": "ក្រុម {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index 429958fc1a..ba57c21155 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ತಂಡ", "emails.verification.subject": "ಖಾತೆ ಪರಿಶೀಲನೆ", - "emails.verification.hello": "ನಮಸ್ಕಾರ {{user}}", + "emails.verification.hello": "ನಮಸ್ಕಾರ {{user}},", "emails.verification.body": "ನಿಮ್ಮ ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.verification.footer": "ನೀವು ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", - "emails.verification.thanks": "ಧನ್ಯವಾದಗಳು", + "emails.verification.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.verification.signature": "{{project}} ತಂಡ", "emails.magicSession.subject": "ಲಾಗಿನ್", - "emails.magicSession.hello": "ನಮಸ್ಕಾರ", + "emails.magicSession.hello": "ನಮಸ್ಕಾರ,", "emails.magicSession.body": "ಲಾಗಿನ್ ಮಾಡಲಿಕ್ಕೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.magicSession.footer": "ನೀವು ಈ ಇಮೇಲನಿಂದ ಲಾಗಿನ್ ಮಾಡಲು ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", - "emails.magicSession.thanks": "ಧನ್ಯವಾದಗಳು", + "emails.magicSession.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.magicSession.signature": "{{project}} ತಂಡ", "emails.recovery.subject": "ಗುಪ್ತಪದ ಮರುಹೊಂದಿಸಿ", - "emails.recovery.hello": "ನಮಸ್ಕಾರ {{user}}", + "emails.recovery.hello": "ನಮಸ್ಕಾರ {{user}},", "emails.recovery.body": "ನಿಮ್ಮ {{project}} ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.recovery.footer": "ನೀವು ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", - "emails.recovery.thanks": "ಧನ್ಯವಾದಗಳು", + "emails.recovery.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.recovery.signature": "{{project}} ತಂಡ", "emails.invitation.subject": "%s ತಂಡಕ್ಕೆ %s ರಲ್ಲಿ ಆಹ್ವಾನ", - "emails.invitation.hello": "ನಮಸ್ಕಾರ", + "emails.invitation.hello": "ನಮಸ್ಕಾರ,", "emails.invitation.body": "ಈ ಇಮೇಲ್ ನಿಮಗೆ ಬಂದಿದೆ ಏಕೆಂದರೆ {{owner}} ನಿಮ್ಮನ್ನು {{team}} ತಂಡದ {{project}}ರಲ್ಲಿ ಸದಸ್ಯ ಆಗಲಿಕ್ಕೆ ಆಹ್ವಾನಿಸಿದ್ದಾರೆ", "emails.invitation.footer": "ನಿಮಗೆ ಆಸಕ್ತಿಯಿಲ್ಲದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", - "emails.invitation.thanks": "ಧನ್ಯವಾದಗಳು", + "emails.invitation.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.invitation.signature": "{{project}} ತಂಡ", "locale.country.unknown": "Unknown", "countries.af": "ಅಫ್ಘಾನಿಸ್ತಾನ", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "ಈ ಇಮೇಲ್‌ಗೆ ಭದ್ರತಾ ಪದವು {{phrase}}. ನೀವು ಸೈನ್ ಇನ್ ಮಾಡುವಾಗ ತೋರಿಸಿದ ಪದವು ಇದರೊಂದಿಗೆ ಹೊಂದಿಕೊಂಡರೆ ಈ ಇಮೇಲನ್ನು ನೀವು ನಂಬಬಹುದು.", "emails.otpSession.thanks": "ಧನ್ಯವಾದಗಳು,", "emails.otpSession.signature": "ಪ್ರಾಜೆಕ್ಟ್ ತಂಡ" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ko.json b/app/config/locale/translations/ko.json index 372b7f1664..c33c961130 100644 --- a/app/config/locale/translations/ko.json +++ b/app/config/locale/translations/ko.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s 팀", "emails.verification.subject": "계정 인증", - "emails.verification.hello": "안녕하세요 {{user}}님", + "emails.verification.hello": "안녕하세요 {{user}}님、", "emails.verification.body": "이메일 인증을 위해 링크를 클릭하여주세요.", "emails.verification.footer": "이메일 인증을 부탁하지 않으셨다면 이 메시지를 무시하여주세요.", - "emails.verification.thanks": "감사합니다", + "emails.verification.thanks": "감사합니다、", "emails.verification.signature": "{{project}} 팀", "emails.magicSession.subject": "로그인", - "emails.magicSession.hello": "안녕하세요", + "emails.magicSession.hello": "안녕하세요、", "emails.magicSession.body": "로그인 하시려면 링크를 클릭하여주세요.", "emails.magicSession.footer": "이 이메일 계정으로 로그인 신청을 하지 않으셨다면 이 메세지를 무시하여주세요.", - "emails.magicSession.thanks": "감사합니다", + "emails.magicSession.thanks": "감사합니다、", "emails.magicSession.signature": "{{project}} 팀", "emails.recovery.subject": "비밀번호 재설정", - "emails.recovery.hello": "안녕하세요 {{user}}님", + "emails.recovery.hello": "안녕하세요 {{user}}님、", "emails.recovery.body": "{{project}}의 비밀번호 재설정을 위해 링크를 클릭하여주세요.", "emails.recovery.footer": "비밀번호 재설정 신청을 하지 않으셨다면 이 메세지를 무시하여주세요.", - "emails.recovery.thanks": "감사합니다", + "emails.recovery.thanks": "감사합니다、", "emails.recovery.signature": "{{project}} 팀", "emails.invitation.subject": "초대장 %s 팀 - %s", - "emails.invitation.hello": "안녕하세요", + "emails.invitation.hello": "안녕하세요、", "emails.invitation.body": "{{owner}}님이 귀하를 {{project}}의 {{team}} 팀으로 초대합니다.", "emails.invitation.footer": "팀에 합류할 의사가 없으시면 이 메세지를 무시하여주세요.", - "emails.invitation.thanks": "감사합니다", + "emails.invitation.thanks": "감사합니다、", "emails.invitation.signature": "{{project}} 팀", "locale.country.unknown": "알려지지 않은", "countries.af": "아프가니스탄", @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "이 이메일의 보안 구절은 {{phrase}}입니다. 로그인할 때 표시되는 구절과 일치한다면 이 이메일을 신뢰할 수 있습니다.", "emails.magicSession.optionUrl": "위의 버튼을 사용하여 로그인할 수 없다면, 다음 링크를 방문해 주세요:", "emails.otpSession.subject": "{{project}} 로그인", - "emails.otpSession.hello": "안녕하세요,", + "emails.otpSession.hello": "안녕하세요、", "emails.otpSession.description": "다음 인증 코드를 입력하면 보안을 유지하며 {{project}} 계정에 안전하게 로그인할 수 있습니다. 15분 후에 만료됩니다.", "emails.otpSession.clientInfo": "이 로그인은 {{agentClient}}을 사용하여 {{agentDevice}} {{agentOs}}에서 요청되었습니다. 로그인을 요청하지 않았다면, 이 이메일을 안심하고 무시하셔도 됩니다.", "emails.otpSession.securityPhrase": "이 이메일의 보안 구절은 {{phrase}}입니다. 로그인하는 동안 표시된 구절과 이 구절이 일치하면 이 이메일을 신뢰할 수 있습니다.", - "emails.otpSession.thanks": "감사합니다,", + "emails.otpSession.thanks": "감사합니다、", "emails.otpSession.signature": "{{project}} 팀" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/la.json b/app/config/locale/translations/la.json index 9ccbaba86e..bebef26854 100644 --- a/app/config/locale/translations/la.json +++ b/app/config/locale/translations/la.json @@ -4,28 +4,28 @@ "settings.direction": "ltr*", "emails.sender": "%s team", "emails.verification.subject": "Ratio comprobatio", - "emails.verification.hello": "Salve ibi {{user}}", + "emails.verification.hello": "Salve ibi {{user}},", "emails.verification.body": "Sequere hanc nexum ut quin inscriptionem tuum.", "emails.verification.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.", - "emails.verification.thanks": "Gratias", + "emails.verification.thanks": "Gratias,", "emails.verification.signature": "{{project}} Team", "emails.magicSession.subject": "Log in", - "emails.magicSession.hello": "Salve ibi", + "emails.magicSession.hello": "Salve ibi,", "emails.magicSession.body": "Hanc nexum cum login", "emails.magicSession.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.", - "emails.magicSession.thanks": "Gratias", + "emails.magicSession.thanks": "Gratias,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Recuperet password", - "emails.recovery.hello": "Salve ibi {{user}}", + "emails.recovery.hello": "Salve ibi {{user}},", "emails.recovery.body": "Sequere hanc conjunctionem ut recipias project password {{project}}", "emails.recovery.footer": "Si tesseram tuam recuperare non petis, nuntium hunc ignorare potes", - "emails.recovery.thanks": "Gratias", + "emails.recovery.thanks": "Gratias,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitatio pro %s in quadrigis %s", - "emails.invitation.hello": "Salve ibi", + "emails.invitation.hello": "Salve ibi,", "emails.invitation.body": "Haec inscriptio ad te missa est quia dominus incepto {{owner}} te invitare vult ut membrum {{team}} quadrigis fias ad {{project}}", "emails.invitation.footer": "Si non quaero, potes hunc nuntium ignorare", - "emails.invitation.thanks": "Gratias", + "emails.invitation.thanks": "Gratias,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ignotum", "countries.af": "Afghanistan", @@ -245,10 +245,10 @@ "emails.otpSession.thanks": "Gratias,", "emails.otpSession.signature": "{{project}} team -> {{project}} grex", "emails.certificate.subject": "Defectio testimonii pro %s", - "emails.certificate.hello": "Salve", + "emails.certificate.hello": "Salve,", "emails.certificate.body": "Certificatum pro dominio tuo '{{domain}}' generari non potuit. Hoc conatus num. {{attempt}} est, et defectus causatus est ab: {{error}}", "emails.certificate.footer": "Praeclarum tuum testificationem valet ad XXX dies a primo defectu. Magnopere suademus ut hoc casum investiges, alioquin dominium tuum sine valida SSL communicatione erit.", - "emails.certificate.thanks": "Gratias", + "emails.certificate.thanks": "Gratias,", "emails.certificate.signature": "team {{project}}", "sms.verification.body": "{{secret}}" } diff --git a/app/config/locale/translations/lb.json b/app/config/locale/translations/lb.json index 3f590d5323..91b52e4a18 100644 --- a/app/config/locale/translations/lb.json +++ b/app/config/locale/translations/lb.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Kont Verifikatioun", - "emails.verification.hello": "Hey {{user}}", + "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Follegt dëse Link fir Är E -Mail Adress z'iwwerpréiwen.", "emails.verification.footer": "Wann Dir net gefrot hutt dës Adress z'iwwerpréiwen, kënnt Dir dëse Message ignoréieren.", - "emails.verification.thanks": "Merci", + "emails.verification.thanks": "Merci,", "emails.verification.signature": "{{project}} équipe", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Hey", + "emails.magicSession.hello": "Hey,", "emails.magicSession.body": "Follegt dëse Link fir umellen.", "emails.magicSession.footer": "Wann Dir net gefrot hutt Iech mat dëser E -Mail anzemelden, kënnt Dir dëse Message ignoréieren.", - "emails.magicSession.thanks": "Merci", + "emails.magicSession.thanks": "Merci,", "emails.magicSession.signature": "{{project}} équipe", "emails.recovery.subject": "Password Reset", - "emails.recovery.hello": "Hello {{user}}", + "emails.recovery.hello": "Hello {{user}},", "emails.recovery.body": "Follegt dëse Link fir Äert {{project}} Passwuert zréckzesetzen.", "emails.recovery.footer": "Wann Dir net gefrot hutt Äert Passwuert zréckzesetzen, kënnt Dir dëse Message ignoréieren.", - "emails.recovery.thanks": "Merci", + "emails.recovery.thanks": "Merci,", "emails.recovery.signature": "{{project}} équipe", "emails.invitation.subject": "Invitatioun un %s équipe bei %s", - "emails.invitation.hello": "Hallo", + "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Dës E -Mail gouf un Iech geschéckt well {{owner}} Iech invitéiere wëllt fir Member vum {{team}} Team bei {{project}} ze ginn.", "emails.invitation.footer": "Wann Dir net interesséiert sidd, kënnt Dir dëse Message ignoréieren.", - "emails.invitation.thanks": "Merci", + "emails.invitation.thanks": "Merci,", "emails.invitation.signature": "{{project}} équipe", "locale.country.unknown": "Onbekannt", "countries.af": "Afghanistan", @@ -244,4 +244,4 @@ "emails.otpSession.securityPhrase": "D'Sécherheetsausso fir dësen E-Mail ass {{phrase}}. Dir kënnt dësem E-Mail vertrauen, wann dës Ausso mat der Ausso iwwereneestëmmt, déi beim Umellen gewise ginn ass.", "emails.otpSession.thanks": "Merci,", "emails.otpSession.signature": "{{project}} Equipe" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/lt.json b/app/config/locale/translations/lt.json index f72250c98e..94c874ce82 100644 --- a/app/config/locale/translations/lt.json +++ b/app/config/locale/translations/lt.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s komanda", "emails.verification.subject": "Paskyros Patvirtinimas", - "emails.verification.hello": "Labas {{user}}", + "emails.verification.hello": "Labas {{user}},", "emails.verification.body": "Spauskite šią nuorodą, kad patvirtintumėte savo el. paštą.", "emails.verification.footer": "Jei neprašėte patvirtinti šio el. pašto, galite ignoruoti šį pranešimą.", - "emails.verification.thanks": "Ačiū", + "emails.verification.thanks": "Ačiū,", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Prisijungti", - "emails.magicSession.hello": "Labas", + "emails.magicSession.hello": "Labas,", "emails.magicSession.body": "Spauskite šią nuorodą, kad prisijungtumėte.", "emails.magicSession.footer": "Jei neprašėte prisijungti naudojantis šiuo el. paštu, galite ignoruoti šį pranešimą.", - "emails.magicSession.thanks": "Ačiū", + "emails.magicSession.thanks": "Ačiū,", "emails.magicSession.signature": "{{project}} komanda", "emails.recovery.subject": "Slaptažodžio Atkūrimas", - "emails.recovery.hello": "Labas {{user}}", + "emails.recovery.hello": "Labas {{user}},", "emails.recovery.body": "Spauskite šią nuorodą, kad atkurtumėte projekto {{project}} slaptažodį.", "emails.recovery.footer": "Jei neprašėte atkurti savo slaptažodzio, galite ignoruoti šį pranešimą.", - "emails.recovery.thanks": "Ačiū", + "emails.recovery.thanks": "Ačiū,", "emails.recovery.signature": "{{project}} komanda", "emails.invitation.subject": "Pakvietimas į %s komandą %s projekte", - "emails.invitation.hello": "Labas", + "emails.invitation.hello": "Labas,", "emails.invitation.body": "Šis el. laiškas buvo atsiųstas jums, nes {{owner}} norėjo jus pakviesti tapti projekto {{project}} dalimi {{team}} komandoje.", "emails.invitation.footer": "Jei jūsų tai nedomina, galite ignoruoti šį pranešimą.", - "emails.invitation.thanks": "Ačiū", + "emails.invitation.thanks": "Ačiū,", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nežinoma", "countries.af": "Afganistanas", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Šio el. laiško saugumo frazė yra {{phrase}}. Galite pasitikėti šiuo el. laišku, jei ši frazė atitinka frazę, rodytą prisijungimo metu.", "emails.otpSession.thanks": "Ačiū,", "emails.otpSession.signature": "{{project}} komanda" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/lv.json b/app/config/locale/translations/lv.json index 66604a0e3e..b4a396367c 100644 --- a/app/config/locale/translations/lv.json +++ b/app/config/locale/translations/lv.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s komanda", "emails.verification.subject": "Konta verifikācija", - "emails.verification.hello": "Sveicināti, {{user}}", + "emails.verification.hello": "Sveicināti, {{user}},", "emails.verification.body": "Sekojiet saitei, lai apstiprinātu savu e-pasta adresi.", "emails.verification.footer": "Ja Jūs nepieprasījāt šīs adreses apstiprinājumu, lūdzu, ignorējiet šo ziņu.", - "emails.verification.thanks": "Paldies", + "emails.verification.thanks": "Paldies,", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Ieiet", - "emails.magicSession.hello": "Sveicināti", + "emails.magicSession.hello": "Sveicināti,", "emails.magicSession.body": "Sekojiet saitei, lai ieietu.", "emails.magicSession.footer": "Ja Jūs nepieprasījāt ieiet ar šo e-pasta adresi, lūdzu, ignorējiet šo ziņu.", - "emails.magicSession.thanks": "Paldies", + "emails.magicSession.thanks": "Paldies,", "emails.magicSession.signature": "{{project}} komanda", "emails.recovery.subject": "Paroles atjaunināšana", - "emails.recovery.hello": "Labdien, {{user}}", + "emails.recovery.hello": "Labdien, {{user}},", "emails.recovery.body": "Sekojiet saitei, lai atjauninātu {{project}} paroli.", "emails.recovery.footer": "Ja Jūs nepieprasījāt paroles atjaunināšanu, lūdzu, ignorējiet šo ziņu.", - "emails.recovery.thanks": "Paldies", + "emails.recovery.thanks": "Paldies,", "emails.recovery.signature": "{{project}} komanda", "emails.invitation.subject": "Ielūgums piebiedroties %s komandai %s projektā.", - "emails.invitation.hello": "Labdien", + "emails.invitation.hello": "Labdien,", "emails.invitation.body": "Šis e-pasts tika nosūtīts Jums, jo {{owner}} vēlējās Jūs ielūgt kļūt par {{team}} komandas biedru {{project}} projektā.", "emails.invitation.footer": "Ja Jūs neesat ieinteresēts, lūdzu, ignorējiet šo ziņu.", - "emails.invitation.thanks": "Paldies", + "emails.invitation.thanks": "Paldies,", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nav zināms", "countries.af": "Afganistāna", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Drošības frāze šim e-pastam ir {{phrase}}. Šim e-pastam var uzticēties, ja šī frāze sakrīt ar frāzi, kas parādīta pieslēdzoties.", "emails.otpSession.thanks": "Paldies,", "emails.otpSession.signature": "{{project}} komanda" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index 60e84e2a92..1b57d87865 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ടീം", "emails.verification.subject": "അക്കൗണ്ട് സ്ഥിരീകരണം", - "emails.verification.hello": "നമസ്കാരം {{user}}", + "emails.verification.hello": "നമസ്കാരം {{user}},", "emails.verification.body": "നിങ്ങളുടെ ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", "emails.verification.footer": "ഈ വിലാസം സ്ഥിരീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, നിങ്ങൾക്ക് ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", - "emails.verification.thanks": "നന്ദി", + "emails.verification.thanks": "നന്ദി,", "emails.verification.signature": "{{project}} ടീം", "emails.magicSession.subject": "ലോഗിൻ", - "emails.magicSession.hello": "നമസ്കാരം", + "emails.magicSession.hello": "നമസ്കാരം,", "emails.magicSession.body": "ലോഗിൻ ചെയ്യുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", "emails.magicSession.footer": "ഈ ഇമെയിൽ ഉപയോഗിച്ച് ലോഗിൻ ചെയ്യാൻ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", - "emails.magicSession.thanks": "നന്ദി", + "emails.magicSession.thanks": "നന്ദി,", "emails.magicSession.signature": "{{project}} ടീം", "emails.recovery.subject": "രഹസ്യവാക്ക് പുനക്രമീകരണം", - "emails.recovery.hello": "നമസ്കാരം {{user}}", + "emails.recovery.hello": "നമസ്കാരം {{user}},", "emails.recovery.body": "നിങ്ങളുടെ {{Project}} രഹസ്യവാക്ക് പുനക്രമീകരിക്കുന്നതിന് ഈ ലിങ്ക് പിന്തുടരുക.", "emails.recovery.footer": "നിങ്ങളുടെ രഹസ്യവാക്ക് പുനക്രമീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", - "emails.recovery.thanks": "നന്ദി", + "emails.recovery.thanks": "നന്ദി,", "emails.recovery.signature": "{{project}} ടീം", "emails.invitation.subject": "%s -ലെ %s ടീമിലേക്കുള്ള ക്ഷണം", - "emails.invitation.hello": "നമസ്കാരം", + "emails.invitation.hello": "നമസ്കാരം,", "emails.invitation.body": "നിങ്ങളെ {{project}} -ലെ {{team}} ടീമിലെ അംഗമാകുവാന്‍ ക്ഷണിക്കാൻ {{owner}} ആഗ്രഹിക്കുന്നതിനാലാണ് ഈ മെയിൽ നിങ്ങൾക്ക് അയക്കുന്നത്.", "emails.invitation.footer": "നിങ്ങൾക്ക് താൽപ്പര്യമില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", - "emails.invitation.thanks": "നന്ദി", + "emails.invitation.thanks": "നന്ദി,", "emails.invitation.signature": "{{project}} ടീം", "locale.country.unknown": "Unknown", "countries.af": "അഫ്ഗാനിസ്ഥാൻ", @@ -245,10 +245,10 @@ "emails.otpSession.thanks": "നന്ദി,", "emails.otpSession.signature": "പ്രോജക്ട് ടീം", "emails.certificate.subject": "%s ന് സർട്ടിഫിക്കറ്റ് പരാജയപ്പെട്ടു", - "emails.certificate.hello": "ഹലോ", + "emails.certificate.hello": "ഹലോ,", "emails.certificate.body": "നിങ്ങളുടെ ഡൊമൈൻ '{{domain}}'നു വേണ്ടിയുള്ള സർട്ടിഫിക്കറ്റ് ഉണ്ടാക്കാനായില്ല. ഇത് ശ്രമം നമ്പർ {{attempt}} ആണ്, പരാജയപ്പെട്ടത് ഇതു മൂലമാണ്: {{error}}", "emails.certificate.footer": "നിങ്ങളുടെ മുൻപത്തെ സർട്ടിഫിക്കറ്റ് ആദ്യ പരാജയത്തിനു ശേഷം 30 ദിവസം വരെ സാധുവായിരിക്കും. ഈ കേസ് അന്വേഷിച്ചു നോക്കുന്നത് ഞങ്ങൾ ശക്തമായി ശുപാർശ ചെയ്യുന്നു, അല്ലെങ്കിൽ നിങ്ങളുടെ ഡൊമെയ്‌ൻ സാധുവായ SSL കമ്മ്യൂണിക്കേഷനില്ലാത്ത ഒരു അവസ്ഥയിലാകും.", - "emails.certificate.thanks": "നന്ദി", + "emails.certificate.thanks": "നന്ദി,", "emails.certificate.signature": "{{project}} ടീം", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/mr.json b/app/config/locale/translations/mr.json index 4edd6bf617..6550d1c1ba 100644 --- a/app/config/locale/translations/mr.json +++ b/app/config/locale/translations/mr.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s टीम", "emails.verification.subject": "खाते सत्यापन", - "emails.verification.hello": "नमस्कार {{user}}", + "emails.verification.hello": "नमस्कार {{user}},", "emails.verification.body": "आपला ईमेल पत्ता सत्यापित करण्यासाठी या दुव्याचे अनुसरण करा.", "emails.verification.footer": "आपण या पत्त्याची पडताळणी करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", - "emails.verification.thanks": "धन्यवाद", + "emails.verification.thanks": "धन्यवाद,", "emails.verification.signature": "{{project}} संघ", "emails.magicSession.subject": "लॉगिन करा", - "emails.magicSession.hello": "नमस्कार ", + "emails.magicSession.hello": "नमस्कार ,", "emails.magicSession.body": "लॉगिन करण्यासाठी या लिंकचे अनुसरण करा.", "emails.magicSession.footer": "आपण या ईमेलचा वापर करून लॉगिन करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", - "emails.magicSession.thanks": "धन्यवाद", + "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} संघ", "emails.recovery.subject": "पासवर्ड रीसेट", - "emails.recovery.hello": "नमस्कार {{user}}", + "emails.recovery.hello": "नमस्कार {{user}},", "emails.recovery.body": "आपला {{project}}चे पासवर्ड रीसेट करण्यासाठी या लिंकचे अनुसरण करा", "emails.recovery.footer": "आपण आपला पासवर्ड रीसेट करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", - "emails.recovery.thanks": "धन्यवाद", + "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.signature": "{{project}} संघ", "emails.invitation.subject": "%s संघ %s येथे सामील होण्यासाठी आमंत्रण", - "emails.invitation.hello": "नमस्कार", + "emails.invitation.hello": "नमस्कार,", "emails.invitation.body": "हा मेल तुम्हाला पाठवला होता कारण {{owner}} तुम्हाला {{project}} येथे {{team}} टीमचे सदस्य होण्यासाठी आमंत्रित करू इच्छित होते.", "emails.invitation.footer": "आपल्याला स्वारस्य नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", - "emails.invitation.thanks": "धन्यवाद", + "emails.invitation.thanks": "धन्यवाद,", "emails.invitation.signature": "{{project}} संघ", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "या ईमेलसाठीचे सुरक्षा वाक्यांश {{phrase}} आहे. जर हे वाक्यांश साइन इन करताना दाखवल्या गेलेल्या वाक्यांशाशी जुळत असेल तर आपण या ईमेलवर विश्वास ठेवू शकता.", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} संघ" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ms.json b/app/config/locale/translations/ms.json index ded7587d34..a02c36b075 100644 --- a/app/config/locale/translations/ms.json +++ b/app/config/locale/translations/ms.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Pengesahan Akaun", - "emails.verification.hello": "Hey {{user}}", + "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Tekan pautan ini untuk mengesahkan alamat email anda.", "emails.verification.footer": "Sekiranya anda tidak membuat permintaan untuk mengesahkan email ini, sila abaikan mesej ini.", - "emails.verification.thanks": "Terima kasih", + "emails.verification.thanks": "Terima kasih,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Log masuk", - "emails.magicSession.hello": "Hey", + "emails.magicSession.hello": "Hey,", "emails.magicSession.body": "Tekan pautan ini untuk log masuk.", "emails.magicSession.footer": "Sekiranya anda tidak membuat permintaan untuk log masuk menggunakan email ini, sila abaikan mesej ini.", - "emails.magicSession.thanks": "Terima kasih", + "emails.magicSession.thanks": "Terima kasih,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Menetap semula Kata Laluan", - "emails.recovery.hello": "Hello {{user}}", + "emails.recovery.hello": "Hello {{user}},", "emails.recovery.body": "Tekan pautan ini untuk menetapkan semula kata laluan {{project}}.", "emails.recovery.footer": "Sekiranya anda tidak membuat permintaan menetap semula kata laluan, sila abaikan mesej ini.", - "emails.recovery.thanks": "Terima kasih", + "emails.recovery.thanks": "Terima kasih,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Jemputan ke pasukan %s di %s", - "emails.invitation.hello": "Hello", + "emails.invitation.hello": "Hello,", "emails.invitation.body": "Anda menerima mel ini kerana {{owner}} ingin menjemput anda untuk menjadi ahli pasukan {{team}} di {{project}}.", "emails.invitation.footer": "Sekiranya anda tidak berminat, sila abaikan mesej ini.", - "emails.invitation.thanks": "Terima kasih", + "emails.invitation.thanks": "Terima kasih,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Tidak Diketahui", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Frasa keselamatan untuk email ini adalah {{phrase}}. Anda boleh mempercayai email ini jika frasa ini sepadan dengan frasa yang ditunjukkan semasa log masuk.", "emails.otpSession.thanks": "Terima kasih,", "emails.otpSession.signature": "pasukan {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/nb.json b/app/config/locale/translations/nb.json index f8680e8993..daf18abc1c 100644 --- a/app/config/locale/translations/nb.json +++ b/app/config/locale/translations/nb.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Kontobekreftelse", - "emails.verification.hello": "Hei {{user}}", + "emails.verification.hello": "Hei {{user}},", "emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.", "emails.verification.footer": "Dersom du ikke ba om å bekrefte e-postadressen, kan du se bort fra denne meldingen.", - "emails.verification.thanks": "Takk", + "emails.verification.thanks": "Takk,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", - "emails.magicSession.hello": "Hei", + "emails.magicSession.hello": "Hei,", "emails.magicSession.body": "Følg denne lenken for å logge på.", "emails.magicSession.footer": "Dersom du ikke ba om å logge på med denne e-postadressen, kan du se bort fra denne meldingen.", - "emails.magicSession.thanks": "Takk", + "emails.magicSession.thanks": "Takk,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nullstille passord", - "emails.recovery.hello": "Hei {{user}}", + "emails.recovery.hello": "Hei {{user}},", "emails.recovery.body": "Følg denne lenken for å nullstille ditt {{project}} passord.", "emails.recovery.footer": "Dersom du ikke ba om å nullstille passordet ditt, kan du se bort fra denne meldingen.", - "emails.recovery.thanks": "Takk", + "emails.recovery.thanks": "Takk,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitasjon til %s Team ved %s", - "emails.invitation.hello": "Hei", + "emails.invitation.hello": "Hei,", "emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team ved {{project}}.", "emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.", - "emails.invitation.thanks": "Takk", + "emails.invitation.thanks": "Takk,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjent", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Sikkerhetsfrasen for denne e-posten er {{phrase}}. Du kan stole på denne e-posten hvis denne frasen stemmer overens med frasen som ble vist under pålogging.", "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}} team" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ne.json b/app/config/locale/translations/ne.json index f31609eafc..4f05a9b5ba 100644 --- a/app/config/locale/translations/ne.json +++ b/app/config/locale/translations/ne.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s समूह", "emails.verification.subject": "खाता प्रमाणिकरण", - "emails.verification.hello": "नमस्ते {{user}}", + "emails.verification.hello": "नमस्ते {{user}},", "emails.verification.body": "इमेल ठेगाना प्रमाणित गर्नको लागी यो लिंकमा जानुहोस।", "emails.verification.footer": "यदि तपाइँले आफ्नो खाता प्रमाणित गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", - "emails.verification.thanks": "धन्यवाद", + "emails.verification.thanks": "धन्यवाद,", "emails.verification.signature": "{{project}} समूह", "emails.magicSession.subject": "लगइन", - "emails.magicSession.hello": "नमस्ते", + "emails.magicSession.hello": "नमस्ते,", "emails.magicSession.body": "लगइन गर्नको लागी यो लिंकमा जानुहोस।", "emails.magicSession.footer": "यदि तपाइँले यो इमेल प्रयोग गरेर लगइन गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", - "emails.magicSession.thanks": "धन्यवाद", + "emails.magicSession.thanks": "धन्यवाद,", "emails.magicSession.signature": "{{project}} समूह", "emails.recovery.subject": "पासवर्ड रिसेट", - "emails.recovery.hello": "नमस्ते {{user}}", + "emails.recovery.hello": "नमस्ते {{user}},", "emails.recovery.body": "{{project}}को पासवर्ड रिसेट गर्नको लागी यो लिंकमा जानुहोस।", "emails.recovery.footer": "यदि तपाइँले आफ्नो पासवर्ड रिसेट गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", - "emails.recovery.thanks": "धन्यवाद", + "emails.recovery.thanks": "धन्यवाद,", "emails.recovery.signature": "{{project}} समूह", "emails.invitation.subject": "%s समूहको लागि %s मा निमन्त्रणा", - "emails.invitation.hello": "नमस्ते", + "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "{{owner}}ले तपाइँलाई {{project}}मा {{team}}को सदस्य बन्न आमन्त्रित गर्न चाहनु भएको छ। त्येसैले तपाइँलाई यो सन्देश पठाइएको हो।", "emails.invitation.footer": "यदि तपाइँ इच्छुक हुनुहुन्न भने, तपाइँले यो सन्देशलाई बेवास्ता गर्न सक्नुहुन्छ।", - "emails.invitation.thanks": "धन्यवाद", + "emails.invitation.thanks": "धन्यवाद,", "emails.invitation.signature": "{{project}} समूह", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "यस ईमेलको लागि सुरक्षा वाक्य {{phrase}} हो। यदि यो वाक्य साइन इन गर्दा देखाइएको वाक्यसँग मेल खान्छ भने तपाईँले यो ईमेलमा विश्वास गर्न सक्नुहुन्छ।", "emails.otpSession.thanks": "धन्यवाद,", "emails.otpSession.signature": "{{project}} टिम" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/nl.json b/app/config/locale/translations/nl.json index 55e48fa753..cae82a9a37 100644 --- a/app/config/locale/translations/nl.json +++ b/app/config/locale/translations/nl.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Account Verificatie", - "emails.verification.hello": "Hoi {{user}}", + "emails.verification.hello": "Hoi {{user}},", "emails.verification.body": "Volg deze link om uw e-mail te verifieren", "emails.verification.footer": "Als u geen aanvraag voor verificatie heeft gemaakt, kan u deze mail negeren", - "emails.verification.thanks": "Bedankt", + "emails.verification.thanks": "Bedankt,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Hoi", + "emails.magicSession.hello": "Hoi,", "emails.magicSession.body": "Volg deze link om in te loggen", "emails.magicSession.footer": "Als u geen aanvraag heeft gemaakt om met deze mail in te loggen, kan u deze mail negeren", - "emails.magicSession.thanks": "Bedankt", + "emails.magicSession.thanks": "Bedankt,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Wachtwoord Herinstellen", - "emails.recovery.hello": "Hallo {{user}}", + "emails.recovery.hello": "Hallo {{user}},", "emails.recovery.body": "Volg deze link om het wachtwoord van uw project {{project}} te wijzigen", "emails.recovery.footer": "Als u geen aanvraag heeft gemaakt om uw wachtwoord te wijzigen, kan u deze mail negeren", - "emails.recovery.thanks": "Bedankt", + "emails.recovery.thanks": "Bedankt,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Uitnodiging van %s Team uit %s", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "U ontvangt deze mail want u was uitgenodig door {{owner}} om lid van het {{team}} team te worden in {{project}} ", "emails.invitation.footer": "Als u niet geintereseerd bent, kan u deze mail negeren.", - "emails.invitation.thanks": "Bedankt", + "emails.invitation.thanks": "Bedankt,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "De beveiligingszin voor deze e-mail is {{phrase}}. U kunt deze e-mail vertrouwen als deze zin overeenkomt met de zin die wordt getoond tijdens het inloggen.", "emails.otpSession.thanks": "Bedankt,", "emails.otpSession.signature": "{{project}} team" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/nn.json b/app/config/locale/translations/nn.json index 6ab037466f..44be0f9845 100644 --- a/app/config/locale/translations/nn.json +++ b/app/config/locale/translations/nn.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Team", "emails.verification.subject": "Kontostadfesting", - "emails.verification.hello": "Hallo {{user}}", + "emails.verification.hello": "Hallo {{user}},", "emails.verification.body": "Følg denne lenkja for å bekrefta din e-postadresse.", "emails.verification.footer": "Om du ikkje bad om å bekrefta e-postadressa, kan du ignorera denne meldinga.", - "emails.verification.thanks": "Takk", + "emails.verification.thanks": "Takk,", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", - "emails.magicSession.hello": "Hei", + "emails.magicSession.hello": "Hei,", "emails.magicSession.body": "Følg denne lenkja for å logge på.", "emails.magicSession.footer": "Om du ikkje ba om å logge på med denne e-postadressa, kan du ignorera denne meldinga.", - "emails.magicSession.thanks": "Takk", + "emails.magicSession.thanks": "Takk,", "emails.magicSession.signature": "{{project}} team", "emails.recovery.subject": "Nullstilla passord", - "emails.recovery.hello": "Hallo {{user}}", + "emails.recovery.hello": "Hallo {{user}},", "emails.recovery.body": "Følg denne lenkja for å nullstilla ditt {{project}} passord.", "emails.recovery.footer": "Om du ikkje ba om å nullstilla passordet ditt, kan du ignorera denne meldinga.", - "emails.recovery.thanks": "Takk", + "emails.recovery.thanks": "Takk,", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Innbyding til %s Team ved %s", - "emails.invitation.hello": "Hallo", + "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Denne meldinga ble sendt til deg fordi {{owner}} ynskja å invitera deg til å bli medlem av {{team}} team i {{project}}.", "emails.invitation.footer": "Om du ikkje er interessert, kan du ignorera denne meldinga.", - "emails.invitation.thanks": "Takk", + "emails.invitation.thanks": "Takk,", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjend", "countries.af": "Afghanistan", @@ -245,10 +245,10 @@ "emails.otpSession.thanks": "Takk,", "emails.otpSession.signature": "{{project}}-laget", "emails.certificate.subject": "Sertifikatfeil for %s", - "emails.certificate.hello": "Hei", + "emails.certificate.hello": "Hei,", "emails.certificate.body": "Sertifikatet for domenet ditt '{{domain}}' kunne ikkje opprettast. Dette er forsøk nr. {{attempt}}, og feilen blei forårsaka av: {{error}}", "emails.certificate.footer": "Førre sertifikatet ditt vil vere gyldig i 30 dagar sidan den første feilen. Vi rår sterkt til at du undersøkjer denne saka, elles vil domenet ditt ende opp utan gyldig SSL-kommunikasjon.", - "emails.certificate.thanks": "Takk", + "emails.certificate.thanks": "Takk,", "emails.certificate.signature": "{{project}} team", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index 08b150fbb7..efd516f23a 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ଦଳ", "emails.verification.subject": "ଖାତା ଯାଞ୍ଚ", - "emails.verification.hello": "ନମସ୍କାର {{user}}", + "emails.verification.hello": "ନମସ୍କାର {{user}},", "emails.verification.body": "ଆପଣଙ୍କର ଇମେଲ୍ ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", "emails.verification.footer": "ଯଦି ଆପଣ ଏହି ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", - "emails.verification.thanks": "ଧନ୍ୟବାଦ", + "emails.verification.thanks": "ଧନ୍ୟବାଦ,", "emails.verification.signature": "{{project}} ଦଳ", "emails.magicSession.subject": "ଲଗଇନ୍ କରନ୍ତୁ", - "emails.magicSession.hello": "ନମସ୍କାର", + "emails.magicSession.hello": "ନମସ୍କାର,", "emails.magicSession.body": "ଲଗଇନ୍ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", "emails.magicSession.footer": "ଯଦି ଆପଣ ଏହି ଇମେଲ୍ ବ୍ୟବହାର କରି ଲଗଇନ୍ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", - "emails.magicSession.thanks": "ଧନ୍ୟବାଦ", + "emails.magicSession.thanks": "ଧନ୍ୟବାଦ,", "emails.magicSession.signature": "{{project}} ଦଳ", "emails.recovery.subject": "ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରନ୍ତୁ |", - "emails.recovery.hello": "ନମସ୍କାର {{user}}", + "emails.recovery.hello": "ନମସ୍କାର {{user}},", "emails.recovery.body": "ଆପଣଙ୍କର {{project}} ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ ଏହି ଲିଙ୍କକୁ ଅନୁସରଣ କରନ୍ତୁ |", "emails.recovery.footer": "ଯଦି ଆପଣ ଆପଣଙ୍କର ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", - "emails.recovery.thanks": "ଧନ୍ୟବାଦ", + "emails.recovery.thanks": "ଧନ୍ୟବାଦ,", "emails.recovery.signature": "{{project}} ଦଳ", "emails.invitation.subject": "%s ରେ %s ଦଳକୁ ନିମନ୍ତ୍ରଣ |", - "emails.invitation.hello": "ନମସ୍କାର", + "emails.invitation.hello": "ନମସ୍କାର,", "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", "emails.invitation.footer": "ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |", - "emails.invitation.thanks": "ଧନ୍ୟବାଦ", + "emails.invitation.thanks": "ଧନ୍ୟବାଦ,", "emails.invitation.signature": "{{project}} ଦଳ", "locale.country.unknown": "ଅଜ୍ଞାତ", "countries.af": "ଆଫଗାନିସ୍ତାନ", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "ଏହି ଇମେଲର ସୁରକ୍ଷା ବାକ୍ୟାଂଶ ହେଉଛି {{phrase}}। ସାଇନ୍ ଇନ୍ କରିବା ସମୟରେ ଦେଖାଯାଇଥିବା ବାକ୍ୟାଂଶ ସହ ଏହା ମେଳେ ଯଦି, ଆପଣ ଏହି ଇମେଲକୁ ଆସ୍ଥା କରି ପାରିବେ।", "emails.otpSession.thanks": "ଧନ୍ୟବାଦ,", "emails.otpSession.signature": "ପ୍ରକଳ୍ପ ଟିମ୍ବ୍" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/pa.json b/app/config/locale/translations/pa.json index 76efde346b..de71be9f49 100644 --- a/app/config/locale/translations/pa.json +++ b/app/config/locale/translations/pa.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ਟੀਮ", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "ਅਣਜਾਣ", "countries.af": "ਅਫਗਾਨਿਸਤਾਨ", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "ਇਸ ਈਮੇਲ ਲਈ ਸੁਰੱਖਿਆ ਵਾਕ ਹੈ {{phrase}}। ਜੇ ਇਹ ਵਾਕ ਸਾਈਨ ਇਨ ਕਰਨ ਸਮੇਂ ਦਿਖਾਈ ਦੇਣ ਵਾਲੇ ਵਾਕ ਨਾਲ ਮੇਲ ਖਾਂਦਾ ਹੈ ਤਾਂ ਤੁਸੀਂ ਇਸ ਈਮੇਲ 'ਤੇ ਭਰੋਸਾ ਕਰ ਸਕਦੇ ਹੋ।", "emails.otpSession.thanks": "ਧੰਨਵਾਦ,", "emails.otpSession.signature": "{{project}} ਟੀਮ" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/pl.json b/app/config/locale/translations/pl.json index e596d2c04b..ee5811fb59 100644 --- a/app/config/locale/translations/pl.json +++ b/app/config/locale/translations/pl.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Zespół %s", "emails.verification.subject": "Weryfikacja konta", - "emails.verification.hello": "Cześć {{user}}", + "emails.verification.hello": "Cześć {{user}},", "emails.verification.body": "Przejdź do tego linku, aby zweryfikować swój adres e-mail.", "emails.verification.footer": "Jeśli to nie Ty prosiłeś o zweryfikowanie tego adresu, zignoruj tę wiadomość.", - "emails.verification.thanks": "Dziękujemy", + "emails.verification.thanks": "Dziękujemy,", "emails.verification.signature": "Zespół {{project}}", "emails.magicSession.subject": "Logowanie", - "emails.magicSession.hello": "Cześć", + "emails.magicSession.hello": "Cześć,", "emails.magicSession.body": "Kliknij w ten link, aby zalogować się.", "emails.magicSession.footer": "Jeśli to nie Ty prosiłeś o logowanie przy użyciu tego adresu e-mail, zignoruj tę wiadomość.", - "emails.magicSession.thanks": "Dziękujemy", + "emails.magicSession.thanks": "Dziękujemy,", "emails.magicSession.signature": "Zespół {{project}}", "emails.recovery.subject": "Resetowanie hasła", - "emails.recovery.hello": "Cześć {{user}}", + "emails.recovery.hello": "Cześć {{user}},", "emails.recovery.body": "Przejdź do tego linku, aby zresetować hasło dla {{project}}.", "emails.recovery.footer": "Jeśli to nie Ty prosiłeś o zresetowanie swojego hasła, zignoruj tę wiadomość.", - "emails.recovery.thanks": "Dziękujemy", + "emails.recovery.thanks": "Dziękujemy,", "emails.recovery.signature": "Zespół {{project}}", "emails.invitation.subject": "Zaproszenie do zespołu %s w %s", - "emails.invitation.hello": "Cześć", + "emails.invitation.hello": "Cześć,", "emails.invitation.body": "Otrzymujesz tę wiadomość, ponieważ {{owner}} zaprasza Cię do grona członków zespołu {{team}} w projekcie {{project}}.", "emails.invitation.footer": "Jeśli nie jesteś zainteresowany, zignoruj tę wiadomość.", - "emails.invitation.thanks": "Dziękujemy", + "emails.invitation.thanks": "Dziękujemy,", "emails.invitation.signature": "Zespół {{project}}", "locale.country.unknown": "Nieznany", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Hasłem zabezpieczającym dla tego e-maila jest {{phrase}}. Możesz zaufać temu e-mailowi, jeśli hasło zgadza się z hasłem wyświetlonym podczas logowania.", "emails.otpSession.thanks": "Dzięki,", "emails.otpSession.signature": "team {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/pt-br.json b/app/config/locale/translations/pt-br.json index b2c4931011..a53ca79813 100644 --- a/app/config/locale/translations/pt-br.json +++ b/app/config/locale/translations/pt-br.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Time %s", "emails.verification.subject": "Verificação da Conta", - "emails.verification.hello": "Olá {{user}}", + "emails.verification.hello": "Olá {{user}},", "emails.verification.body": "Clique neste link para verificar o seu endereço de e-mail.", "emails.verification.footer": "Se você não solicitou a verificação deste e-mail, ignore essa mensagem.", - "emails.verification.thanks": "Muito obrigado", + "emails.verification.thanks": "Muito obrigado,", "emails.verification.signature": "Time {{project}}", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Olá", + "emails.magicSession.hello": "Olá,", "emails.magicSession.body": "Clique neste link para entrar.", "emails.magicSession.footer": "Se você não solicitou conectar-se com este e-mail, ignore essa mensagem.", - "emails.magicSession.thanks": "Muito obrigado", + "emails.magicSession.thanks": "Muito obrigado,", "emails.magicSession.signature": "Time {{project}}", "emails.recovery.subject": "Redefinição de senha", - "emails.recovery.hello": "Olá {{user}}", + "emails.recovery.hello": "Olá {{user}},", "emails.recovery.body": "Clique neste link para redefinir sua senha do {{project}}.", "emails.recovery.footer": "Se você não solicitou a redefinição da sua senha, você pode ignorar essa mensagem.", - "emails.recovery.thanks": "Muito obrigado", + "emails.recovery.thanks": "Muito obrigado,", "emails.recovery.signature": "Time {{project}}", "emails.invitation.subject": "Convite para o Time %s em %s", - "emails.invitation.hello": "Olá", + "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este e-mail foi enviado porque {{owner}} deseja convidar você a se tornar membro do Time {{team}} em {{project}}.", "emails.invitation.footer": "Caso não tenha interesse, ignore essa mensagem.", - "emails.invitation.thanks": "Muito obrigado", + "emails.invitation.thanks": "Muito obrigado,", "emails.invitation.signature": "Time {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "A frase de segurança para este e-mail é {{phrase}}. Você pode confiar neste e-mail se esta frase corresponder à frase mostrada durante o login.", "emails.otpSession.thanks": "Obrigado,", "emails.otpSession.signature": "equipe {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/pt-pt.json b/app/config/locale/translations/pt-pt.json index 2dab03c9dd..d85dca9300 100644 --- a/app/config/locale/translations/pt-pt.json +++ b/app/config/locale/translations/pt-pt.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Equipa %s", "emails.verification.subject": "Verificação de contas", - "emails.verification.hello": "Hey {{user}}", + "emails.verification.hello": "Hey {{user}},", "emails.verification.body": "Siga esta ligação para verificar o seu endereço de correio electrónico.", "emails.verification.footer": "Se não pediu para verificar este endereço, pode ignorar esta mensagem.", - "emails.verification.thanks": "Obrigado", + "emails.verification.thanks": "Obrigado,", "emails.verification.signature": "Equipa {{project}}", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Olá ", + "emails.magicSession.hello": "Olá ,", "emails.magicSession.body": "Siga esta ligação para iniciar sessão.", "emails.magicSession.footer": "Se não pediu para entrar usando este e-mail, pode ignorar esta mensagem.", - "emails.magicSession.thanks": "Obrigado", + "emails.magicSession.thanks": "Obrigado,", "emails.magicSession.signature": "Equipa {{project}}", "emails.recovery.subject": "Redefinição de senha", - "emails.recovery.hello": "Olá {{user}}", + "emails.recovery.hello": "Olá {{user}},", "emails.recovery.body": "Utilize este link para redefinir a palavra-passe do seu projecto {{project}}", "emails.recovery.footer": "Se não pediu para redefinir a sua palavra-passe, pode ignorar esta mensagem.", - "emails.recovery.thanks": "Obrigado", + "emails.recovery.thanks": "Obrigado,", "emails.recovery.signature": "Equipa {{project}}", "emails.invitation.subject": "Convite à equipa de %s às %s", - "emails.invitation.hello": "Olá", + "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este correio foi-lhe enviado porque {{owner}} queria convidá-lo a tornar-se membro da equipa {{team}} da {{project}}.", "emails.invitation.footer": "Se não estiver interessado, pode ignorar esta mensagem.", - "emails.invitation.thanks": "Obrigado", + "emails.invitation.thanks": "Obrigado,", "emails.invitation.signature": "Equipa {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "A frase de segurança para este email é {{phrase}}. Você pode confiar neste email se essa frase corresponder à frase mostrada durante o login.", "emails.otpSession.thanks": "Obrigado,", "emails.otpSession.signature": "equipe {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ro.json b/app/config/locale/translations/ro.json index 45fb71d190..04cb22dd6b 100644 --- a/app/config/locale/translations/ro.json +++ b/app/config/locale/translations/ro.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Echipa", "emails.verification.subject": "Verificare cont", - "emails.verification.hello": "Bună ziua, {{user}}", + "emails.verification.hello": "Bună ziua, {{user}},", "emails.verification.body": "Click pe acest link pentru a valida adresa de email.", "emails.verification.footer": "Dacă nu ai cerut validarea adresei de email, poți ignora acest mesaj.", - "emails.verification.thanks": "Mulțumim", + "emails.verification.thanks": "Mulțumim,", "emails.verification.signature": "Echipa {{project}}", "emails.magicSession.subject": "Login", - "emails.magicSession.hello": "Bună ziua", + "emails.magicSession.hello": "Bună ziua,", "emails.magicSession.body": "Urmează acest link pentru logare.", "emails.magicSession.footer": "Dacă nu ai incercat să te loghezi folosing această adresa de email, poți ignora acest mesaj.", - "emails.magicSession.thanks": "Mulțumim", + "emails.magicSession.thanks": "Mulțumim,", "emails.magicSession.signature": "Echipa {{project}}", "emails.recovery.subject": "Resetare parolă", - "emails.recovery.hello": "Bună ziua, {{user}}", + "emails.recovery.hello": "Bună ziua, {{user}},", "emails.recovery.body": "Click aici pentru a reseta parola pentru {{project}}", "emails.recovery.footer": "Dacă nu ai cerut să îți schimbi parola, ignoră acest mesaj.", - "emails.recovery.thanks": "Mulțumim", + "emails.recovery.thanks": "Mulțumim,", "emails.recovery.signature": "Echipa {{project}}", "emails.invitation.subject": "Invitatie catre %s Echipa la %s", - "emails.invitation.hello": "Bună ziua", + "emails.invitation.hello": "Bună ziua,", "emails.invitation.body": "Acest email a fost trimis pentru că {{owner}} a vrut ca tu să devii membru al echipei {{team}} la {{project}}.", "emails.invitation.footer": "Dacă nu esti interesat, poți ignora acest email.", - "emails.invitation.thanks": "Mulțumim", + "emails.invitation.thanks": "Mulțumim,", "emails.invitation.signature": "Echipa {{project}}", "locale.country.unknown": "Necunoscut", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Fraza de securitate pentru acest e-mail este {{phrase}}. Puteți avea încredere în acest e-mail dacă fraza se potrivește cu cea afișată în timpul autentificării.", "emails.otpSession.thanks": "Mulțumesc,", "emails.otpSession.signature": "echipa {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ru.json b/app/config/locale/translations/ru.json index a1d740bea2..029aa06ee7 100644 --- a/app/config/locale/translations/ru.json +++ b/app/config/locale/translations/ru.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Команда %s", "emails.verification.subject": "Верификация аккаунта", - "emails.verification.hello": "Здравствуйте, {{user}}", + "emails.verification.hello": "Здравствуйте, {{user}},", "emails.verification.body": "Перейдите по ссылке, чтобы подтвердить свой адрес электронной почты.", "emails.verification.footer": "Если вы не запрашивали подтверждение этого адреса, проигнорируйте это сообщение.", - "emails.verification.thanks": "Спасибо", + "emails.verification.thanks": "Спасибо,", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логин", - "emails.magicSession.hello": "Здравствуйте", + "emails.magicSession.hello": "Здравствуйте,", "emails.magicSession.body": "Перейдите по ссылке, чтобы войти.", "emails.magicSession.footer": "Если вы не просили войти, используя этот адрес электронной почты, проигнорируйте это сообщение.", - "emails.magicSession.thanks": "Спасибо", + "emails.magicSession.thanks": "Спасибо,", "emails.magicSession.signature": "команда {{project}}", "emails.recovery.subject": "Сброс пароля", - "emails.recovery.hello": "Здравствуйте, {{user}}", + "emails.recovery.hello": "Здравствуйте, {{user}},", "emails.recovery.body": "Перейдите по этой ссылке для того чтобы сбросить свой пароль для проекта {{project}}", "emails.recovery.footer": "Если вы не запрашивали сброс пароля, проигнорируйте это сообщение.", - "emails.recovery.thanks": "Спасибо", + "emails.recovery.thanks": "Спасибо,", "emails.recovery.signature": "команда {{project}}", "emails.invitation.subject": "Приглашение в команду %s по проекту %s", - "emails.invitation.hello": "Здравствуйте", + "emails.invitation.hello": "Здравствуйте,", "emails.invitation.body": "Это письмо отправлено вам, потому что {{owner}} приглашает стать членом команды {{team}} в проекте {{project}}.", "emails.invitation.footer": "Если вы не заинтересованы, проигнорируйте это сообщение.", - "emails.invitation.thanks": "Спасибо", + "emails.invitation.thanks": "Спасибо,", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Неизвестно", "countries.af": "Афганистан", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Фраза безопасности для этого письма {{phrase}}. Вы можете доверять этому письму, если эта фраза совпадает с фразой, показанной во время входа в систему.", "emails.otpSession.thanks": "Спасибо,", "emails.otpSession.signature": "команда {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sa.json b/app/config/locale/translations/sa.json index b82a3ed9ba..7aa8c90d77 100644 --- a/app/config/locale/translations/sa.json +++ b/app/config/locale/translations/sa.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s गणः", "emails.verification.subject": "पञ्जिकानिर्णायनम्‌", - "emails.verification.hello": "अयि {{user}}", + "emails.verification.hello": "अयि {{user}},", "emails.verification.body": "ई-पत्रनिर्णायनार्थमिदं संयोगसूत्रमनुसरतु।", "emails.verification.footer": "यदि अस्य संकेतस्य निर्णायनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", - "emails.verification.thanks": "धन्यवादः", + "emails.verification.thanks": "धन्यवादः,", "emails.verification.signature": "{{project}} गणः", "emails.magicSession.subject": "संप्रवेशः", - "emails.magicSession.hello": "अयि", + "emails.magicSession.hello": "अयि,", "emails.magicSession.body": "संप्रवेशार्थमिदं संयोगसूत्रमनुसरतु।", "emails.magicSession.footer": "अनेन ई-पत्रण यदि संप्रवेशो नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", - "emails.magicSession.thanks": "धन्यवादः", + "emails.magicSession.thanks": "धन्यवादः,", "emails.magicSession.signature": "{{project}} गणः", "emails.recovery.subject": "कूटशब्दपुनयाेजनम्‌", - "emails.recovery.hello": "अयि भो {{user}}", + "emails.recovery.hello": "अयि भो {{user}},", "emails.recovery.body": "{{project}} कूटशब्दपुनयाेजनाय संयोगमेनमनुसरतु।", "emails.recovery.footer": "यदि कूटशब्दस्य पुनयाेजनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", - "emails.recovery.thanks": "धन्यवादः", + "emails.recovery.thanks": "धन्यवादः,", "emails.recovery.signature": "{{project}} गणः", "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ %s इति %s", - "emails.invitation.hello": "अयि भो", + "emails.invitation.hello": "अयि भो,", "emails.invitation.body": "{{owner}} {{team}} गणे {{project}} मध्ये भवद्योगदानमच्छितीति हेतोः पत्रमदिं भवत्सकाशं प्रेषतिम्।", "emails.invitation.footer": "यदि भवदनिच्छा तर्हि वात्र्तामिमामुपेक्षताम्‌।", - "emails.invitation.thanks": "धन्यवादः", + "emails.invitation.thanks": "धन्यवादः,", "emails.invitation.signature": "{{project}} गणः", "locale.country.unknown": "अज्ञातम्‌ ", "countries.af": "आफगानिस्थानम्‌", @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "العبارة الأمنية لهذا البريد الإلكتروني هي {{phrase}}. يمكنك الوثوق بهذا البريد الإلكتروني إذا كانت هذه العبارة متطابقة مع العبارة المعروضة أثناء تسجيل الدخول.", "emails.magicSession.optionUrl": "إذا لم تتمكن من تسجيل الدخول باستخدام الزر أعلاه، يرجى زيارة الرابط التالي:", "emails.otpSession.subject": "प्रवेशनम्", - "emails.otpSession.hello": "नमस्ते।", + "emails.otpSession.hello": "नमस्ते।,", "emails.otpSession.description": "प्रविष्ट कुरु अनुसृत विश्वासनीयकोडम् यदा पृच्छ्यसे भवतः {{project}} खातायां सुरक्षितरूपेण प्रवेशे। एषः पन्द्रह मिनितेषु समाप्तिं गच्छति।", "emails.otpSession.clientInfo": "एष प्रवेशनं प्रार्थितं {{agentClient}} नाम प्रतिनिधौ {{agentDevice}} {{agentOs}} इत्यस्मिन्। यदि त्वमेव प्रवेशनं न प्रार्थितवानसि, तर्हि त्वमनेन ईपत्रेण उपेक्षितुं शक्नोसि।", "emails.otpSession.securityPhrase": "अस्य ईमेलस्य सुरक्षा वाक्यं {{phrase}} अस्ति। यदि अयं वाक्यः प्रवेशकाले दृष्टवाक्येन साम्यं याति तर्हि अस्माकं ईमेलं विश्वसनीयम् अस्ति।", - "emails.otpSession.thanks": "धन्यवादाः", + "emails.otpSession.thanks": "धन्यवादाः,", "emails.otpSession.signature": "कार्यक्रमस्य समूहः" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sd.json b/app/config/locale/translations/sd.json index 69cad52549..3f1f7678db 100644 --- a/app/config/locale/translations/sd.json +++ b/app/config/locale/translations/sd.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s ٽيم", "emails.verification.subject": " اڪائونٽ جي تصديق", - "emails.verification.hello": "سلام {{user}}", + "emails.verification.hello": "سلام {{user}},", "emails.verification.body": "پنھنجي اي ميل ايڊريس جي تصديق ڪرڻ لاءِ ھن لنڪ تي عمل ڪريو.", "emails.verification.footer": "جيڪڏھن توھان نه پ askيا ھئا ھن ايڊريس جي تصديق ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", - "emails.verification.thanks": "مهرباني", + "emails.verification.thanks": "مهرباني,", "emails.verification.signature": "{{project}} ٽيم", "emails.magicSession.subject": "لاگ ان", - "emails.magicSession.hello": "هي ،", + "emails.magicSession.hello": "هي ,", "emails.magicSession.body": "لاگ ان ٿيڻ لاءِ ھن لنڪ تي عمل ڪريو.", "emails.magicSession.footer": "جيڪڏھن توھان نه پ پيا ھي لاگ ان استعمال ڪندي اي ميل ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", - "emails.magicSession.thanks": "مهرباني", + "emails.magicSession.thanks": "مهرباني,", "emails.magicSession.signature": "{{project}} ٽيم", "emails.recovery.subject": "پاسورڊ ري سيٽ", - "emails.recovery.hello": "هيلو {{user}}", + "emails.recovery.hello": "هيلو {{user}},", "emails.recovery.body": "ھن لنڪ تي عمل ڪريو پنھنجو {{project}} پاسورڊ ري سيٽ ڪرڻ لاءِ.", "emails.recovery.footer": "جيڪڏھن توھان نه پ پيو ھو پنھنجي پاسورڊ کي ري سيٽ ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", - "emails.recovery.thanks": "مهرباني", + "emails.recovery.thanks": "مهرباني,", "emails.recovery.signature": "{{project}} ٽيم", "emails.invitation.subject": "%s ٽيم %s تيجي دعوت", - "emails.invitation.hello": "هيلو", + "emails.invitation.hello": "هيلو,", "emails.invitation.body": "ھي اي ميل توھان ڏانھن موڪليو ويو آھي {اڪاڻ ته {{owner}} توھان کي دعوت ڏيڻ چاھي ٿو ته توھان {{team}} ٽيم جو ميمبر بڻجي {{project}} تي.", "emails.invitation.footer": "جيڪڏھن توھان دلچسپي نٿا رکو ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", - "emails.invitation.thanks": "مهرباني", + "emails.invitation.thanks": "مهرباني,", "emails.invitation.signature": "{{project}} ٽيم", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", @@ -238,17 +238,17 @@ "emails.magicSession.clientInfo": "هي سائن ان درخواست ورتو {{agentClient}} استعمال ڪري ٿو {{agentDevice}} {{agentOs}}. جيڪڏهن توهان سائن ان جي درخواست ڪئي نه ورتي، ته توهان هن اي ميل کي محفوظ طور تي نظر انداز ڪري سگهو ٿا.", "emails.magicSession.securityPhrase": "اس ای میل جو سیکيورٽي جملو {{phrase}} آهي. جيڪڏهن هن جملو توهان جي سائن ان وقتي ڏيکاري واري جملي سان ميل آهي ته توهان اس ای میل تي اعتماد ڪري سگھو ٿا.", "emails.otpSession.subject": "پروجيڪٽ جي لاگ ان", - "emails.otpSession.hello": "ہيلو،", + "emails.otpSession.hello": "ہيلو,", "emails.otpSession.description": "جڏهن توهان کي محفوظ طريقي سان اپني {{project}} اڪائونٽ ۾ سائن ان ڪرڻ لاءِ ڪہي ويندي، ته هيٺيان دنل ويريفڪيشن ڪوڊ ڏيو. هي 15 منٽن ۾ ختم ٿي ويندي.", "emails.otpSession.clientInfo": "هي سائن ان توهان جو درخواست گهريو ويو آهي {{agentClient}} جي واپار ۾ {{agentDevice}} {{agentOs}} تي. جيڪڏهن توهان سائن ان جي درخواست ڪئي نه آهي، ته توهان هن ايميل کي نظر انداز ڪري سگهو ٿا.", "emails.otpSession.securityPhrase": "هن ای میل لاءِ سیکيورٽي جملو {{phrase}} آھي. توهان هن ای میل تي اعتماد ڪري سگهو ٿا جيڪڏهن هن جملو لاڳو ٿيندڙ جملي سان ميل کاندي.", - "emails.otpSession.thanks": "مهرباني", + "emails.otpSession.thanks": "مهرباني,", "emails.otpSession.signature": "پروجيڪٽ جي ٽيم", "emails.certificate.subject": "%s لاءِ سند جو ناکامی", - "emails.certificate.hello": "هيلو", + "emails.certificate.hello": "هيلو,", "emails.certificate.body": "توهان جي ڊومين '{{domain}}' لاءِ سرٽيفڪيٽ ٺاهڻ جو نه ٿي سگهيو. هي ڪوشش نمبر {{attempt}} آهي، ۽ ناڪامي جو سبب ٿيو: {{error}}", "emails.certificate.footer": "توهان جو اڳيون سرٽيفڪيٽ اولهو فئيلر جي ݙينهن کان ٣٠ ݙينهن لاءِ ماني ويندو. اسان ان جي چھان بني جي بھرپور خواهش ڪنداسين، نہ ته توهان جو ݙومين بغير ڪوري SSL ڪميونڪيشن آڻي ويندي.", - "emails.certificate.thanks": "شُكريا", + "emails.certificate.thanks": "شُكريا,", "emails.certificate.signature": "ٽيم", "sms.verification.body": "{{secret}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/si.json b/app/config/locale/translations/si.json index f1c4b7c86b..536e8d3604 100644 --- a/app/config/locale/translations/si.json +++ b/app/config/locale/translations/si.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s කණ්ඩායම", "emails.verification.subject": "ගිණුම් සත්‍යාපනය", - "emails.verification.hello": "හේයි {{user}}", + "emails.verification.hello": "හේයි {{user}},", "emails.verification.body": "ඔබගේ විද්‍යුත් තැපැල් ලිපිනය සත්‍යාපනය කිරීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.verification.footer": "මෙම ලිපිනය සත්‍යාපනය කරන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", - "emails.verification.thanks": "ස්තුතියි", + "emails.verification.thanks": "ස්තුතියි,", "emails.verification.signature": "{{project}} කණ්ඩායම", "emails.magicSession.subject": "ප්‍රවේශ වන්න", - "emails.magicSession.hello": "හේයි", + "emails.magicSession.hello": "හේයි,", "emails.magicSession.body": "ප්‍රවේශ වීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.magicSession.footer": "මෙම විද්‍යුත් තැපෑල භාවිතයෙන් ප්‍රවේශ වීමට ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", - "emails.magicSession.thanks": "ස්තුතියි", + "emails.magicSession.thanks": "ස්තුතියි,", "emails.magicSession.signature": "{{project}} කණ්ඩායම", "emails.recovery.subject": "මුරපද යළි පිහිටුවීම", - "emails.recovery.hello": "ආයුබෝවන් {{user}}", + "emails.recovery.hello": "ආයුබෝවන් {{user}},", "emails.recovery.body": "ඔබගේ {{project}} මුරපදය නැවත සැකසීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.recovery.footer": "ඔබගේ මුරපදය නැවත සකසන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", - "emails.recovery.thanks": "ස්තුතියි", + "emails.recovery.thanks": "ස්තුතියි,", "emails.recovery.signature": "{{project}} කණ්ඩායම", "emails.invitation.subject": "%s කණ්ඩායමට ආරාධනා %s හි", - "emails.invitation.hello": "ආයුබෝවන්", + "emails.invitation.hello": "ආයුබෝවන්,", "emails.invitation.body": "මෙම තැපැල් ඔබට එව්වේ, {{owner}} හට {{project}} හි {{team}} කණ්ඩායමේ සාමාජිකයෙකු වීමට ඔබට ආරාධනා කිරීමට අවශ්‍ය වූ බැවිනි.", "emails.invitation.footer": "ඔබ උනන්දුවක් නොදක්වන්නේ නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", - "emails.invitation.thanks": "ස්තුතියි", + "emails.invitation.thanks": "ස්තුතියි,", "emails.invitation.signature": "{{project}} කණ්ඩායම", "locale.country.unknown": "නොදන්නා", "countries.af": "ඇෆ්ගනිස්ථානය", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "මෙම ඊමේල්ට සඳහා ආරක්ෂක පාඨය {{phrase}}. පුරන්න විට පෙන්වන පාඨයට මෙම පාඨය ගැලපෙනවා නම්, ඔබට මෙම ඊමේල් විශ්වාස කළ හැකිය.", "emails.otpSession.thanks": "ස්තුතියි,", "emails.otpSession.signature": "{{project}} කණ්ඩායම" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sk.json b/app/config/locale/translations/sk.json index 457e756c9a..93c12c0881 100644 --- a/app/config/locale/translations/sk.json +++ b/app/config/locale/translations/sk.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Tím", "emails.verification.subject": "Overenie účtu", - "emails.verification.hello": "Ahoj {{user}}", + "emails.verification.hello": "Ahoj {{user}},", "emails.verification.body": "Použi tento link pre overenie svojej emailovej adresy.", "emails.verification.footer": "Ak si nepožiadal o overenie tejto adresy, môžeš túto správu ignorovať.", - "emails.verification.thanks": "Ďakujeme.", + "emails.verification.thanks": "Ďakujeme.,", "emails.verification.signature": "{{project}} tím", "emails.magicSession.subject": "Prihlásenie", - "emails.magicSession.hello": "Ahoj", + "emails.magicSession.hello": "Ahoj,", "emails.magicSession.body": "Použi tento link pre prihlásenie.", "emails.magicSession.footer": "Ak si nepožiadal o prihlásenie cez email, túto správu môžeš ignorovať.", - "emails.magicSession.thanks": "Ďakujeme", + "emails.magicSession.thanks": "Ďakujeme,", "emails.magicSession.signature": "{{project}} tím", "emails.recovery.subject": "Obnovenie hesla", - "emails.recovery.hello": "Ahoj {{user}}", + "emails.recovery.hello": "Ahoj {{user}},", "emails.recovery.body": "Použi tento link pre obnovenie svojho {{project}} hesla.", "emails.recovery.footer": "Ak si nepožiadal o obnovu svojho hesla, túto správu môžeš ignorovať.", - "emails.recovery.thanks": "Ďakujeme", + "emails.recovery.thanks": "Ďakujeme,", "emails.recovery.signature": "{{project}} tím", "emails.invitation.subject": "Pozvánka do %s Tímu v %s", - "emails.invitation.hello": "Ahoj", + "emails.invitation.hello": "Ahoj,", "emails.invitation.body": "Tento email ti bol zaslaný, pretože {{owner}} ťa pozval, aby si sa stal členom {{team}} tímu v projekte {{project}}.", "emails.invitation.footer": "Ak nemáš záujem, môžeš túto správu ignorovať.", - "emails.invitation.thanks": "Ďakujeme", + "emails.invitation.thanks": "Ďakujeme,", "emails.invitation.signature": "{{project}} tím", "locale.country.unknown": "Neznámy", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Bezpečnostná fráza pre tento e-mail je {{phrase}}. Tento e-mail môžete dôverovať, ak táto fráza zodpovedá fráze zobrazenej počas prihlasovania.", "emails.otpSession.thanks": "Ďakujem,", "emails.otpSession.signature": "tím {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sl.json b/app/config/locale/translations/sl.json index ec7b4c1ebf..f7c4f41255 100644 --- a/app/config/locale/translations/sl.json +++ b/app/config/locale/translations/sl.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Ekipa", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "Neznano", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Varnostni stavek za to e-pošto je {{phrase}}. Temu e-sporočilu lahko zaupate, če se ta stavek ujema s stavkom, ki je prikazan ob prijavi.", "emails.otpSession.thanks": "Hvala,", "emails.otpSession.signature": "ekipa {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sn.json b/app/config/locale/translations/sn.json index d8b2f2c682..d17a98ff42 100644 --- a/app/config/locale/translations/sn.json +++ b/app/config/locale/translations/sn.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Chikwata che%s", "emails.verification.subject": "Kuratidzi kuti ndiwe muridzi weakaundi", - "emails.verification.hello": "Hesi {{user}}", + "emails.verification.hello": "Hesi {{user}},", "emails.verification.body": "Tevedza chinongedzo ichi kuti uratidze kuti kero iyi ndeyako.", "emails.verification.footer": "Kana usina kukumbira kuti uratidze kuti kero iyi ndeyako, unogona kufuratira meseji iyi.", - "emails.verification.thanks": "Ndatenda", + "emails.verification.thanks": "Ndatenda,", "emails.verification.signature": "Chikwata che{{project}}", "emails.magicSession.subject": "Pinda", - "emails.magicSession.hello": "Hesi", + "emails.magicSession.hello": "Hesi,", "emails.magicSession.body": "Baya chinongedzo ichi kuti upinde muakaundi yako.", "emails.magicSession.footer": "Kana usina kukumbira kupinda muakaundi yako uchishandisa email iyi, unogona kufuratira meseji iyi.", - "emails.magicSession.thanks": "Ndatenda", + "emails.magicSession.thanks": "Ndatenda,", "emails.magicSession.signature": "Chikwata che{{project}}", "emails.recovery.subject": "Kuchinja pasiwedhi", - "emails.recovery.hello": "Mhoro {{user}}", + "emails.recovery.hello": "Mhoro {{user}},", "emails.recovery.body": "Baya chinongedzo ichi kuti uchinje pasiwedhi yako ye{{project}}.", "emails.recovery.footer": "Kana usina kukumbira kuchinja pasiwedhi yako, unogona kufuratira meseji iyi.", - "emails.recovery.thanks": "Ndatenda", + "emails.recovery.thanks": "Ndatenda,", "emails.recovery.signature": "Chikwata che{{project}}", "emails.invitation.subject": "Kukokwa kuchikwata che%s ku%s", - "emails.invitation.hello": "Mhoro", + "emails.invitation.hello": "Mhoro,", "emails.invitation.body": "Tsamba iyi yatumirwa kwauri nekuti {{owner}} anga achida kuti uve nhengo yechikwata che{{team}} pachirongwa che{{project}}.", "emails.invitation.footer": "Kana usiri kufarira kuve nhengo yechikwata ichi, unogona kufuratira meseji iyi.", - "emails.invitation.thanks": "Ndatenda", + "emails.invitation.thanks": "Ndatenda,", "emails.invitation.signature": "Chikwata che{{project}}", "locale.country.unknown": "Haizivikanwe", "countries.af": "Afuganisitani", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Chirevo chekuchengetedza cheemail iyi ndechekuti {{phrase}}. Unogona kuvimba neemail iyi kana chirevo ichi chichienderana nechirevo chakaratidzwa panguva yekupinda.", "emails.otpSession.thanks": "Ndatenda,", "emails.otpSession.signature": "chikwata {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sq.json b/app/config/locale/translations/sq.json index 0fb066a8ea..85aa6637f6 100644 --- a/app/config/locale/translations/sq.json +++ b/app/config/locale/translations/sq.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Grup %s", "emails.verification.subject": "", - "emails.verification.hello": "", + "emails.verification.hello": ",", "emails.verification.body": "", "emails.verification.footer": "", - "emails.verification.thanks": "", + "emails.verification.thanks": ",", "emails.verification.signature": "", "emails.magicSession.subject": "", - "emails.magicSession.hello": "", + "emails.magicSession.hello": ",", "emails.magicSession.body": "", "emails.magicSession.footer": "", - "emails.magicSession.thanks": "", + "emails.magicSession.thanks": ",", "emails.magicSession.signature": "", "emails.recovery.subject": "", - "emails.recovery.hello": "", + "emails.recovery.hello": ",", "emails.recovery.body": "", "emails.recovery.footer": "", - "emails.recovery.thanks": "", + "emails.recovery.thanks": ",", "emails.recovery.signature": "", "emails.invitation.subject": "", - "emails.invitation.hello": "", + "emails.invitation.hello": ",", "emails.invitation.body": "", "emails.invitation.footer": "", - "emails.invitation.thanks": "", + "emails.invitation.thanks": ",", "emails.invitation.signature": "", "locale.country.unknown": "I panjohur", "countries.af": "Afganistani", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Fjala e sigurisë për këtë email është {{phrase}}. Ju mund të besoni këtë email nëse kjo fjalë përputhet me fjalën që shfaqet gjatë kyçjes.", "emails.otpSession.thanks": "Faleminderit,", "emails.otpSession.signature": "ekipi i {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/sv.json b/app/config/locale/translations/sv.json index b838c05084..8997fd53f8 100644 --- a/app/config/locale/translations/sv.json +++ b/app/config/locale/translations/sv.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s-teamet", "emails.verification.subject": "Verifiera konto", - "emails.verification.hello": "Hej {{user}}", + "emails.verification.hello": "Hej {{user}},", "emails.verification.body": "Klicka på denna länk för att verifiera din email", "emails.verification.footer": "Om du inte bad om att verifiera den här e-postadressen kan du ignorera detta mail.", - "emails.verification.thanks": "Tack", + "emails.verification.thanks": "Tack,", "emails.verification.signature": "{{project}} teamet", "emails.magicSession.subject": "Logga in", - "emails.magicSession.hello": "Hej", + "emails.magicSession.hello": "Hej,", "emails.magicSession.body": "Klicka på denna länk för att logga in.", "emails.magicSession.footer": "Om du inte bad om att logga in med denna e-postadress kan du ignorera detta mail.", - "emails.magicSession.thanks": "Tack", + "emails.magicSession.thanks": "Tack,", "emails.magicSession.signature": "{{project}} teamet", "emails.recovery.subject": "Återställ lösenord", - "emails.recovery.hello": "Hej {{user}}", + "emails.recovery.hello": "Hej {{user}},", "emails.recovery.body": "Klicka på denna länk för att återställa lösenordet på {{project}}", "emails.recovery.footer": "Om du inte bad om att återställa ditt lösenord kan du ignorera detta mail.", - "emails.recovery.thanks": "Tack", + "emails.recovery.thanks": "Tack,", "emails.recovery.signature": "{{project}} teamet", "emails.invitation.subject": "Inbjudan till %s teamet på %s", - "emails.invitation.hello": "Hej", + "emails.invitation.hello": "Hej,", "emails.invitation.body": "Detta mail skickades till dig eftersom {{owner}} ville bjuda in dig att bli medlem i teamet {{team}} på {{project}}.", "emails.invitation.footer": "Om du inte är intresserad kan du ignorera detta mail.", - "emails.invitation.thanks": "Tack", + "emails.invitation.thanks": "Tack,", "emails.invitation.signature": "{{project}} teamet", "locale.country.unknown": "Okänt", "countries.af": "Afghanistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Säkerhetsfrasen för detta e-postmeddelande är {{phrase}}. Du kan lita på detta e-postmeddelande om frasen stämmer överens med frasen som visades vid inloggningen.", "emails.otpSession.thanks": "Tack,", "emails.otpSession.signature": "{{project}} team" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ta.json b/app/config/locale/translations/ta.json index 659306c977..f0695867a9 100644 --- a/app/config/locale/translations/ta.json +++ b/app/config/locale/translations/ta.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s குழு", "emails.verification.subject": "கணக்கு சரிபார்ப்பு", - "emails.verification.hello": "ஏய் {{user}}", + "emails.verification.hello": "ஏய் {{user}},", "emails.verification.body": "உங்கள் மின்னஞ்சல் முகவரியைச் சரிபார்க்க இந்த இணைப்பைப் பின்தொடரவும்.", "emails.verification.footer": "இந்த முகவரியைச் சரிபார்க்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", - "emails.verification.thanks": "நன்றி", + "emails.verification.thanks": "நன்றி,", "emails.verification.signature": "{{project}} குழு ", "emails.magicSession.subject": "உள்நுழைய", - "emails.magicSession.hello": "ஏய்", + "emails.magicSession.hello": "ஏய்,", "emails.magicSession.body": "இந்த இணைப்பைப் பின்தொடரவும் உள்நுழைய", "emails.magicSession.footer": "இந்த மின்னஞ்சலைப் பயன்படுத்தி உள்நுழையுமாறு உங்களிடம் கேட்கப்படாவிட்டால், இந்தச் செய்தியைப் புறக்கணிக்கலாம்.", - "emails.magicSession.thanks": "நன்றி", + "emails.magicSession.thanks": "நன்றி,", "emails.magicSession.signature": "{{project}} குழு", "emails.recovery.subject": "கடவுச்சொல் மீட்டமைப்பு", - "emails.recovery.hello": "வணக்கம் {{user}}", + "emails.recovery.hello": "வணக்கம் {{user}},", "emails.recovery.body": "மீட்டமைக்க இந்த இணைப்பைப் பின்தொடரவும் {{project}} கடவுச்சொல்.", "emails.recovery.footer": "உங்கள் கடவுச்சொல்லை மீட்டமைக்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", - "emails.recovery.thanks": "நன்றி", + "emails.recovery.thanks": "நன்றி,", "emails.recovery.signature": "{{project}} குழு", "emails.invitation.subject": "அழைப்பிதழ் %s குழு %s ", - "emails.invitation.hello": "வணக்கம்", + "emails.invitation.hello": "வணக்கம்,", "emails.invitation.body": "{{project}} இல் {{team}} குழுவில் உறுப்பினராக உங்களை {{owner}} அழைக்க விரும்புவதால், இந்த அஞ்சல் உங்களுக்கு அனுப்பப்பட்டது.", "emails.invitation.footer": "உங்களுக்கு ஆர்வம் இல்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.", - "emails.invitation.thanks": "நன்றி", + "emails.invitation.thanks": "நன்றி,", "emails.invitation.signature": "{{project}} குழு", "locale.country.unknown": "அறியவில்லை", "countries.af": "ஆப்கானித்தான்", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "இந்த மின்னஞ்சலுக்கான பாதுகாப்பு வாசகம் {{phrase}} ஆகும். இந்த வாசகம் உள்நுழையும் போது காட்டப்பட்ட வாசகத்துடன் பொருந்துமானால், இந்த மின்னஞ்சலை நம்பலாம்.", "emails.otpSession.thanks": "நன்றி,", "emails.otpSession.signature": "{{project}} குழு" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/te.json b/app/config/locale/translations/te.json index 019b4581ca..870b0b82a2 100644 --- a/app/config/locale/translations/te.json +++ b/app/config/locale/translations/te.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s జట్టు", "emails.verification.subject": "ఖాతా ధృవీకరణ", - "emails.verification.hello": "నమస్కారము {{user}}", + "emails.verification.hello": "నమస్కారము {{user}},", "emails.verification.body": "ఈ లింక్ ద్వారా ఇమెయిల్ ని ధృవీకరించండి", "emails.verification.footer": "మీరు ఈ చిరునామాను ధృవీకరించమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", - "emails.verification.thanks": "ధన్యవాదాలు", + "emails.verification.thanks": "ధన్యవాదాలు,", "emails.verification.signature": "{{project}} జట్", "emails.magicSession.subject": "లాగిన్", - "emails.magicSession.hello": "నమస్కారము", + "emails.magicSession.hello": "నమస్కారము,", "emails.magicSession.body": "లాగిన్ చేయడానికి ఈ లింక్ ని అనుసరించండి", "emails.magicSession.footer": "మీరు ఈ ఇమెయిల్ ని ఉపయోగించి లాగిన్ చేయమని అడగకపోతే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", - "emails.magicSession.thanks": "ధన్యవాదాలు", + "emails.magicSession.thanks": "ధన్యవాదాలు,", "emails.magicSession.signature": "{{project}} జట్", "emails.recovery.subject": "పాస్వర్డ్ రీసెట్", - "emails.recovery.hello": "నమస్కారమ {{user}}", + "emails.recovery.hello": "నమస్కారమ {{user}},", "emails.recovery.body": "మీ {{project}} పాస్వర్డ్ ని రీసెట్ చేయడానికి ఈ లింక్ ని అనుసరించండి", "emails.recovery.footer": "మీరు మీ పాస్వర్డ్ ని రీసెట్ చేయమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", - "emails.recovery.thanks": "ధన్యవాదాల", + "emails.recovery.thanks": "ధన్యవాదాల,", "emails.recovery.signature": "{{project}} జట్", "emails.invitation.subject": "%s వద్ద %s బృందానికి ఆహ్వానం", - "emails.invitation.hello": "నమస్కారమ", + "emails.invitation.hello": "నమస్కారమ,", "emails.invitation.body": "{{owner}} మిమ్మల్ని {{project}} లో {{team}} బృందంలో సభ్యునిగా ఉండమని ఆహ్వానించాలనుకుంటున్నందున ఈ మెయిల్ మీకు పంపబడింది.", "emails.invitation.footer": "మీకు ఆసక్తి లేకుంటే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు.", - "emails.invitation.thanks": "ధన్యవాదాల", + "emails.invitation.thanks": "ధన్యవాదాల,", "emails.invitation.signature": "{{project}} జట్", "locale.country.unknown": "తెలియని", "countries.af": "ఆఫ్ఘనిస్తాన్", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "ఈ ఇమెయిల్‌కు భద్రతా పదం {{phrase}}. మీరు సైన్ ఇన్ సమయంలో చూపించబడిన పదంతో ఈ పదం సరిపోలుస్తుంటే ఈ ఇమెయిల్‌ను నమ్మవచ్చు.", "emails.otpSession.thanks": "ధన్యవాదాలు,", "emails.otpSession.signature": "ప్రాజెక్టు బృందం" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/th.json b/app/config/locale/translations/th.json index 97d224de1f..5a53b16055 100644 --- a/app/config/locale/translations/th.json +++ b/app/config/locale/translations/th.json @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "วลีรักษาความปลอดภัยสำหรับอีเมลนี้คือ {{phrase}} คุณสามารถเชื่อถืออีเมลนี้ได้หากวลีนี้ตรงกับวลีที่แสดงในระหว่างการเข้าสู่ระบบ", "emails.magicSession.optionUrl": "หากคุณไม่สามารถเข้าสู่ระบบโดยใช้ปุ่มด้านบน โปรดเยี่ยมชมลิงก์ต่อไปนี้:", "emails.otpSession.subject": "การเข้าสู่ระบบ {{project}}", - "emails.otpSession.hello": "สวัสดี,", + "emails.otpSession.hello": "สวัสดี", "emails.otpSession.description": "ป้อนรหัสยืนยันต่อไปนี้เมื่อได้รับการสั่งให้ทำเพื่อลงชื่อเข้าใช้บัญชี {{project}} ของคุณอย่างปลอดภัย รหัสนี้จะหมดอายุใน 15 นาที.", "emails.otpSession.clientInfo": "การลงชื่อเข้าใช้งานนี้ได้รับการทำผ่าน {{agentClient}} บน {{agentDevice}} {{agentOs}} หากคุณไม่ได้ทำการขอลงชื่อเข้าใช้นี้ คุณสามารถเพิกเฉยต่ออีเมลนี้ได้เลย", "emails.otpSession.securityPhrase": "วลีความปลอดภัยสำหรับอีเมลนี้คือ {{phrase}} คุณสามารถเชื่อถืออีเมลนี้ได้หากวลีนี้ตรงกับวลีที่แสดงขณะลงชื่อเข้าใช้งาน.", "emails.otpSession.thanks": "ขอบคุณครับ/ค่ะ", "emails.otpSession.signature": "ทีม {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/tl.json b/app/config/locale/translations/tl.json index e6df9f8aef..6d0be01095 100644 --- a/app/config/locale/translations/tl.json +++ b/app/config/locale/translations/tl.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Pangkat ng %s", "emails.verification.subject": "Pagpapatunay ng account", - "emails.verification.hello": "Kamusta {{user}}", + "emails.verification.hello": "Kamusta {{user}},", "emails.verification.body": "Sundin ang link na ito upang ma-verify ang iyong email address.", "emails.verification.footer": "Kung hindi mo hiningi na i-verify ang address na ito, maaari mong balewalain ang mensahe na ito.", - "emails.verification.thanks": "Salamat", + "emails.verification.thanks": "Salamat,", "emails.verification.signature": "Pangkat ng {{project}}", "emails.magicSession.subject": "Mag log in", - "emails.magicSession.hello": "Kamusta ", + "emails.magicSession.hello": "Kamusta ,", "emails.magicSession.body": "Sundin ang link na ito upang mag-login.", "emails.magicSession.footer": "Kung hindi mo hiningi na mag-login gamit ang email na ito, maaari mong balewalain ang mensahe na ito.", - "emails.magicSession.thanks": "Salamat", + "emails.magicSession.thanks": "Salamat,", "emails.magicSession.signature": "Pangkat ng {{project}}", "emails.recovery.subject": "I-reset ang password", - "emails.recovery.hello": "Kamusta {{user}}", + "emails.recovery.hello": "Kamusta {{user}},", "emails.recovery.body": "Sundin ang link na ito upang i-reset ang password ng iyong {{project}}.", "emails.recovery.footer": "Kung hindi mo hiningi na i-reset ang iyong password, maaari mong balewalain ang mensahe na ito.", - "emails.recovery.thanks": "Salamat", + "emails.recovery.thanks": "Salamat,", "emails.recovery.signature": "Pangkat ng {{project}}", "emails.invitation.subject": "Imbitasyon para sa Pangkat %s sa %s", - "emails.invitation.hello": "Kamusta", + "emails.invitation.hello": "Kamusta,", "emails.invitation.body": "Ipinadala sa iyo ang mail na ito dahil gusto kang imbitahan ni {{owner}} na maging miyembro ng Pangkat {{team}} sa ilalim ng proyektong {{project}}.", "emails.invitation.footer": "Kung ikaw ay hindi interesado, maaari mong balewalain ang mensaheng ito.", - "emails.invitation.thanks": "Salamat", + "emails.invitation.thanks": "Salamat,", "emails.invitation.signature": "Pangkat ng {{project}}", "locale.country.unknown": "Hindi kilala", "countries.af": "Apganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Ang security phrase para sa email na ito ay {{phrase}}. Maaari mong pagkatiwalaan ang email na ito kung ang phrase na ito ay tugma sa phrase na ipinakita noong nag-sign in.", "emails.otpSession.thanks": "Salamat,", "emails.otpSession.signature": "team ng {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/tr.json b/app/config/locale/translations/tr.json index 808a20576c..115050c2e2 100644 --- a/app/config/locale/translations/tr.json +++ b/app/config/locale/translations/tr.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s Takımı", "emails.verification.subject": "Hesabını Doğrula", - "emails.verification.hello": "Merhaba {{user}}", + "emails.verification.hello": "Merhaba {{user}},", "emails.verification.body": "Eposta adresini doğrulamak için bu bağlantıyı kullanın.", "emails.verification.footer": "Eğer bu eposta adresini doğrulamak isteyen siz değilseniz devam etmeyin.", - "emails.verification.thanks": "Teşekkürler", + "emails.verification.thanks": "Teşekkürler,", "emails.verification.signature": "{{project}} takımı", "emails.magicSession.subject": "Giriş", - "emails.magicSession.hello": "Merhaba", + "emails.magicSession.hello": "Merhaba,", "emails.magicSession.body": "Giriş yapmak için tıklayın.", "emails.magicSession.footer": "Eğer bu eposta adresini kullanarak giriş yapmak istemediyseniz devam etmeyin.", - "emails.magicSession.thanks": "Teşekkürler", + "emails.magicSession.thanks": "Teşekkürler,", "emails.magicSession.signature": "{{project}} takımı", "emails.recovery.subject": "Şifremi Sıfırla", - "emails.recovery.hello": "Merhaba {{user}}", + "emails.recovery.hello": "Merhaba {{user}},", "emails.recovery.body": "{{project}} şifrenizi sıfırlamak için bu bağlantıyı kullanın.", "emails.recovery.footer": "Eğer şifre sıfırlama talebinde bulunmadıysanız devam etmeyin.", - "emails.recovery.thanks": "Teşekkürler", + "emails.recovery.thanks": "Teşekkürler,", "emails.recovery.signature": "{{project}} takımı", "emails.invitation.subject": "%s üzerinde %s Takımına Davet", - "emails.invitation.hello": "Merhaba", + "emails.invitation.hello": "Merhaba,", "emails.invitation.body": "Bu epostayı aldınız, çünkü {{owner}} sizi {{project}} üzerinde {{team}} takımının üyesi olmaya davet etti.", "emails.invitation.footer": "Eğer ilgilenmiyorsanız devam etmeyin.", - "emails.invitation.thanks": "Teşekkürler", + "emails.invitation.thanks": "Teşekkürler,", "emails.invitation.signature": "{{project}} takımı", "locale.country.unknown": "Bilinmeyen", "countries.af": "Afganistan", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Bu e-postanın güvenlik ifadesi {{phrase}}. Giriş sırasında gösterilen ifade ile bu ifade eşleşiyorsa bu e-postaya güvenebilirsiniz.", "emails.otpSession.thanks": "Teşekkürler,", "emails.otpSession.signature": "{{project}} takımı" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/uk.json b/app/config/locale/translations/uk.json index 78e3a6c556..3f66bd1c58 100644 --- a/app/config/locale/translations/uk.json +++ b/app/config/locale/translations/uk.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "Команда %s", "emails.verification.subject": "Верифікація акаунта", - "emails.verification.hello": "Вітаємо, {{user}}", + "emails.verification.hello": "Вітаємо, {{user}},", "emails.verification.body": "Перейдіть за цим посиланням, щоб підтвердити свою електронну адресу.", "emails.verification.footer": "Якщо ви не запитували підтвердження цієї адреси, ви можете ігнорувати це повідомлення.", - "emails.verification.thanks": "Дякуємо", + "emails.verification.thanks": "Дякуємо,", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логін", - "emails.magicSession.hello": "Вітаємо", + "emails.magicSession.hello": "Вітаємо,", "emails.magicSession.body": "Перейдіть за цим посиланням, щоб увійти.", "emails.magicSession.footer": "Якщо ви не просили увійти за допомогою цієї електронної пошти, ви можете ігнорувати це повідомлення.", - "emails.magicSession.thanks": "Дякуємо", + "emails.magicSession.thanks": "Дякуємо,", "emails.magicSession.signature": "команда {{project}}", "emails.recovery.subject": "Скидання пароля", - "emails.recovery.hello": "Вітаємо, {{user}}", + "emails.recovery.hello": "Вітаємо, {{user}},", "emails.recovery.body": "Перейдіть за цим посиланням для того щоб скинути свій пароль для проекту {{project}}", "emails.recovery.footer": "Якщо ви не запитували скидання паролю, проігноруйте це повідомлення.", - "emails.recovery.thanks": "Дякуємо", + "emails.recovery.thanks": "Дякуємо,", "emails.recovery.signature": "команда {{project}}", "emails.invitation.subject": "Запрошення до %s Команди у %s", - "emails.invitation.hello": "Вітаємо", + "emails.invitation.hello": "Вітаємо,", "emails.invitation.body": "Цей лист був надісланий вам тому що {{owner}} запрошує вас стати членом команди {{team}} у проекті {{project}}.", "emails.invitation.footer": "Якщо ви не зацікавлені, проігноруйте це повідомлення.", - "emails.invitation.thanks": "Дякуємо", + "emails.invitation.thanks": "Дякуємо,", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Невідомо", "countries.af": "Афганістан", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "Фраза безпеки для цього електронного листа - {{phrase}}. Ви можете довіряти цьому електронному листу, якщо ця фраза відповідає фразі, показаній під час входу в систему.", "emails.otpSession.thanks": "Дякую,", "emails.otpSession.signature": "команда {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/ur.json b/app/config/locale/translations/ur.json index 060cea0736..9d6aa47762 100644 --- a/app/config/locale/translations/ur.json +++ b/app/config/locale/translations/ur.json @@ -4,28 +4,28 @@ "settings.direction": "rtl", "emails.sender": "%s ٹیم", "emails.verification.subject": "اکاؤنٹ کی تصدیق", - "emails.verification.hello": "خوش آمدید {{user}}", + "emails.verification.hello": "خوش آمدید {{user}}،", "emails.verification.body": "براہ کرم اپنے ای میل کی تصدیق کے لیے درج ذیل لنک پر عمل کریں۔", "emails.verification.footer": "اگر آپ نے اس پتے کی تصدیق کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", - "emails.verification.thanks": "شکریہ", + "emails.verification.thanks": "شکریہ،", "emails.verification.signature": "ٹیم۔ {{project}}", "emails.magicSession.subject": "اگ ان کریں", - "emails.magicSession.hello": "خوش آمدید", + "emails.magicSession.hello": "خوش آمدید،", "emails.magicSession.body": "لاگ ان کرنے کے لیے اس لنک پر عمل کریں۔", "emails.magicSession.footer": "اگر آپ نے اس ای میل کا استعمال کرتے ہوئے لاگ ان کرنے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", - "emails.magicSession.thanks": "شکریہ", + "emails.magicSession.thanks": "شکریہ،", "emails.magicSession.signature": "ٹیم۔ {{project}}", "emails.recovery.subject": "پاس ورڈ ری سیٹ۔", - "emails.recovery.hello": "ہیلو {{user}}", + "emails.recovery.hello": "ہیلو {{user}}،", "emails.recovery.body": "{{project}} کا پاس ورڈ تبدیل کرنے کے لیے درج ذیل لنک پر عمل کریں", "emails.recovery.footer": "اگر آپ نے اپنا پاس ورڈ دوبارہ ترتیب دینے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", - "emails.recovery.thanks": "شکریہ", + "emails.recovery.thanks": "شکریہ،", "emails.recovery.signature": "ٹیم۔ {{project}}", "emails.invitation.subject": "%s پر %s ٹیم کو دعوت", - "emails.invitation.hello": "خوش آمدید", + "emails.invitation.hello": "خوش آمدید،", "emails.invitation.body": "یہ پیغام آپ کو اس لیے بھیجا گیا تھا کہ {{owner}} نے آپ کو {{project}} میں {{team}} ٹیم کا رکن بننے کی دعوت بھیجی", "emails.invitation.footer": "اگر آپ دلچسپی نہیں رکھتے تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", - "emails.invitation.thanks": "شکریہ", + "emails.invitation.thanks": "شکریہ،", "emails.invitation.signature": "ٹیم۔ {{project}", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", @@ -245,4 +245,4 @@ "emails.otpSession.securityPhrase": "اس ایمیل کے لئے حفاظتی جملہ {{phrase}} ہے۔ اگر یہ جملہ سائن ان کے دوران دکھائے گئے جملے سے میل کھاتا ہے تو آپ اس ایمیل پر بھروسہ کر سکتے ہیں۔", "emails.otpSession.thanks": "شکریہ،", "emails.otpSession.signature": "ٹیم {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/vi.json b/app/config/locale/translations/vi.json index cf04a5b737..76a545a1d4 100644 --- a/app/config/locale/translations/vi.json +++ b/app/config/locale/translations/vi.json @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "Cụm từ bảo mật cho email này là {{phrase}}. Bạn có thể tin tưởng email này nếu cụm từ này khớp với cụm từ hiển thị khi đăng nhập.", "emails.magicSession.optionUrl": "Nếu bạn không thể đăng nhập bằng cách sử dụng nút ở trên, vui lòng truy cập liên kết sau:", "emails.otpSession.subject": "Đăng nhập {{project}}", - "emails.otpSession.hello": "Xin chào,", + "emails.otpSession.hello": "Xin chào", "emails.otpSession.description": "Nhập mã xác minh sau đây khi được yêu cầu để đăng nhập an toàn vào tài khoản {{project}} của bạn. Mã này sẽ hết hạn trong 15 phút.", "emails.otpSession.clientInfo": "Đăng nhập này được yêu cầu sử dụng {{agentClient}} trên {{agentDevice}} {{agentOs}}. Nếu bạn không yêu cầu đăng nhập, bạn có thể bỏ qua email này một cách an toàn.", "emails.otpSession.securityPhrase": "Cụm từ bảo mật cho email này là {{phrase}}. Bạn có thể tin tưởng email này nếu cụm từ này khớp với cụm từ hiển thị khi đăng nhập.", - "emails.otpSession.thanks": "Cảm ơn,", + "emails.otpSession.thanks": "Cảm ơn", "emails.otpSession.signature": "nhóm {{project}}" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/zh-cn.json b/app/config/locale/translations/zh-cn.json index 0bfbc54e0e..5e35a89bfe 100644 --- a/app/config/locale/translations/zh-cn.json +++ b/app/config/locale/translations/zh-cn.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s 小组", "emails.verification.subject": "帐户验证", - "emails.verification.hello": "你好 {{user}}", + "emails.verification.hello": "你好 {{user}}、", "emails.verification.body": "点此链接验证您的电子邮件地址。", "emails.verification.footer": "如果您没有要求验证此地址,则可忽略此消息。", - "emails.verification.thanks": "谢谢", + "emails.verification.thanks": "谢谢、", "emails.verification.signature": "{{project}} 团队", "emails.magicSession.subject": "登录", - "emails.magicSession.hello": "你好", + "emails.magicSession.hello": "你好、", "emails.magicSession.body": "点此链接登录。", "emails.magicSession.footer": "如果您没有要求使用此电子邮件登录,则可忽略此消息。", - "emails.magicSession.thanks": "谢谢", + "emails.magicSession.thanks": "谢谢、", "emails.magicSession.signature": "{{project}} 团队", "emails.recovery.subject": "重设密码", - "emails.recovery.hello": "你好 {{user}}", + "emails.recovery.hello": "你好 {{user}}、", "emails.recovery.body": "点此链接重置您的 {{project}} 密码。", "emails.recovery.footer": "如果您没有要求重置密码,则可以忽略此消息。", - "emails.recovery.thanks": "谢谢", + "emails.recovery.thanks": "谢谢、", "emails.recovery.signature": "{{project}} 团队", "emails.invitation.subject": "邀请 %s 团队在 %s", - "emails.invitation.hello": "你好", + "emails.invitation.hello": "你好、", "emails.invitation.body": "这封邮件发送给您是因为 {{owner}} 想邀请您成为 {{team}} 团队在 {{project}}.", "emails.invitation.footer": "如果您不感兴趣,可以忽略此消息。", - "emails.invitation.thanks": "谢谢", + "emails.invitation.thanks": "谢谢、", "emails.invitation.signature": "{{project}} 团队", "locale.country.unknown": "未知", "countries.af": "阿富汗", @@ -239,10 +239,10 @@ "emails.magicSession.securityPhrase": "此电子邮件的安全短语是{{phrase}}。如果此短语与登录时显示的短语相匹配,则您可以信任此电子邮件。", "emails.magicSession.optionUrl": "如果您无法使用上面的按钮登录,请访问以下链接:", "emails.otpSession.subject": "{{project}} 登录", - "emails.otpSession.hello": "你好,\n", + "emails.otpSession.hello": "你好,\n、", "emails.otpSession.description": "在提示时输入以下验证码以安全登录您的{{project}}账户。该验证码将在15分钟后过期。", "emails.otpSession.clientInfo": "此次登录是通过{{agentClient}}在{{agentDevice}} {{agentOs}}上请求的。如果您没有请求登录,可以放心忽略此电子邮件。", "emails.otpSession.securityPhrase": "此电子邮件的安全短语是{{phrase}}。如果此短语与登录时显示的短语一致,您可以信任此邮件。", - "emails.otpSession.thanks": "谢谢,", + "emails.otpSession.thanks": "谢谢,、", "emails.otpSession.signature": "{{project}} 团队" -} \ No newline at end of file +} diff --git a/app/config/locale/translations/zh-tw.json b/app/config/locale/translations/zh-tw.json index 24729de6b3..146dd0a401 100644 --- a/app/config/locale/translations/zh-tw.json +++ b/app/config/locale/translations/zh-tw.json @@ -4,28 +4,28 @@ "settings.direction": "ltr", "emails.sender": "%s 小組", "emails.verification.subject": "帳戶驗證", - "emails.verification.hello": "嗨 {{user}}", + "emails.verification.hello": "嗨 {{user}}、", "emails.verification.body": "按照此連結驗證您的電子郵件地址。", "emails.verification.footer": "如果您沒有要求驗證此地址,則可以忽略此消息。", - "emails.verification.thanks": "謝謝", + "emails.verification.thanks": "謝謝、", "emails.verification.signature": "{{project}} 團隊", "emails.magicSession.subject": "登入", - "emails.magicSession.hello": "嗨", + "emails.magicSession.hello": "嗨、", "emails.magicSession.body": "點此連結登入。", "emails.magicSession.footer": "如果您沒有要求使用此電子郵件登入,則可以忽略此消息。", - "emails.magicSession.thanks": "謝謝", + "emails.magicSession.thanks": "謝謝、", "emails.magicSession.signature": "{{project}} 團隊", "emails.recovery.subject": "重設密碼", - "emails.recovery.hello": "您好 {{user}}", + "emails.recovery.hello": "您好 {{user}}、", "emails.recovery.body": "按照此連結重置您的 {{project}} 密碼。", "emails.recovery.footer": "如果您沒有要求重置密碼,則可以忽略此消息。", - "emails.recovery.thanks": "謝謝", + "emails.recovery.thanks": "謝謝、", "emails.recovery.signature": "{{project}} 團隊", "emails.invitation.subject": "邀請 %s 團隊在 %s", - "emails.invitation.hello": "您好", + "emails.invitation.hello": "您好、", "emails.invitation.body": "發送這封郵件給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}。", "emails.invitation.footer": "如果您不感興趣,可以忽略此消息。", - "emails.invitation.thanks": "謝謝", + "emails.invitation.thanks": "謝謝、", "emails.invitation.signature": "{{project}} 團隊", "locale.country.unknown": "未知", "countries.af": "阿富汗", @@ -239,10 +239,10 @@ "sms.verification.body": "{{secret}}", "emails.magicSession.securityPhrase": "這封電子郵件的安全密語是{{phrase}}。如果此密語與登入時顯示的密語相符,您就可以信任此郵件。", "emails.otpSession.subject": "{{project}} 登入", - "emails.otpSession.hello": "你好,", + "emails.otpSession.hello": "你好,、", "emails.otpSession.description": "在提示时輸入以下驗證碼以安全地登入您的{{project}}帳戶。該驗證碼將在15分鐘後過期。", "emails.otpSession.clientInfo": "這次的登入是使用{{agentClient}}在{{agentDevice}} {{agentOs}}上請求的。如果您沒有請求這次的登入,您可以放心地忽略這封電子郵件。", "emails.otpSession.securityPhrase": "這封電子郵件的安全口令是{{phrase}}。如果這個口令與登入時顯示的口令相匹配,您可以信任這封電子郵件。", - "emails.otpSession.thanks": "謝謝,", + "emails.otpSession.thanks": "謝謝,、", "emails.otpSession.signature": "{{project}} 團隊" -} \ No newline at end of file +} diff --git a/app/config/platforms.php b/app/config/platforms.php index e54fb0a073..92e325bd44 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -11,7 +11,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '16.0.2', + 'version' => '16.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -59,7 +59,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '13.0.0', + 'version' => '13.1.1', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -77,7 +77,7 @@ return [ [ 'key' => 'apple', 'name' => 'Apple', - 'version' => '7.0.0', + 'version' => '7.1.0', 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, @@ -112,7 +112,7 @@ return [ [ 'key' => 'android', 'name' => 'Android', - 'version' => '6.0.0', + 'version' => '6.1.0', 'url' => 'https://github.com/appwrite/sdk-for-android', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android', 'enabled' => true, @@ -134,7 +134,7 @@ return [ [ 'key' => 'react-native', 'name' => 'React Native', - 'version' => '0.5.0', + 'version' => '0.6.0', 'url' => 'https://github.com/appwrite/sdk-for-react-native', 'package' => 'https://npmjs.com/package/react-native-appwrite', 'enabled' => true, @@ -217,7 +217,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '6.0.0', + 'version' => '6.2.0', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -245,7 +245,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '14.1.0', + 'version' => '14.2.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -263,7 +263,7 @@ return [ [ 'key' => 'deno', 'name' => 'Deno', - 'version' => '12.1.0', + 'version' => '12.2.0', 'url' => 'https://github.com/appwrite/sdk-for-deno', 'package' => 'https://deno.land/x/appwrite', 'enabled' => true, @@ -281,7 +281,7 @@ return [ [ 'key' => 'php', 'name' => 'PHP', - 'version' => '12.1.0', + 'version' => '12.2.0', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -299,7 +299,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '6.1.0', + 'version' => '6.2.0', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -317,7 +317,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '12.1.1', + 'version' => '12.2.0', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -335,7 +335,7 @@ return [ [ 'key' => 'go', 'name' => 'Go', - 'version' => '0.2.0', + 'version' => '0.3.0', 'url' => 'https://github.com/appwrite/sdk-for-go', 'package' => 'https://github.com/appwrite/sdk-for-go', 'enabled' => true, @@ -353,7 +353,7 @@ return [ [ 'key' => 'dotnet', 'name' => '.NET', - 'version' => '0.10.1', + 'version' => '0.11.0', 'url' => 'https://github.com/appwrite/sdk-for-dotnet', 'package' => 'https://www.nuget.org/packages/Appwrite', 'enabled' => true, @@ -371,7 +371,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '12.1.0', + 'version' => '12.2.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -389,7 +389,7 @@ return [ [ 'key' => 'kotlin', 'name' => 'Kotlin', - 'version' => '6.1.0', + 'version' => '6.2.0', 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', 'enabled' => true, @@ -411,7 +411,7 @@ return [ [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '6.1.0', + 'version' => '6.2.0', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, diff --git a/app/config/specs/open-api3-1.6.x-client.json b/app/config/specs/open-api3-1.6.x-client.json index c00d4e2d07..820b1f55e0 100644 --- a/app/config/specs/open-api3-1.6.x-client.json +++ b/app/config/specs/open-api3-1.6.x-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -109,9 +106,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -196,9 +190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -274,9 +265,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -335,9 +323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -400,9 +385,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -451,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -519,9 +498,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -591,9 +567,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -659,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -739,9 +709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -809,9 +776,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -857,10 +821,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -885,9 +849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -963,9 +924,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1016,9 +974,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1067,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1118,9 +1070,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1171,9 +1120,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1243,9 +1189,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1320,9 +1263,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1398,9 +1338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1449,9 +1386,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1524,9 +1458,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1600,9 +1531,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1684,9 +1612,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1728,9 +1653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1781,9 +1703,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1832,9 +1751,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1908,9 +1824,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1977,9 +1890,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2120,9 +2030,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2196,9 +2103,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2272,9 +2176,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2335,9 +2236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2391,9 +2289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2456,9 +2351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2479,7 +2371,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2499,7 +2391,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2508,9 +2400,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2560,7 +2449,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2580,7 +2469,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2589,9 +2478,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2640,17 +2526,10 @@ "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2660,7 +2539,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2669,9 +2548,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2733,9 +2609,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2784,7 +2657,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2817,9 +2690,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2896,9 +2766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3042,9 +2909,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3118,9 +2982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3188,9 +3049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3269,9 +3127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3320,9 +3175,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3392,9 +3244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3520,9 +3369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3652,9 +3498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3712,9 +3555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4202,9 +4042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4286,9 +4123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4380,9 +4214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4481,9 +4312,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4568,9 +4396,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4677,9 +4502,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4774,9 +4596,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4875,9 +4694,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4945,7 +4761,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -4961,9 +4777,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5033,7 +4846,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5049,9 +4862,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5150,7 +4960,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5166,9 +4976,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5226,7 +5033,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5242,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5280,7 +5084,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5296,9 +5100,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5350,9 +5151,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5404,9 +5202,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5458,9 +5253,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5512,9 +5304,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5566,9 +5355,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5620,9 +5406,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5674,9 +5457,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5728,9 +5508,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5766,7 +5543,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -5783,9 +5560,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5851,7 +5625,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -5868,9 +5642,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5928,7 +5699,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -5944,9 +5715,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6016,7 +5784,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6032,9 +5800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6116,7 +5881,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6132,9 +5897,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6190,7 +5952,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6206,9 +5968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6281,7 +6040,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6297,9 +6056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6350,7 +6106,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6366,9 +6122,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6419,7 +6172,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6435,9 +6188,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6611,6 +6361,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -6637,7 +6388,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6653,9 +6404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6713,7 +6461,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6729,9 +6477,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6791,7 +6536,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -6807,9 +6552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6878,7 +6620,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6894,9 +6636,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6942,7 +6681,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6958,9 +6697,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7018,7 +6754,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7034,9 +6770,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7069,7 +6802,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -7084,7 +6817,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7100,9 +6833,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7172,7 +6902,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7188,9 +6918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7270,7 +6997,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -7285,7 +7012,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7301,9 +7028,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7359,7 +7083,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7375,9 +7099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7448,7 +7169,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7464,9 +7185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7524,7 +7242,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7539,9 +7257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7624,7 +7339,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7639,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7687,7 +7399,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7702,9 +7414,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9266,12 +8975,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -9301,7 +9010,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -9826,7 +9535,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -9848,6 +9557,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -9857,7 +9571,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/open-api3-1.6.x-console.json b/app/config/specs/open-api3-1.6.x-console.json index 87c61ada7b..7f57dfc437 100644 --- a/app/config/specs/open-api3-1.6.x-console.json +++ b/app/config/specs/open-api3-1.6.x-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -108,9 +105,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -185,9 +179,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -236,9 +227,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -313,9 +301,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -373,9 +358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -437,9 +419,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -488,9 +467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -555,9 +531,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -626,9 +599,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -693,9 +663,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -772,9 +739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -841,9 +805,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -889,10 +850,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -917,9 +878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -994,9 +952,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1046,9 +1001,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1096,9 +1048,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1146,9 +1095,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1198,9 +1144,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1269,9 +1212,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1345,9 +1285,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1422,9 +1359,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1472,9 +1406,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1546,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1621,9 +1549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1704,9 +1629,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1747,9 +1669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1799,9 +1718,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1850,9 +1766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1926,9 +1839,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1995,9 +1905,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2138,9 +2045,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2214,9 +2118,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2290,9 +2191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2352,9 +2250,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2407,9 +2302,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2471,9 +2363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2493,7 +2382,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2513,7 +2402,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2522,9 +2411,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2573,7 +2459,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2593,7 +2479,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2602,9 +2488,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2652,17 +2535,10 @@ "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { @@ -2672,7 +2548,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2681,9 +2557,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2744,9 +2617,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2795,7 +2665,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2828,9 +2698,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2907,9 +2774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3053,9 +2917,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3129,9 +2990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3198,9 +3056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3278,9 +3133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3328,9 +3180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3399,9 +3248,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3527,9 +3373,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3659,9 +3502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3719,9 +3559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4209,9 +4046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4293,9 +4127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4387,9 +4218,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4457,7 +4285,7 @@ "tags": [ "assistant" ], - "description": "", + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", "responses": { "200": { "description": "File" @@ -4465,7 +4293,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4479,9 +4307,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4534,7 +4359,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4548,9 +4373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4598,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4673,9 +4492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4725,7 +4541,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4745,7 +4561,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4754,9 +4570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4828,9 +4641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4889,9 +4699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4967,9 +4774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5030,9 +4834,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5115,9 +4916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5221,9 +5019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5292,9 +5087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5393,9 +5185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5466,9 +5255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5552,9 +5338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5636,7 +5419,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5660,9 +5443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5773,9 +5553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5857,7 +5634,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5881,9 +5658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5994,9 +5768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6078,7 +5849,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -6102,9 +5873,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6215,9 +5983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6308,7 +6073,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6332,9 +6097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6454,9 +6216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6548,7 +6307,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6572,9 +6331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6697,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6791,7 +6544,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6815,9 +6568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6940,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7024,7 +6771,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -7048,9 +6795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7161,9 +6905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7294,9 +7035,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7389,7 +7127,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7413,9 +7151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7477,7 +7212,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7531,9 +7266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7615,7 +7347,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7639,9 +7371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7783,9 +7512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7856,9 +7582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7914,7 +7637,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7938,9 +7661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8050,9 +7770,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8137,9 +7854,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8246,9 +7960,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8343,9 +8054,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8444,9 +8152,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8528,9 +8233,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8623,9 +8325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8707,9 +8406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8829,9 +8525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8902,9 +8595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8984,9 +8674,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9040,7 +8727,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageCollection", @@ -9060,7 +8747,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9069,9 +8756,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9163,9 +8847,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9209,7 +8890,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabase", @@ -9229,7 +8910,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9238,9 +8919,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9308,7 +8986,7 @@ }, "x-appwrite": { "method": "list", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9322,9 +9000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9383,7 +9058,7 @@ }, "x-appwrite": { "method": "create", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9397,9 +9072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9487,7 +9159,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9630,7 +9304,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9644,9 +9318,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9681,7 +9352,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9696,9 +9367,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9733,7 +9401,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9747,9 +9415,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9835,7 +9500,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9849,9 +9514,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9882,7 +9544,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -9897,12 +9559,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9911,9 +9573,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9971,7 +9630,7 @@ }, "x-appwrite": { "method": "get", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9985,9 +9644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10032,7 +9688,7 @@ }, "x-appwrite": { "method": "update", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10046,9 +9702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10143,7 +9796,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -10256,7 +9911,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10270,9 +9925,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10319,7 +9971,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10333,9 +9985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10404,7 +10053,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 298, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10418,9 +10067,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10502,7 +10148,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10516,9 +10162,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10573,7 +10216,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10587,9 +10230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10637,7 +10277,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10651,9 +10291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10695,7 +10332,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -10703,12 +10340,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10717,9 +10354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10775,7 +10409,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -10790,12 +10424,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10804,9 +10438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10856,7 +10487,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 295, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -10871,9 +10502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10931,7 +10559,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10947,9 +10575,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11019,7 +10644,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11035,9 +10660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11136,7 +10758,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11152,9 +10774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11203,7 +10822,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11217,9 +10836,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11261,7 +10877,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11276,12 +10892,12 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11290,9 +10906,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11360,7 +10973,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11374,9 +10987,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11421,7 +11031,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11435,9 +11045,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11509,7 +11116,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11523,9 +11130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11580,7 +11184,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11594,9 +11198,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11668,7 +11269,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11682,9 +11283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11741,7 +11339,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11757,9 +11355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11795,7 +11390,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -11811,9 +11406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11863,9 +11455,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11914,9 +11503,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11965,9 +11551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12016,9 +11599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12078,9 +11658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12129,9 +11706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12180,9 +11754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12231,9 +11802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12295,9 +11863,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12359,9 +11924,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12434,9 +11996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12498,9 +12057,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12588,9 +12144,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12652,9 +12205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12716,9 +12266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12780,9 +12327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12844,9 +12388,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12908,9 +12449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12972,9 +12510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13036,9 +12571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13100,9 +12632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13151,9 +12680,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13202,9 +12728,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13255,9 +12778,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13309,9 +12829,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13363,9 +12880,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13417,9 +12931,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13471,9 +12982,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13525,9 +13033,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13579,9 +13084,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13633,9 +13135,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13671,7 +13170,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 389, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13686,9 +13185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13749,7 +13245,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 386, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -13764,9 +13260,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13880,7 +13373,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13895,7 +13388,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 393, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13910,9 +13403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14043,7 +13533,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 388, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14058,9 +13548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14118,7 +13605,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "x-example": "{}" }, "action": { @@ -14138,7 +13625,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "x-example": "" }, "color": { @@ -14152,9 +13639,9 @@ "x-example": "" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "x-example": "" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null }, "draft": { "type": "boolean", @@ -14165,12 +13652,31 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -14185,7 +13691,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14200,7 +13706,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 395, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14215,9 +13721,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14329,6 +13832,27 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -14359,7 +13883,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 387, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -14374,9 +13898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14455,7 +13976,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14470,12 +13991,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 394, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -14485,9 +14006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14584,7 +14102,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 392, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14599,9 +14117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14639,7 +14154,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 396, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14654,9 +14169,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14703,7 +14215,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 390, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14718,9 +14230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14780,7 +14289,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 391, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14795,9 +14304,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14857,7 +14363,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 361, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14872,9 +14378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14935,7 +14438,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 360, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14950,9 +14453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15042,7 +14542,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 373, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15057,9 +14557,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15152,7 +14649,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 359, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15167,9 +14664,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15239,7 +14733,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 372, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15254,9 +14748,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15329,7 +14820,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 351, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15344,9 +14835,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15446,7 +14934,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 364, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15461,9 +14949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15566,7 +15051,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 354, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15581,9 +15066,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15663,7 +15145,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 367, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15678,9 +15160,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15763,7 +15242,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 352, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15778,9 +15257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15870,7 +15346,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 365, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15885,9 +15361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15980,7 +15453,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 353, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15995,9 +15468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16125,7 +15595,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 366, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16140,9 +15610,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16272,7 +15739,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 355, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16287,9 +15754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16369,7 +15833,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 368, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16384,9 +15848,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16469,7 +15930,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 356, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16484,9 +15945,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16566,7 +16024,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 369, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16581,9 +16039,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16666,7 +16121,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 357, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16681,9 +16136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16763,7 +16215,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 370, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16778,9 +16230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16863,7 +16312,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 358, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16878,9 +16327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16960,7 +16406,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 371, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16975,9 +16421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17060,7 +16503,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 363, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17075,9 +16518,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17115,7 +16555,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 374, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -17130,9 +16570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17179,7 +16616,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 362, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17194,9 +16631,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17256,7 +16690,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 383, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17271,9 +16705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17333,7 +16764,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 376, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17348,9 +16779,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17409,7 +16837,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 375, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17424,9 +16852,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17494,7 +16919,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 378, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17509,9 +16934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17556,7 +16978,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 379, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17571,9 +16993,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17635,7 +17054,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 380, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17650,9 +17069,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17699,7 +17115,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 377, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17714,9 +17130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17776,7 +17189,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 382, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17791,9 +17204,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17862,7 +17272,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17879,9 +17289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17954,7 +17361,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 384, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17969,9 +17376,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18019,7 +17423,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18036,9 +17440,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18081,7 +17482,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", "responses": { "200": { "description": "Migrations List", @@ -18110,9 +17511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18125,7 +17523,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "schema": { "type": "array", @@ -18157,7 +17555,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", "responses": { "202": { "description": "Migration", @@ -18172,7 +17570,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18186,9 +17584,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18247,7 +17642,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18276,9 +17671,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18337,12 +17729,12 @@ }, "\/migrations\/firebase": { "post": { - "summary": "Migrate Firebase data (Service Account)", + "summary": "Migrate Firebase data", "operationId": "migrationsCreateFirebaseMigration", "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", "responses": { "202": { "description": "Migration", @@ -18371,9 +17763,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18413,177 +17802,6 @@ } } }, - "\/migrations\/firebase\/deauthorize": { - "get": { - "summary": "Revoke Appwrite's authorization to access Firebase projects", - "operationId": "migrationsDeleteFirebaseAuth", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "File" - } - }, - "x-appwrite": { - "method": "deleteFirebaseAuth", - "weight": 346, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, - "\/migrations\/firebase\/oauth": { - "post": { - "summary": "Migrate Firebase data (OAuth)", - "operationId": "migrationsCreateFirebaseOAuthMigration", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "202": { - "description": "Migration", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/migration" - } - } - } - } - }, - "x-appwrite": { - "method": "createFirebaseOAuthMigration", - "weight": 334, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/create-firebase-o-auth-migration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "resources": { - "type": "array", - "description": "List of resources to migrate", - "x-example": null, - "items": { - "type": "string" - } - }, - "projectId": { - "type": "string", - "description": "Project ID of the Firebase Project", - "x-example": "" - } - }, - "required": [ - "resources", - "projectId" - ] - } - } - } - } - } - }, - "\/migrations\/firebase\/projects": { - "get": { - "summary": "List Firebase projects", - "operationId": "migrationsListFirebaseProjects", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migrations Firebase Projects List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/firebaseProjectList" - } - } - } - } - }, - "x-appwrite": { - "method": "listFirebaseProjects", - "weight": 345, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.read", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/migrations\/firebase\/report": { "get": { "summary": "Generate a report on Firebase data", @@ -18591,7 +17809,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18620,9 +17838,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18658,80 +17873,6 @@ ] } }, - "\/migrations\/firebase\/report\/oauth": { - "get": { - "summary": "Generate a report on Firebase data using OAuth", - "operationId": "migrationsGetFirebaseReportOAuth", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migration Report", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/migrationReport" - } - } - } - } - }, - "x-appwrite": { - "method": "getFirebaseReportOAuth", - "weight": 342, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/get-firebase-report-o-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "resources", - "description": "List of resources to migrate", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "in": "query" - }, - { - "name": "projectId", - "description": "Project ID", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "query" - } - ] - } - }, "\/migrations\/nhost": { "post": { "summary": "Migrate NHost data", @@ -18739,7 +17880,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", "responses": { "202": { "description": "Migration", @@ -18768,9 +17909,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18852,7 +17990,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -18867,7 +18005,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 348, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18881,9 +18019,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18987,7 +18122,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", "responses": { "202": { "description": "Migration", @@ -19016,9 +18151,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19094,7 +18226,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19109,7 +18241,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 347, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -19123,9 +18255,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19220,7 +18349,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", "responses": { "200": { "description": "Migration", @@ -19249,9 +18378,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19280,7 +18406,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", "responses": { "202": { "description": "Migration", @@ -19295,7 +18421,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 349, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19309,9 +18435,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19340,7 +18463,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", "responses": { "204": { "description": "No content" @@ -19348,7 +18471,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 350, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19362,9 +18485,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19395,7 +18515,7 @@ "tags": [ "project" ], - "description": "", + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", "responses": { "200": { "description": "UsageProject", @@ -19410,12 +18530,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19424,9 +18544,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19500,7 +18617,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19514,9 +18631,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19548,7 +18662,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19562,9 +18676,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19623,7 +18734,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19637,9 +18748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19683,7 +18791,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19697,9 +18805,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19760,7 +18865,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19774,9 +18879,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19807,7 +18909,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all projects. You can use the query params to filter your results. ", "responses": { "200": { "description": "Projects List", @@ -19827,7 +18929,7 @@ "type": "", "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19836,9 +18938,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19881,7 +18980,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new project. You can create a maximum of 100 projects per account. ", "responses": { "201": { "description": "Project", @@ -19901,7 +19000,7 @@ "type": "", "deprecated": false, "demo": "projects\/create.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19910,9 +19009,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20018,7 +19114,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", "responses": { "200": { "description": "Project", @@ -20038,7 +19134,7 @@ "type": "", "deprecated": false, "demo": "projects\/get.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20047,9 +19143,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20078,7 +19171,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a project by its unique ID.", "responses": { "200": { "description": "Project", @@ -20098,7 +19191,7 @@ "type": "", "deprecated": false, "demo": "projects\/update.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20107,9 +19200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20202,7 +19292,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a project by its unique ID.", "responses": { "204": { "description": "No content" @@ -20210,12 +19300,12 @@ }, "x-appwrite": { "method": "delete", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20224,9 +19314,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20257,7 +19344,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", "responses": { "200": { "description": "Project", @@ -20277,7 +19364,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-api-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20286,9 +19373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20351,7 +19435,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", "responses": { "200": { "description": "Project", @@ -20371,7 +19455,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-api-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20380,9 +19464,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20432,7 +19513,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update how long sessions created within a project should stay active for.", "responses": { "200": { "description": "Project", @@ -20447,12 +19528,12 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-duration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20461,9 +19542,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20513,7 +19591,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", "responses": { "200": { "description": "Project", @@ -20528,12 +19606,12 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20542,9 +19620,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20594,7 +19669,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", "responses": { "200": { "description": "Project", @@ -20609,12 +19684,12 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20623,9 +19698,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20668,6 +19740,96 @@ } } }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "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": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + } + } + } + }, "\/projects\/{projectId}\/auth\/mock-numbers": { "patch": { "summary": "Update the mock numbers for the project", @@ -20675,7 +19837,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", "responses": { "200": { "description": "Project", @@ -20690,12 +19852,12 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-mock-numbers.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20704,9 +19866,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20759,7 +19918,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", "responses": { "200": { "description": "Project", @@ -20774,12 +19933,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20788,9 +19947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20840,7 +19996,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", "responses": { "200": { "description": "Project", @@ -20855,12 +20011,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-history.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20869,9 +20025,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20921,7 +20074,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", "responses": { "200": { "description": "Project", @@ -20936,12 +20089,12 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-personal-data-check.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20950,9 +20103,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21002,7 +20152,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", "responses": { "200": { "description": "Project", @@ -21022,7 +20172,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-session-alerts.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21031,9 +20181,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21083,7 +20230,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", "responses": { "200": { "description": "Project", @@ -21098,12 +20245,12 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21112,9 +20259,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21185,7 +20329,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", "responses": { "201": { "description": "JWT", @@ -21200,12 +20344,12 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-j-w-t.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21214,9 +20358,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21274,7 +20415,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all API keys from the current project. ", "responses": { "200": { "description": "API Keys List", @@ -21289,12 +20430,12 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-keys.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21303,9 +20444,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21334,7 +20472,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", "responses": { "201": { "description": "Key", @@ -21349,12 +20487,12 @@ }, "x-appwrite": { "method": "createKey", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21363,9 +20501,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21429,7 +20564,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", "responses": { "200": { "description": "Key", @@ -21444,12 +20579,12 @@ }, "x-appwrite": { "method": "getKey", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21458,9 +20593,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21499,7 +20631,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", "responses": { "200": { "description": "Key", @@ -21514,12 +20646,12 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21528,9 +20660,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21602,7 +20731,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", "responses": { "204": { "description": "No content" @@ -21610,12 +20739,12 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21624,9 +20753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21667,7 +20793,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", "responses": { "200": { "description": "Project", @@ -21687,7 +20813,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-o-auth2.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21696,9 +20822,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21806,7 +20929,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", "responses": { "200": { "description": "Platforms List", @@ -21821,12 +20944,12 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-platforms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21835,9 +20958,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21866,7 +20986,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", "responses": { "201": { "description": "Platform", @@ -21881,12 +21001,12 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21895,9 +21015,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21987,7 +21104,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", "responses": { "200": { "description": "Platform", @@ -22002,12 +21119,12 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22016,9 +21133,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22057,7 +21171,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", "responses": { "200": { "description": "Platform", @@ -22072,12 +21186,12 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22086,9 +21200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22161,7 +21272,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", "responses": { "204": { "description": "No content" @@ -22169,12 +21280,12 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22183,9 +21294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22226,7 +21334,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", "responses": { "200": { "description": "Project", @@ -22246,7 +21354,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-service-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22255,9 +21363,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22328,7 +21433,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", "responses": { "200": { "description": "Project", @@ -22348,7 +21453,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-service-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22357,9 +21462,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22409,7 +21511,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", "responses": { "200": { "description": "Project", @@ -22424,12 +21526,12 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-smtp.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22438,9 +21540,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22536,7 +21635,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Send a test email to verify SMTP configuration. ", "responses": { "204": { "description": "No content" @@ -22544,12 +21643,12 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-smtp-test.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22558,9 +21657,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22662,7 +21758,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the team ID of a project allowing for it to be transferred to another team.", "responses": { "200": { "description": "Project", @@ -22682,7 +21778,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-team.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22691,9 +21787,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22743,7 +21836,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", "responses": { "200": { "description": "EmailTemplate", @@ -22758,12 +21851,12 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22772,9 +21865,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22969,14 +22059,14 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/project" + "$ref": "#\/components\/schemas\/emailTemplate" } } } @@ -22984,12 +22074,12 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22998,9 +22088,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23235,7 +22322,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", "responses": { "200": { "description": "EmailTemplate", @@ -23250,12 +22337,12 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23264,9 +22351,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23463,7 +22547,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", "responses": { "200": { "description": "SmsTemplate", @@ -23478,12 +22562,12 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23492,9 +22576,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23686,7 +22767,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", "responses": { "200": { "description": "SmsTemplate", @@ -23701,12 +22782,12 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23715,9 +22796,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23928,7 +23006,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", "responses": { "200": { "description": "SmsTemplate", @@ -23943,12 +23021,12 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23957,9 +23035,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24153,7 +23228,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", "responses": { "200": { "description": "Webhooks List", @@ -24168,12 +23243,12 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-webhooks.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24182,9 +23257,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24213,7 +23285,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", "responses": { "201": { "description": "Webhook", @@ -24228,12 +23300,12 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24242,9 +23314,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24330,7 +23399,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", "responses": { "200": { "description": "Webhook", @@ -24345,12 +23414,12 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24359,9 +23428,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24400,7 +23466,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", "responses": { "200": { "description": "Webhook", @@ -24415,12 +23481,12 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24429,9 +23495,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24525,7 +23588,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", "responses": { "204": { "description": "No content" @@ -24533,12 +23596,12 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24547,9 +23610,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24590,7 +23650,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", "responses": { "200": { "description": "Webhook", @@ -24605,12 +23665,12 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook-signature.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24619,9 +23679,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24677,7 +23734,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24691,9 +23748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24751,7 +23805,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -24765,9 +23819,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24837,7 +23888,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24851,9 +23902,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24890,7 +23938,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24904,9 +23952,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24937,7 +23982,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "responses": { "200": { "description": "Rule", @@ -24952,12 +23997,12 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24966,9 +24011,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25014,7 +24056,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25028,9 +24070,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25089,7 +24128,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25103,9 +24142,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25218,7 +24254,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25232,9 +24268,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25279,7 +24312,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25293,9 +24326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25405,7 +24435,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25419,9 +24449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25468,7 +24495,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25484,9 +24511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25556,7 +24580,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -25572,9 +24596,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25656,7 +24677,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25672,9 +24693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25730,7 +24748,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -25746,9 +24764,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25821,7 +24836,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25837,9 +24852,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25890,7 +24902,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25906,9 +24918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25959,7 +24968,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -25975,9 +24984,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26151,6 +25157,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -26177,7 +25184,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26193,9 +25200,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26238,7 +25242,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "StorageUsage", @@ -26253,12 +25257,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26267,9 +25271,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26312,7 +25313,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageBuckets", @@ -26327,12 +25328,12 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26341,9 +25342,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26411,7 +25409,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26427,9 +25425,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26489,7 +25484,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26505,9 +25500,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26576,7 +25568,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26592,9 +25584,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26640,7 +25629,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26656,9 +25645,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26716,7 +25702,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26732,9 +25718,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26782,7 +25765,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26796,9 +25779,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26842,7 +25822,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -26857,7 +25837,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26873,9 +25853,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26945,7 +25922,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26961,9 +25938,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27043,7 +26017,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -27058,7 +26032,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27074,9 +26048,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27132,7 +26103,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27148,9 +26119,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27221,7 +26189,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27237,9 +26205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27297,7 +26262,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27312,9 +26277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27396,7 +26358,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27411,9 +26373,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27458,7 +26417,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27473,9 +26432,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27541,7 +26497,7 @@ }, "x-appwrite": { "method": "list", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -27555,9 +26511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27616,7 +26569,7 @@ }, "x-appwrite": { "method": "create", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -27630,9 +26583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27706,7 +26656,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27720,9 +26670,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27793,7 +26740,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27807,9 +26754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27880,7 +26824,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -27894,9 +26838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27950,7 +26891,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -27964,9 +26905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28013,7 +26951,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28027,9 +26965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28100,7 +27035,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28114,9 +27049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28187,7 +27119,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28201,9 +27133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28304,7 +27233,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28318,9 +27247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28409,7 +27335,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28423,9 +27349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28501,7 +27424,7 @@ "tags": [ "users" ], - "description": "", + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageUsers", @@ -28516,12 +27439,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, "demo": "users\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -28530,9 +27453,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28590,7 +27510,7 @@ }, "x-appwrite": { "method": "get", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -28604,9 +27524,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28644,7 +27561,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -28658,9 +27575,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28707,7 +27621,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28721,9 +27635,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28789,7 +27700,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -28803,9 +27714,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28873,7 +27781,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -28887,9 +27795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28958,7 +27863,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28972,9 +27877,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29034,7 +27936,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29048,9 +27950,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29097,7 +27996,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29111,9 +28010,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29166,20 +28062,13 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29193,9 +28082,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29257,7 +28143,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29271,9 +28157,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29320,7 +28203,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29334,9 +28217,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29381,7 +28261,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29395,9 +28275,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29442,7 +28319,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29456,9 +28333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29505,7 +28379,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -29519,9 +28393,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29587,7 +28458,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29601,9 +28472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29669,7 +28537,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29683,9 +28551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29751,7 +28616,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -29765,9 +28630,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29812,7 +28674,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29826,9 +28688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29894,7 +28753,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29908,9 +28767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29955,7 +28811,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29969,9 +28825,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30009,7 +28862,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30023,9 +28876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30065,7 +28915,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30079,9 +28929,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30138,7 +28985,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30152,9 +28999,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30220,7 +29064,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30235,9 +29079,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30295,7 +29136,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30310,9 +29151,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30407,7 +29245,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30422,9 +29260,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30479,7 +29314,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30494,9 +29329,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30570,7 +29402,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -30585,9 +29417,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30644,7 +29473,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -30658,9 +29487,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30728,7 +29554,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -30742,9 +29568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30810,7 +29633,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -30824,9 +29647,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30877,7 +29697,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", "responses": { "200": { "description": "Provider Repositories List", @@ -30892,12 +29712,12 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repositories.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -30906,9 +29726,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30948,7 +29765,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", "responses": { "200": { "description": "ProviderRepository", @@ -30963,12 +29780,12 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -30977,9 +29794,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31035,7 +29849,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", "responses": { "200": { "description": "ProviderRepository", @@ -31050,12 +29864,12 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31064,9 +29878,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31107,7 +29918,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", "responses": { "200": { "description": "Branches List", @@ -31122,12 +29933,12 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repository-branches.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31136,9 +29947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31179,7 +29987,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", "responses": { "200": { "description": "VCS Content List", @@ -31194,12 +30002,12 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 276, + "weight": 277, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository-contents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31208,9 +30016,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31262,7 +30067,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "Detection", @@ -31277,12 +30082,12 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 277, + "weight": 278, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository-detection.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31291,9 +30096,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31350,7 +30152,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", "responses": { "204": { "description": "No content" @@ -31358,12 +30160,12 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/update-external-deployments.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31372,9 +30174,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31434,7 +30233,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", "responses": { "200": { "description": "Installations List", @@ -31449,7 +30248,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -31463,9 +30262,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31510,7 +30306,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", "responses": { "200": { "description": "Installation", @@ -31525,7 +30321,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 284, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31539,9 +30335,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31570,7 +30363,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", "responses": { "204": { "description": "No content" @@ -31578,7 +30371,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31592,9 +30385,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32654,30 +31444,6 @@ "migrations" ] }, - "firebaseProjectList": { - "description": "Migrations Firebase Projects List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of projects documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "projects": { - "type": "array", - "description": "List of projects.", - "items": { - "$ref": "#\/components\/schemas\/firebaseProject" - }, - "x-example": "" - } - }, - "required": [ - "total", - "projects" - ] - }, "specificationList": { "description": "Specifications List", "type": "object", @@ -34866,12 +33632,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -34901,7 +33667,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -35014,7 +33780,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -35066,7 +33832,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -35982,6 +34748,21 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -36187,6 +34968,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -36863,7 +35647,8 @@ "resourceId": { "type": "string", "description": "Resource ID.", - "x-example": "5e5ea5c16897e" + "x-example": "5e5ea5c16897e", + "nullable": true }, "name": { "type": "string", @@ -36875,10 +35660,16 @@ "description": "The value of this metric at the timestamp.", "x-example": 1, "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "nullable": true } }, "required": [ - "resourceId", "name", "value" ] @@ -36916,6 +35707,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "databases": { "type": "array", "description": "Aggregated number of databases per period.", @@ -36947,6 +35750,22 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -36955,10 +35774,14 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", "databases", "collections", "documents", - "storage" + "storage", + "databasesReads", + "databasesWrites" ] }, "usageDatabase": { @@ -36988,6 +35811,18 @@ "x-example": 0, "format": "int32" }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "collections": { "type": "array", "description": "Aggregated number of collections per period.", @@ -37011,6 +35846,22 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -37018,9 +35869,13 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", "collections", "documents", - "storage" + "storage", + "databaseReads", + "databaseWrites" ] }, "usageCollection": { @@ -37615,6 +36470,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "requests": { "type": "array", "description": "Aggregated number of requests per period.", @@ -37694,6 +36561,42 @@ "$ref": "#\/components\/schemas\/metricBreakdown" }, "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -37709,6 +36612,8 @@ "bucketsTotal", "executionsMbSecondsTotal", "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", "requests", "network", "users", @@ -37718,7 +36623,12 @@ "databasesStorageBreakdown", "executionsMbSecondsBreakdown", "buildsMbSecondsBreakdown", - "functionsStorageBreakdown" + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites" ] }, "headers": { @@ -37765,7 +36675,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38403,7 +37313,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38425,6 +37335,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38434,7 +37349,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -38471,9 +37387,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -38507,6 +37428,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", @@ -38582,26 +37504,6 @@ "size", "version" ] - }, - "firebaseProject": { - "description": "MigrationFirebaseProject", - "type": "object", - "properties": { - "projectId": { - "type": "string", - "description": "Project ID.", - "x-example": "my-project" - }, - "displayName": { - "type": "string", - "description": "Project display name.", - "x-example": "My Project" - } - }, - "required": [ - "projectId", - "displayName" - ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-1.6.x-server.json b/app/config/specs/open-api3-1.6.x-server.json index 44270f16af..68d408762a 100644 --- a/app/config/specs/open-api3-1.6.x-server.json +++ b/app/config/specs/open-api3-1.6.x-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -110,9 +107,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -197,9 +191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -276,9 +267,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -338,9 +326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -404,9 +389,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -455,9 +437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -524,9 +503,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -597,9 +573,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -666,9 +639,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -747,9 +717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -818,9 +785,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -866,10 +830,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -894,9 +858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -973,9 +934,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1027,9 +985,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1079,9 +1034,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1131,9 +1083,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1185,9 +1134,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1258,9 +1204,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1336,9 +1279,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1415,9 +1355,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1467,9 +1404,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1543,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1620,9 +1551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1705,9 +1633,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1750,9 +1675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1804,9 +1726,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1855,9 +1774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1931,9 +1847,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2007,9 +1920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2083,9 +1993,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2159,9 +2066,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2223,9 +2127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2280,9 +2181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2346,9 +2244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2400,9 +2295,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2451,7 +2343,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2484,9 +2376,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2563,9 +2452,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2709,9 +2595,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2785,9 +2668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2856,9 +2736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2938,9 +2815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2990,9 +2864,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3063,9 +2934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3193,9 +3061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3327,9 +3192,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3389,9 +3251,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3881,9 +3740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3967,9 +3823,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4063,9 +3916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4164,9 +4014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4240,9 +4087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4322,9 +4166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4384,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4463,9 +4301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4527,9 +4362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4613,9 +4445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4720,9 +4549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4792,9 +4618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4894,9 +4717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4968,9 +4788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5055,9 +4872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5140,7 +4954,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5164,9 +4978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5278,9 +5089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5363,7 +5171,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5387,9 +5195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5501,9 +5306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5586,7 +5388,7 @@ "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -5610,9 +5412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5724,9 +5523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5818,7 +5614,7 @@ "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -5842,9 +5638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5965,9 +5758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6060,7 +5850,7 @@ "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6084,9 +5874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6210,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6305,7 +6089,7 @@ "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6329,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6455,9 +6236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6540,7 +6318,7 @@ "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -6564,9 +6342,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6678,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6812,9 +6584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6908,7 +6677,7 @@ "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -6932,9 +6701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6997,7 +6763,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7051,9 +6817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7136,7 +6899,7 @@ "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7160,9 +6923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7305,9 +7065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7379,9 +7136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7438,7 +7192,7 @@ "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7462,9 +7216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7575,9 +7326,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7664,9 +7412,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7775,9 +7520,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7874,9 +7616,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7977,9 +7716,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8063,9 +7799,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8148,9 +7881,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8271,9 +8001,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8345,9 +8072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8414,7 +8138,7 @@ }, "x-appwrite": { "method": "list", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8428,9 +8152,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8490,7 +8211,7 @@ }, "x-appwrite": { "method": "create", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8504,9 +8225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8595,7 +8313,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -8738,7 +8458,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8752,9 +8472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8790,7 +8507,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8805,9 +8522,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8843,7 +8557,7 @@ }, "x-appwrite": { "method": "get", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8857,9 +8571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8905,7 +8616,7 @@ }, "x-appwrite": { "method": "update", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -8919,9 +8630,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9017,7 +8725,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9130,7 +8840,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9144,9 +8854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9194,7 +8901,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9208,9 +8915,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9280,7 +8984,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 298, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9294,9 +8998,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9379,7 +9080,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9393,9 +9094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9451,7 +9149,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9465,9 +9163,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9516,7 +9211,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9530,9 +9225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9575,7 +9267,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -9583,12 +9275,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9597,9 +9289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9656,7 +9345,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -9671,12 +9360,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9685,9 +9374,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9738,7 +9424,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 295, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9753,9 +9439,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9814,7 +9497,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9830,9 +9513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -9904,7 +9584,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9920,9 +9600,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10023,7 +9700,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10039,9 +9716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10092,7 +9766,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10106,9 +9780,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10166,7 +9837,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10180,9 +9851,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10228,7 +9896,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10242,9 +9910,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10317,7 +9982,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10331,9 +9996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10389,7 +10051,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10403,9 +10065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10478,7 +10137,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10492,9 +10151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10552,7 +10208,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10568,9 +10224,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10608,7 +10261,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10624,9 +10277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10678,9 +10328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10730,9 +10377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10782,9 +10426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10834,9 +10475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10897,9 +10535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10949,9 +10584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11001,9 +10633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11053,9 +10682,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11118,9 +10744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11183,9 +10806,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11259,9 +10879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11324,9 +10941,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11415,9 +11029,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11480,9 +11091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11545,9 +11153,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11610,9 +11215,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11675,9 +11277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11740,9 +11339,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11805,9 +11401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11870,9 +11463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11935,9 +11525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11987,9 +11574,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12039,9 +11623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12093,9 +11674,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12149,9 +11727,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12205,9 +11780,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12261,9 +11833,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12317,9 +11886,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12373,9 +11939,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12429,9 +11992,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12485,9 +12045,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12525,7 +12082,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 389, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12540,9 +12097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12604,7 +12158,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 386, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -12619,9 +12173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12736,7 +12287,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -12751,7 +12302,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 393, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -12766,9 +12317,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12900,7 +12448,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 388, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12915,9 +12463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12976,7 +12521,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "x-example": "{}" }, "action": { @@ -12996,7 +12541,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "x-example": "" }, "color": { @@ -13010,9 +12555,9 @@ "x-example": "" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "x-example": "" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null }, "draft": { "type": "boolean", @@ -13023,12 +12568,31 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -13043,7 +12607,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13058,7 +12622,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 395, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13073,9 +12637,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13188,6 +12749,27 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -13218,7 +12800,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 387, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13233,9 +12815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13315,7 +12894,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13330,12 +12909,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 394, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13345,9 +12924,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13445,7 +13021,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 392, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13460,9 +13036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13501,7 +13074,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 396, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13516,9 +13089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13566,7 +13136,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 390, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13581,9 +13151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13644,7 +13211,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 391, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13659,9 +13226,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13722,7 +13286,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 361, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13737,9 +13301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13801,7 +13362,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 360, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13816,9 +13377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13909,7 +13467,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 373, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13924,9 +13482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14020,7 +13575,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 359, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14035,9 +13590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14108,7 +13660,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 372, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14123,9 +13675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14199,7 +13748,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 351, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14214,9 +13763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14317,7 +13863,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 364, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14332,9 +13878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14438,7 +13981,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 354, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14453,9 +13996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14536,7 +14076,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 367, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14551,9 +14091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14637,7 +14174,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 352, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14652,9 +14189,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14745,7 +14279,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 365, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14760,9 +14294,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14856,7 +14387,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 353, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14871,9 +14402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15002,7 +14530,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 366, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15017,9 +14545,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15150,7 +14675,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 355, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15165,9 +14690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15248,7 +14770,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 368, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15263,9 +14785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15349,7 +14868,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 356, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15364,9 +14883,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15447,7 +14963,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 369, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15462,9 +14978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15548,7 +15061,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 357, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15563,9 +15076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15646,7 +15156,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 370, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15661,9 +15171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15747,7 +15254,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 358, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15762,9 +15269,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15845,7 +15349,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 371, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15860,9 +15364,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15946,7 +15447,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 363, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15961,9 +15462,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16002,7 +15500,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 374, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16017,9 +15515,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16067,7 +15562,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 362, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16082,9 +15577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16145,7 +15637,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 383, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16160,9 +15652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16223,7 +15712,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 376, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16238,9 +15727,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16300,7 +15786,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 375, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16315,9 +15801,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16386,7 +15869,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 378, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16401,9 +15884,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16449,7 +15929,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 379, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16464,9 +15944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16529,7 +16006,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 380, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16544,9 +16021,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16594,7 +16068,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 377, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16609,9 +16083,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16672,7 +16143,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 382, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16687,9 +16158,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16759,7 +16227,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16776,9 +16244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -16853,7 +16318,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 384, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16868,9 +16333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16919,7 +16381,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16936,9 +16398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -16998,7 +16457,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17012,9 +16471,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17074,7 +16530,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17088,9 +16544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17204,7 +16657,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17218,9 +16671,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17266,7 +16716,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17280,9 +16730,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17393,7 +16840,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17407,9 +16854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17457,7 +16901,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17473,9 +16917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17547,7 +16988,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -17563,9 +17004,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17649,7 +17087,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17665,9 +17103,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17725,7 +17160,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -17741,9 +17176,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17818,7 +17250,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17834,9 +17266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17889,7 +17318,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -17905,9 +17334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17960,7 +17386,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -17976,9 +17402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18154,6 +17577,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -18180,7 +17604,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18196,9 +17620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18258,7 +17679,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18274,9 +17695,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18338,7 +17756,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18354,9 +17772,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18427,7 +17842,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18443,9 +17858,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18493,7 +17905,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18509,9 +17921,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18571,7 +17980,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18587,9 +17996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18624,7 +18030,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -18639,7 +18045,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18655,9 +18061,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18729,7 +18132,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18745,9 +18148,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18829,7 +18229,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -18844,7 +18244,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18860,9 +18260,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18920,7 +18317,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18936,9 +18333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19011,7 +18405,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19027,9 +18421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19089,7 +18480,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19104,9 +18495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19190,7 +18578,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19205,9 +18593,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19254,7 +18639,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19269,9 +18654,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19339,7 +18721,7 @@ }, "x-appwrite": { "method": "list", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19353,9 +18735,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19415,7 +18794,7 @@ }, "x-appwrite": { "method": "create", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19429,9 +18808,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19506,7 +18882,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19520,9 +18896,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19594,7 +18967,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19608,9 +18981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19682,7 +19052,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -19696,9 +19066,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19753,7 +19120,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -19767,9 +19134,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19817,7 +19181,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19831,9 +19195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19905,7 +19266,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19919,9 +19280,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19993,7 +19351,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20007,9 +19365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20111,7 +19466,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20125,9 +19480,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20217,7 +19569,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20231,9 +19583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20325,7 +19674,7 @@ }, "x-appwrite": { "method": "get", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20339,9 +19688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20380,7 +19726,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20394,9 +19740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20444,7 +19787,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20458,9 +19801,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20527,7 +19867,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -20541,9 +19881,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20612,7 +19949,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -20626,9 +19963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20698,7 +20032,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20712,9 +20046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20775,7 +20106,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -20789,9 +20120,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20839,7 +20167,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -20853,9 +20181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20909,20 +20234,13 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20936,9 +20254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21001,7 +20316,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21015,9 +20330,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21065,7 +20377,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21079,9 +20391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21127,7 +20436,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21141,9 +20450,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21189,7 +20495,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21203,9 +20509,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21253,7 +20556,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21267,9 +20570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21336,7 +20636,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21350,9 +20650,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21419,7 +20716,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21433,9 +20730,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21502,7 +20796,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -21516,9 +20810,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21564,7 +20855,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21578,9 +20869,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21647,7 +20935,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21661,9 +20949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21709,7 +20994,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21723,9 +21008,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21764,7 +21046,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21778,9 +21060,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21821,7 +21100,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21835,9 +21114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21895,7 +21171,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -21909,9 +21185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21978,7 +21251,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -21993,9 +21266,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22054,7 +21324,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22069,9 +21339,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22167,7 +21434,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22182,9 +21449,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22240,7 +21504,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22255,9 +21519,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22332,7 +21593,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22347,9 +21608,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22407,7 +21665,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22421,9 +21679,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22492,7 +21747,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -22506,9 +21761,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22575,7 +21827,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -22589,9 +21841,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -25596,12 +24845,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -25631,7 +24880,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -25744,7 +24993,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -25796,7 +25045,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -26608,7 +25857,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27056,7 +26305,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27078,6 +26327,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27087,7 +26341,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 021ae27c45..820b1f55e0 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -94,7 +91,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -109,9 +106,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -166,7 +160,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -181,7 +175,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -196,9 +190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -259,7 +250,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -274,9 +265,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -320,7 +308,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -335,9 +323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -385,7 +370,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -400,9 +385,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -436,7 +418,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -451,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -504,7 +483,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -519,9 +498,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -576,7 +552,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -591,9 +567,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -644,7 +617,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -659,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -724,7 +694,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -739,9 +709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -794,7 +761,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -809,9 +776,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -857,10 +821,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -870,7 +834,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -885,9 +849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -948,7 +909,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -963,9 +924,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1001,7 +959,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1016,9 +974,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1052,7 +1007,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1067,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1103,7 +1055,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1118,9 +1070,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1156,7 +1105,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1171,9 +1120,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1228,7 +1174,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1243,9 +1189,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1305,7 +1248,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1320,9 +1263,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1383,7 +1323,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1398,9 +1338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1434,7 +1371,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1449,9 +1386,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1506,7 +1440,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1524,9 +1458,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1570,7 +1501,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1585,7 +1516,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1600,9 +1531,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1669,7 +1597,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1684,9 +1612,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1713,7 +1638,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1728,9 +1653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1766,7 +1688,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1781,9 +1703,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1802,7 +1721,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1817,7 +1736,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1832,9 +1751,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1893,7 +1809,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1908,9 +1824,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1954,7 +1867,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "File" @@ -1962,7 +1875,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -1977,9 +1890,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2105,7 +2015,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2120,9 +2030,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2181,7 +2088,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2196,9 +2103,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2257,7 +2161,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2272,9 +2176,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2320,7 +2221,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2335,9 +2236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2376,7 +2274,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2391,9 +2289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2441,7 +2336,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2456,9 +2351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2479,7 +2371,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2494,12 +2386,12 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2508,9 +2400,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2560,7 +2449,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2575,12 +2464,12 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2589,9 +2478,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2640,27 +2526,20 @@ "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2669,9 +2548,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2703,7 +2579,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2718,7 +2594,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2733,9 +2609,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2784,7 +2657,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2799,7 +2672,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2817,9 +2690,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2873,7 +2743,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2881,7 +2751,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2896,9 +2766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3009,7 +2876,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3024,7 +2891,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3042,9 +2909,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3088,7 +2952,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3103,7 +2967,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3118,9 +2982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3173,7 +3034,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3188,9 +3049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3251,7 +3109,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3269,9 +3127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3305,7 +3160,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3320,9 +3175,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3368,7 +3220,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3376,7 +3228,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3392,9 +3244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3496,7 +3345,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3504,7 +3353,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3520,9 +3369,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3628,7 +3474,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3636,7 +3482,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3652,9 +3498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3688,7 +3531,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3696,7 +3539,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3712,9 +3555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4178,7 +4018,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -4186,7 +4026,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4202,9 +4042,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4262,7 +4099,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -4270,7 +4107,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4286,9 +4123,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4356,7 +4190,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4364,7 +4198,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4380,9 +4214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4465,7 +4296,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -4481,9 +4312,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4552,7 +4380,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -4568,9 +4396,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4661,7 +4486,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -4677,9 +4502,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4758,7 +4580,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -4774,9 +4596,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4859,7 +4678,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -4875,9 +4694,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4945,7 +4761,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -4961,9 +4777,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5033,7 +4846,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5049,9 +4862,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5084,7 +4894,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -5150,7 +4960,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5166,9 +4976,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5226,7 +5033,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5242,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5280,7 +5084,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5296,9 +5100,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5319,7 +5120,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -5334,7 +5135,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -5350,9 +5151,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5388,7 +5186,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5404,9 +5202,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5442,7 +5237,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5458,9 +5253,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5496,7 +5288,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5512,9 +5304,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5550,7 +5339,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5566,9 +5355,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5604,7 +5390,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5620,9 +5406,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5658,7 +5441,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5674,9 +5457,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5712,7 +5492,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5728,9 +5508,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5766,7 +5543,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -5783,9 +5560,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5851,7 +5625,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -5868,9 +5642,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5928,7 +5699,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -5944,9 +5715,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6001,7 +5769,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -6016,7 +5784,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6032,9 +5800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6116,7 +5881,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6132,9 +5897,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6190,7 +5952,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6206,9 +5968,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6281,7 +6040,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6297,9 +6056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6350,7 +6106,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6366,9 +6122,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6419,7 +6172,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6435,9 +6188,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6611,6 +6361,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -6637,7 +6388,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6653,9 +6404,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6713,7 +6461,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6729,9 +6477,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6791,7 +6536,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -6807,9 +6552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6878,7 +6620,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6894,9 +6636,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6942,7 +6681,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -6958,9 +6697,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7018,7 +6754,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7034,9 +6770,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7069,7 +6802,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -7084,7 +6817,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7100,9 +6833,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7157,7 +6887,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -7172,7 +6902,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7188,9 +6918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7270,7 +6997,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -7285,7 +7012,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7301,9 +7028,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7344,7 +7068,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -7359,7 +7083,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7375,9 +7099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7448,7 +7169,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7464,9 +7185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7509,7 +7227,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -7524,7 +7242,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7539,9 +7257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7624,7 +7339,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7639,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7687,7 +7399,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7702,9 +7414,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9266,12 +8975,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -9301,7 +9010,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -9826,7 +9535,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -9848,6 +9557,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -9857,7 +9571,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 04e7c76e13..7f57dfc437 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -93,7 +90,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -108,9 +105,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -171,7 +165,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 9, + "weight": 10, "cookies": false, "type": "", "deprecated": false, @@ -185,9 +179,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -206,7 +197,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -221,7 +212,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -236,9 +227,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -298,7 +286,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -313,9 +301,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -358,7 +343,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -373,9 +358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -422,7 +404,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -437,9 +419,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -473,7 +452,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -488,9 +467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -540,7 +516,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -555,9 +531,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -611,7 +584,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -626,9 +599,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -678,7 +648,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -693,9 +663,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -757,7 +724,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -772,9 +739,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -826,7 +790,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -841,9 +805,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -889,10 +850,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -902,7 +863,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -917,9 +878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -979,7 +937,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -994,9 +952,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1031,7 +986,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1046,9 +1001,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1081,7 +1033,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1096,9 +1048,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1131,7 +1080,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1146,9 +1095,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1183,7 +1129,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1198,9 +1144,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1254,7 +1197,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1269,9 +1212,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1330,7 +1270,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1345,9 +1285,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1407,7 +1344,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1422,9 +1359,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1457,7 +1391,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1472,9 +1406,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1528,7 +1459,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1546,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1591,7 +1519,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1606,7 +1534,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1621,9 +1549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1689,7 +1614,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1704,9 +1629,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1732,7 +1654,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1747,9 +1669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1784,7 +1703,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1799,9 +1718,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1820,7 +1736,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1835,7 +1751,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1850,9 +1766,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1911,7 +1824,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1926,9 +1839,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1972,7 +1882,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "File" @@ -1980,7 +1890,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -1995,9 +1905,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2123,7 +2030,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2138,9 +2045,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2199,7 +2103,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2214,9 +2118,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2275,7 +2176,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2290,9 +2191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2337,7 +2235,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2352,9 +2250,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2392,7 +2287,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2407,9 +2302,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2456,7 +2348,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2471,9 +2363,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2493,7 +2382,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2508,12 +2397,12 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2522,9 +2411,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2573,7 +2459,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2588,12 +2474,12 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2602,9 +2488,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2652,27 +2535,20 @@ "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { - "description": "No content", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/target" - } - } - } + "description": "No content" } }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2681,9 +2557,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2714,7 +2587,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2729,7 +2602,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2744,9 +2617,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2795,7 +2665,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2810,7 +2680,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2828,9 +2698,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2884,7 +2751,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2892,7 +2759,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2907,9 +2774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3020,7 +2884,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3035,7 +2899,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3053,9 +2917,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3099,7 +2960,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3114,7 +2975,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3129,9 +2990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3183,7 +3041,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3198,9 +3056,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3260,7 +3115,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3278,9 +3133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3313,7 +3165,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3328,9 +3180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3375,7 +3224,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3383,7 +3232,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3399,9 +3248,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3503,7 +3349,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3511,7 +3357,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3527,9 +3373,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3635,7 +3478,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3643,7 +3486,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3659,9 +3502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3695,7 +3535,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3703,7 +3543,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3719,9 +3559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4185,7 +4022,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -4193,7 +4030,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4209,9 +4046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4269,7 +4103,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -4277,7 +4111,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4293,9 +4127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4363,7 +4194,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4371,7 +4202,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4387,9 +4218,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4457,7 +4285,7 @@ "tags": [ "assistant" ], - "description": "", + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", "responses": { "200": { "description": "File" @@ -4465,7 +4293,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4479,9 +4307,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4534,7 +4359,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4548,9 +4373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4584,7 +4406,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4598,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4644,7 +4463,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4659,7 +4478,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4673,9 +4492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4725,7 +4541,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4740,12 +4556,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4754,9 +4570,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4814,7 +4627,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4828,9 +4641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4875,7 +4685,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4889,9 +4699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4953,7 +4760,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -4967,9 +4774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5016,7 +4820,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -5030,9 +4834,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5101,7 +4902,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -5115,9 +4916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5207,7 +5005,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -5221,9 +5019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5278,7 +5073,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -5292,9 +5087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5379,7 +5171,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5393,9 +5185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5452,7 +5241,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5466,9 +5255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5523,7 +5309,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5538,7 +5324,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5552,9 +5338,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5636,7 +5419,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5646,7 +5429,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5660,9 +5443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5759,7 +5539,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5773,9 +5553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5857,7 +5634,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5867,7 +5644,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5881,9 +5658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5965,7 +5739,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5980,7 +5754,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -5994,9 +5768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6073,12 +5844,12 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -6088,7 +5859,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -6102,9 +5873,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6186,7 +5954,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6201,7 +5969,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -6215,9 +5983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6303,12 +6068,12 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -6318,7 +6083,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6332,9 +6097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6425,7 +6187,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6440,7 +6202,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6454,9 +6216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6543,12 +6302,12 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6558,7 +6317,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6572,9 +6331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6668,7 +6424,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6683,7 +6439,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6697,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6786,12 +6539,12 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6801,7 +6554,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6815,9 +6568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6911,7 +6661,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6926,7 +6676,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -6940,9 +6690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7019,12 +6766,12 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -7034,7 +6781,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -7048,9 +6795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7132,7 +6876,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -7147,7 +6891,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -7161,9 +6905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7265,7 +7006,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -7280,7 +7021,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -7294,9 +7035,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7384,12 +7122,12 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -7399,7 +7137,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7413,9 +7151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7477,7 +7212,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7502,7 +7237,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7517,7 +7252,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7531,9 +7266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7610,12 +7342,12 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7625,7 +7357,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7639,9 +7371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7769,7 +7498,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7783,9 +7512,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7842,7 +7568,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7856,9 +7582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7909,12 +7632,12 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7924,7 +7647,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -7938,9 +7661,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8034,7 +7754,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -8050,9 +7770,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8121,7 +7838,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -8137,9 +7854,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8230,7 +7944,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -8246,9 +7960,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8327,7 +8038,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8343,9 +8054,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8428,7 +8136,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8444,9 +8152,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8514,7 +8219,7 @@ }, "x-appwrite": { "method": "listDocumentLogs", - "weight": 110, + "weight": 111, "cookies": false, "type": "", "deprecated": false, @@ -8528,9 +8233,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8609,7 +8311,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8623,9 +8325,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8678,7 +8377,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8693,7 +8392,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8707,9 +8406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8815,7 +8511,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8829,9 +8525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8888,7 +8581,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8902,9 +8595,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8970,7 +8660,7 @@ }, "x-appwrite": { "method": "listCollectionLogs", - "weight": 77, + "weight": 78, "cookies": false, "type": "", "deprecated": false, @@ -8984,9 +8674,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9040,7 +8727,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageCollection", @@ -9055,12 +8742,12 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9069,9 +8756,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9149,7 +8833,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 71, + "weight": 72, "cookies": false, "type": "", "deprecated": false, @@ -9163,9 +8847,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9209,7 +8890,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabase", @@ -9224,12 +8905,12 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9238,9 +8919,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9308,7 +8986,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9322,9 +9000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9383,7 +9058,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9397,9 +9072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9437,6 +9109,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9455,6 +9128,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9462,24 +9137,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9622,7 +9304,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9636,9 +9318,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9658,7 +9337,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -9673,7 +9352,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9688,9 +9367,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9725,7 +9401,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9739,9 +9415,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9827,7 +9500,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9841,9 +9514,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9874,7 +9544,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -9889,12 +9559,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9903,9 +9573,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9963,7 +9630,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9977,9 +9644,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10024,7 +9688,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10038,9 +9702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10085,6 +9746,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -10103,6 +9765,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -10110,24 +9774,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -10240,7 +9911,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10254,9 +9925,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10303,7 +9971,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10317,9 +9985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10373,7 +10038,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10388,7 +10053,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10402,9 +10067,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10486,7 +10148,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10500,9 +10162,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10557,7 +10216,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10571,9 +10230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10621,7 +10277,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10635,9 +10291,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10679,7 +10332,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -10687,12 +10340,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10701,9 +10354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10759,7 +10409,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -10774,12 +10424,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10788,9 +10438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10840,7 +10487,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -10855,9 +10502,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10915,7 +10559,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -10931,9 +10575,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11003,7 +10644,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11019,9 +10660,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11054,7 +10692,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -11120,7 +10758,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11136,9 +10774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11179,7 +10814,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -11187,7 +10822,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11201,9 +10836,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11245,7 +10877,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11260,12 +10892,12 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11274,9 +10906,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11344,7 +10973,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11358,9 +10987,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11405,7 +11031,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11419,9 +11045,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11493,7 +11116,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11507,9 +11130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11564,7 +11184,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11578,9 +11198,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11652,7 +11269,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11666,9 +11283,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11725,7 +11339,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11741,9 +11355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11779,7 +11390,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -11795,9 +11406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11833,7 +11441,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -11847,9 +11455,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11884,7 +11489,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -11898,9 +11503,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11935,7 +11537,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -11949,9 +11551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11986,7 +11585,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12000,9 +11599,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12048,7 +11644,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12062,9 +11658,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12099,7 +11692,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12113,9 +11706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12150,7 +11740,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12164,9 +11754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12201,7 +11788,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12215,9 +11802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12265,7 +11849,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12279,9 +11863,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12329,7 +11910,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12343,9 +11924,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12404,7 +11982,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12418,9 +11996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12453,7 +12028,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -12468,7 +12043,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12482,9 +12057,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12558,7 +12130,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12572,9 +12144,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12622,7 +12191,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12636,9 +12205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12686,7 +12252,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12700,9 +12266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12750,7 +12313,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12764,9 +12327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12814,7 +12374,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12828,9 +12388,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12878,7 +12435,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12892,9 +12449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12942,7 +12496,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12956,9 +12510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13006,7 +12557,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13020,9 +12571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13070,7 +12618,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13084,9 +12632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13121,7 +12666,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13135,9 +12680,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13172,7 +12714,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -13186,9 +12728,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13208,7 +12747,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -13223,7 +12762,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -13239,9 +12778,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13277,7 +12813,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13293,9 +12829,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13331,7 +12864,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13347,9 +12880,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13385,7 +12915,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13401,9 +12931,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13439,7 +12966,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13455,9 +12982,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13493,7 +13017,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13509,9 +13033,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13547,7 +13068,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13563,9 +13084,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13601,7 +13119,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13617,9 +13135,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13655,7 +13170,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13670,9 +13185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13733,7 +13245,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -13748,9 +13260,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13864,7 +13373,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13879,7 +13388,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13894,9 +13403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14027,7 +13533,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14042,9 +13548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14102,7 +13605,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "x-example": "{}" }, "action": { @@ -14122,7 +13625,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "x-example": "" }, "color": { @@ -14136,9 +13639,9 @@ "x-example": "" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "x-example": "" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null }, "draft": { "type": "boolean", @@ -14149,12 +13652,31 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -14169,7 +13691,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14184,7 +13706,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14199,9 +13721,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14313,6 +13832,27 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -14343,7 +13883,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -14358,9 +13898,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14439,7 +13976,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14454,12 +13991,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -14469,9 +14006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14553,7 +14087,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14568,7 +14102,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14583,9 +14117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14623,7 +14154,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14638,9 +14169,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14687,7 +14215,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14702,9 +14230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14764,7 +14289,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14779,9 +14304,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14841,7 +14363,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14856,9 +14378,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14919,7 +14438,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14934,9 +14453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15026,7 +14542,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15041,9 +14557,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15136,7 +14649,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15151,9 +14664,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15223,7 +14733,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15238,9 +14748,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15313,7 +14820,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15328,9 +14835,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15430,7 +14934,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15445,9 +14949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15550,7 +15051,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15565,9 +15066,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15647,7 +15145,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15662,9 +15160,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15747,7 +15242,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15762,9 +15257,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15854,7 +15346,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15869,9 +15361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15964,7 +15453,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15979,9 +15468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16109,7 +15595,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16124,9 +15610,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16256,7 +15739,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16271,9 +15754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16353,7 +15833,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16368,9 +15848,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16453,7 +15930,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16468,9 +15945,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16550,7 +16024,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16565,9 +16039,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16650,7 +16121,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16665,9 +16136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16747,7 +16215,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16762,9 +16230,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16847,7 +16312,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16862,9 +16327,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16944,7 +16406,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16959,9 +16421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17029,7 +16488,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -17044,7 +16503,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17059,9 +16518,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17099,7 +16555,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -17114,9 +16570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17163,7 +16616,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17178,9 +16631,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17240,7 +16690,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17255,9 +16705,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17317,7 +16764,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17332,9 +16779,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17393,7 +16837,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17408,9 +16852,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17463,7 +16904,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17478,7 +16919,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17493,9 +16934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17525,7 +16963,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17540,7 +16978,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17555,9 +16993,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17619,7 +17054,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17634,9 +17069,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17683,7 +17115,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17698,9 +17130,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17760,7 +17189,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17775,9 +17204,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17846,7 +17272,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17863,9 +17289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17923,7 +17346,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -17938,7 +17361,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17953,9 +17376,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18003,7 +17423,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18020,9 +17440,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18065,7 +17482,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", "responses": { "200": { "description": "Migrations List", @@ -18080,7 +17497,7 @@ }, "x-appwrite": { "method": "list", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18094,9 +17511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18109,7 +17523,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "schema": { "type": "array", @@ -18141,7 +17555,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", "responses": { "202": { "description": "Migration", @@ -18156,7 +17570,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18170,9 +17584,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18231,7 +17642,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18246,7 +17657,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18260,9 +17671,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18321,12 +17729,12 @@ }, "\/migrations\/firebase": { "post": { - "summary": "Migrate Firebase data (Service Account)", + "summary": "Migrate Firebase data", "operationId": "migrationsCreateFirebaseMigration", "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", "responses": { "202": { "description": "Migration", @@ -18341,7 +17749,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18355,9 +17763,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18397,177 +17802,6 @@ } } }, - "\/migrations\/firebase\/deauthorize": { - "get": { - "summary": "Revoke Appwrite's authorization to access Firebase projects", - "operationId": "migrationsDeleteFirebaseAuth", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "File" - } - }, - "x-appwrite": { - "method": "deleteFirebaseAuth", - "weight": 345, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, - "\/migrations\/firebase\/oauth": { - "post": { - "summary": "Migrate Firebase data (OAuth)", - "operationId": "migrationsCreateFirebaseOAuthMigration", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "202": { - "description": "Migration", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/migration" - } - } - } - } - }, - "x-appwrite": { - "method": "createFirebaseOAuthMigration", - "weight": 333, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/create-firebase-o-auth-migration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "requestBody": { - "content": { - "application\/json": { - "schema": { - "type": "object", - "properties": { - "resources": { - "type": "array", - "description": "List of resources to migrate", - "x-example": null, - "items": { - "type": "string" - } - }, - "projectId": { - "type": "string", - "description": "Project ID of the Firebase Project", - "x-example": "" - } - }, - "required": [ - "resources", - "projectId" - ] - } - } - } - } - } - }, - "\/migrations\/firebase\/projects": { - "get": { - "summary": "List Firebase projects", - "operationId": "migrationsListFirebaseProjects", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migrations Firebase Projects List", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/firebaseProjectList" - } - } - } - } - }, - "x-appwrite": { - "method": "listFirebaseProjects", - "weight": 344, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.read", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/migrations\/firebase\/report": { "get": { "summary": "Generate a report on Firebase data", @@ -18575,7 +17809,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18590,7 +17824,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18604,9 +17838,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18642,80 +17873,6 @@ ] } }, - "\/migrations\/firebase\/report\/oauth": { - "get": { - "summary": "Generate a report on Firebase data using OAuth", - "operationId": "migrationsGetFirebaseReportOAuth", - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migration Report", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/migrationReport" - } - } - } - } - }, - "x-appwrite": { - "method": "getFirebaseReportOAuth", - "weight": 341, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/get-firebase-report-o-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "resources", - "description": "List of resources to migrate", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "in": "query" - }, - { - "name": "projectId", - "description": "Project ID", - "required": true, - "schema": { - "type": "string", - "x-example": "" - }, - "in": "query" - } - ] - } - }, "\/migrations\/nhost": { "post": { "summary": "Migrate NHost data", @@ -18723,7 +17880,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", "responses": { "202": { "description": "Migration", @@ -18738,7 +17895,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -18752,9 +17909,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18836,7 +17990,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -18851,7 +18005,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 347, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18865,9 +18019,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18971,7 +18122,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", "responses": { "202": { "description": "Migration", @@ -18986,7 +18137,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -19000,9 +18151,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19078,7 +18226,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19093,7 +18241,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 346, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -19107,9 +18255,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19204,7 +18349,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", "responses": { "200": { "description": "Migration", @@ -19219,7 +18364,7 @@ }, "x-appwrite": { "method": "get", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -19233,9 +18378,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19264,7 +18406,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", "responses": { "202": { "description": "Migration", @@ -19279,7 +18421,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 348, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19293,9 +18435,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19324,7 +18463,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", "responses": { "204": { "description": "No content" @@ -19332,7 +18471,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 349, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19346,9 +18485,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19379,7 +18515,7 @@ "tags": [ "project" ], - "description": "", + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", "responses": { "200": { "description": "UsageProject", @@ -19394,12 +18530,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19408,9 +18544,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19484,7 +18617,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19498,9 +18631,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19532,7 +18662,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19546,9 +18676,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19607,7 +18734,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -19621,9 +18748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19667,7 +18791,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -19681,9 +18805,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19744,7 +18865,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -19758,9 +18879,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19791,7 +18909,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all projects. You can use the query params to filter your results. ", "responses": { "200": { "description": "Projects List", @@ -19806,12 +18924,12 @@ }, "x-appwrite": { "method": "list", - "weight": 150, + "weight": 151, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19820,9 +18938,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19865,7 +18980,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new project. You can create a maximum of 100 projects per account. ", "responses": { "201": { "description": "Project", @@ -19880,12 +18995,12 @@ }, "x-appwrite": { "method": "create", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19894,9 +19009,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20002,7 +19114,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", "responses": { "200": { "description": "Project", @@ -20017,12 +19129,12 @@ }, "x-appwrite": { "method": "get", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20031,9 +19143,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20062,7 +19171,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a project by its unique ID.", "responses": { "200": { "description": "Project", @@ -20077,12 +19186,12 @@ }, "x-appwrite": { "method": "update", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20091,9 +19200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20186,7 +19292,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a project by its unique ID.", "responses": { "204": { "description": "No content" @@ -20194,12 +19300,12 @@ }, "x-appwrite": { "method": "delete", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20208,9 +19314,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20241,7 +19344,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", "responses": { "200": { "description": "Project", @@ -20256,12 +19359,12 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-api-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20270,9 +19373,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20335,7 +19435,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", "responses": { "200": { "description": "Project", @@ -20350,12 +19450,12 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-api-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20364,9 +19464,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20416,7 +19513,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update how long sessions created within a project should stay active for.", "responses": { "200": { "description": "Project", @@ -20431,12 +19528,12 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-duration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20445,9 +19542,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20497,7 +19591,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", "responses": { "200": { "description": "Project", @@ -20512,12 +19606,12 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20526,9 +19620,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20578,7 +19669,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", "responses": { "200": { "description": "Project", @@ -20593,12 +19684,12 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20607,9 +19698,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20652,6 +19740,96 @@ } } }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "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": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + } + } + } + }, "\/projects\/{projectId}\/auth\/mock-numbers": { "patch": { "summary": "Update the mock numbers for the project", @@ -20659,7 +19837,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", "responses": { "200": { "description": "Project", @@ -20674,12 +19852,12 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-mock-numbers.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20688,9 +19866,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20743,7 +19918,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", "responses": { "200": { "description": "Project", @@ -20758,12 +19933,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20772,9 +19947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20824,7 +19996,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", "responses": { "200": { "description": "Project", @@ -20839,12 +20011,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-history.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20853,9 +20025,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20905,7 +20074,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", "responses": { "200": { "description": "Project", @@ -20920,12 +20089,12 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-personal-data-check.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20934,9 +20103,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20986,7 +20152,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", "responses": { "200": { "description": "Project", @@ -21001,12 +20167,12 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-session-alerts.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21015,9 +20181,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21067,7 +20230,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", "responses": { "200": { "description": "Project", @@ -21082,12 +20245,12 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21096,9 +20259,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21169,7 +20329,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", "responses": { "201": { "description": "JWT", @@ -21184,12 +20344,12 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-j-w-t.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21198,9 +20358,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21258,7 +20415,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all API keys from the current project. ", "responses": { "200": { "description": "API Keys List", @@ -21273,12 +20430,12 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-keys.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21287,9 +20444,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21318,7 +20472,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", "responses": { "201": { "description": "Key", @@ -21333,12 +20487,12 @@ }, "x-appwrite": { "method": "createKey", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21347,9 +20501,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21413,7 +20564,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", "responses": { "200": { "description": "Key", @@ -21428,12 +20579,12 @@ }, "x-appwrite": { "method": "getKey", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21442,9 +20593,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21483,7 +20631,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", "responses": { "200": { "description": "Key", @@ -21498,12 +20646,12 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21512,9 +20660,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21586,7 +20731,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", "responses": { "204": { "description": "No content" @@ -21594,12 +20739,12 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21608,9 +20753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21651,7 +20793,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", "responses": { "200": { "description": "Project", @@ -21666,12 +20808,12 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-o-auth2.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21680,9 +20822,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21790,7 +20929,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", "responses": { "200": { "description": "Platforms List", @@ -21805,12 +20944,12 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-platforms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21819,9 +20958,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21850,7 +20986,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", "responses": { "201": { "description": "Platform", @@ -21865,12 +21001,12 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21879,9 +21015,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21971,7 +21104,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", "responses": { "200": { "description": "Platform", @@ -21986,12 +21119,12 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22000,9 +21133,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22041,7 +21171,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", "responses": { "200": { "description": "Platform", @@ -22056,12 +21186,12 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22070,9 +21200,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22145,7 +21272,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", "responses": { "204": { "description": "No content" @@ -22153,12 +21280,12 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22167,9 +21294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22210,7 +21334,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", "responses": { "200": { "description": "Project", @@ -22225,12 +21349,12 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-service-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22239,9 +21363,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22312,7 +21433,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", "responses": { "200": { "description": "Project", @@ -22327,12 +21448,12 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-service-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22341,9 +21462,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22393,7 +21511,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", "responses": { "200": { "description": "Project", @@ -22408,12 +21526,12 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-smtp.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22422,9 +21540,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22520,7 +21635,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Send a test email to verify SMTP configuration. ", "responses": { "204": { "description": "No content" @@ -22528,12 +21643,12 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-smtp-test.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22542,9 +21657,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22646,7 +21758,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the team ID of a project allowing for it to be transferred to another team.", "responses": { "200": { "description": "Project", @@ -22661,12 +21773,12 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-team.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22675,9 +21787,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22727,7 +21836,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", "responses": { "200": { "description": "EmailTemplate", @@ -22742,12 +21851,12 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22756,9 +21865,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22953,14 +22059,14 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "content": { "application\/json": { "schema": { - "$ref": "#\/components\/schemas\/project" + "$ref": "#\/components\/schemas\/emailTemplate" } } } @@ -22968,12 +22074,12 @@ }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22982,9 +22088,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23219,7 +22322,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", "responses": { "200": { "description": "EmailTemplate", @@ -23234,12 +22337,12 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23248,9 +22351,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23447,7 +22547,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", "responses": { "200": { "description": "SmsTemplate", @@ -23462,12 +22562,12 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23476,9 +22576,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23670,7 +22767,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", "responses": { "200": { "description": "SmsTemplate", @@ -23685,12 +22782,12 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23699,9 +22796,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23912,7 +23006,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", "responses": { "200": { "description": "SmsTemplate", @@ -23927,12 +23021,12 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23941,9 +23035,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24137,7 +23228,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", "responses": { "200": { "description": "Webhooks List", @@ -24152,12 +23243,12 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-webhooks.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24166,9 +23257,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24197,7 +23285,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", "responses": { "201": { "description": "Webhook", @@ -24212,12 +23300,12 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24226,9 +23314,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24314,7 +23399,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", "responses": { "200": { "description": "Webhook", @@ -24329,12 +23414,12 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24343,9 +23428,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24384,7 +23466,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", "responses": { "200": { "description": "Webhook", @@ -24399,12 +23481,12 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24413,9 +23495,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24509,7 +23588,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", "responses": { "204": { "description": "No content" @@ -24517,12 +23596,12 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24531,9 +23610,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24574,7 +23650,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", "responses": { "200": { "description": "Webhook", @@ -24589,12 +23665,12 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook-signature.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24603,9 +23679,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24661,7 +23734,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -24675,9 +23748,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24735,7 +23805,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -24749,9 +23819,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24821,7 +23888,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24835,9 +23902,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24874,7 +23938,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -24888,9 +23952,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24921,7 +23982,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "responses": { "200": { "description": "Rule", @@ -24936,12 +23997,12 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24950,9 +24011,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24998,7 +24056,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25012,9 +24070,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25073,7 +24128,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25087,9 +24142,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25202,7 +24254,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25216,9 +24268,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25263,7 +24312,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25277,9 +24326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25389,7 +24435,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25403,9 +24449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25452,7 +24495,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25468,9 +24511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25525,7 +24565,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -25540,7 +24580,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -25556,9 +24596,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25640,7 +24677,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -25656,9 +24693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25714,7 +24748,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -25730,9 +24764,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25805,7 +24836,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -25821,9 +24852,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25874,7 +24902,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -25890,9 +24918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25943,7 +24968,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -25959,9 +24984,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26135,6 +25157,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -26161,7 +25184,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26177,9 +25200,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26222,7 +25242,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "StorageUsage", @@ -26237,12 +25257,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 214, + "weight": 216, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26251,9 +25271,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26296,7 +25313,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageBuckets", @@ -26311,12 +25328,12 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 215, + "weight": 217, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26325,9 +25342,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26395,7 +25409,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26411,9 +25425,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26473,7 +25484,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26489,9 +25500,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26560,7 +25568,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -26576,9 +25584,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26624,7 +25629,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -26640,9 +25645,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26700,7 +25702,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -26716,9 +25718,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26766,7 +25765,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -26780,9 +25779,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26826,7 +25822,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -26841,7 +25837,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -26857,9 +25853,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26914,7 +25907,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -26929,7 +25922,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -26945,9 +25938,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27027,7 +26017,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -27042,7 +26032,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27058,9 +26048,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27101,7 +26088,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -27116,7 +26103,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27132,9 +26119,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27205,7 +26189,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27221,9 +26205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27266,7 +26247,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -27281,7 +26262,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27296,9 +26277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27380,7 +26358,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27395,9 +26373,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27442,7 +26417,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27457,9 +26432,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27525,7 +26497,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -27539,9 +26511,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27600,7 +26569,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -27614,9 +26583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27690,7 +26656,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -27704,9 +26670,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27777,7 +26740,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -27791,9 +26754,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27864,7 +26824,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -27878,9 +26838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27934,7 +26891,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -27948,9 +26905,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27997,7 +26951,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28011,9 +26965,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28084,7 +27035,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28098,9 +27049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28171,7 +27119,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28185,9 +27133,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28288,7 +27233,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28302,9 +27247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28393,7 +27335,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28407,9 +27349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28485,7 +27424,7 @@ "tags": [ "users" ], - "description": "", + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageUsers", @@ -28500,12 +27439,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, "demo": "users\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -28514,9 +27453,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28574,7 +27510,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -28588,9 +27524,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28628,7 +27561,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -28642,9 +27575,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28691,7 +27621,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -28705,9 +27635,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28773,7 +27700,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -28787,9 +27714,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28842,7 +27766,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -28857,7 +27781,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -28871,9 +27795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28942,7 +27863,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -28956,9 +27877,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29018,7 +27936,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29032,9 +27950,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29081,7 +27996,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29095,9 +28010,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29150,20 +28062,13 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29177,9 +28082,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29241,7 +28143,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29255,9 +28157,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29304,7 +28203,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29318,9 +28217,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29365,7 +28261,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29379,9 +28275,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29426,7 +28319,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29440,9 +28333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29489,7 +28379,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -29503,9 +28393,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29571,7 +28458,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -29585,9 +28472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29653,7 +28537,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -29667,9 +28551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29735,7 +28616,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -29749,9 +28630,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29796,7 +28674,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -29810,9 +28688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29878,7 +28753,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -29892,9 +28767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29924,7 +28796,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -29939,7 +28811,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -29953,9 +28825,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29993,7 +28862,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30007,9 +28876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30049,7 +28915,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30063,9 +28929,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30122,7 +28985,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30136,9 +28999,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30204,7 +29064,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30219,9 +29079,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30279,7 +29136,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30294,9 +29151,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30391,7 +29245,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30406,9 +29260,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30463,7 +29314,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30478,9 +29329,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30554,7 +29402,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -30569,9 +29417,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30613,7 +29458,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -30628,7 +29473,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -30642,9 +29487,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30712,7 +29554,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -30726,9 +29568,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30794,7 +29633,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -30808,9 +29647,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30861,7 +29697,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", "responses": { "200": { "description": "Provider Repositories List", @@ -30876,12 +29712,12 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repositories.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -30890,9 +29726,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30932,7 +29765,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", "responses": { "200": { "description": "ProviderRepository", @@ -30947,12 +29780,12 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -30961,9 +29794,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31019,7 +29849,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", "responses": { "200": { "description": "ProviderRepository", @@ -31034,12 +29864,12 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 279, + "weight": 281, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31048,9 +29878,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31091,7 +29918,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", "responses": { "200": { "description": "Branches List", @@ -31106,12 +29933,12 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 280, + "weight": 282, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repository-branches.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31120,9 +29947,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31163,7 +29987,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", "responses": { "200": { "description": "VCS Content List", @@ -31178,12 +30002,12 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository-contents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31192,9 +30016,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31246,7 +30067,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "Detection", @@ -31261,12 +30082,12 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository-detection.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31275,9 +30096,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31334,7 +30152,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", "responses": { "204": { "description": "No content" @@ -31342,12 +30160,12 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/update-external-deployments.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31356,9 +30174,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31418,7 +30233,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", "responses": { "200": { "description": "Installations List", @@ -31433,7 +30248,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -31447,9 +30262,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31494,7 +30306,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", "responses": { "200": { "description": "Installation", @@ -31509,7 +30321,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -31523,9 +30335,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31554,7 +30363,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", "responses": { "204": { "description": "No content" @@ -31562,7 +30371,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -31576,9 +30385,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32638,30 +31444,6 @@ "migrations" ] }, - "firebaseProjectList": { - "description": "Migrations Firebase Projects List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of projects documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "projects": { - "type": "array", - "description": "List of projects.", - "items": { - "$ref": "#\/components\/schemas\/firebaseProject" - }, - "x-example": "" - } - }, - "required": [ - "total", - "projects" - ] - }, "specificationList": { "description": "Specifications List", "type": "object", @@ -34850,12 +33632,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -34885,7 +33667,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -34998,7 +33780,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -35050,7 +33832,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -35966,6 +34748,21 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -36046,6 +34843,17 @@ "description": "SMTP server secure protocol", "x-example": "tls" }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -36160,6 +34968,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -36173,6 +34984,8 @@ "smtpUsername", "smtpPassword", "smtpSecure", + "pingCount", + "pingedAt", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -36834,7 +35647,8 @@ "resourceId": { "type": "string", "description": "Resource ID.", - "x-example": "5e5ea5c16897e" + "x-example": "5e5ea5c16897e", + "nullable": true }, "name": { "type": "string", @@ -36846,10 +35660,16 @@ "description": "The value of this metric at the timestamp.", "x-example": 1, "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "nullable": true } }, "required": [ - "resourceId", "name", "value" ] @@ -36887,6 +35707,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "databases": { "type": "array", "description": "Aggregated number of databases per period.", @@ -36918,6 +35750,22 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -36926,10 +35774,14 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", "databases", "collections", "documents", - "storage" + "storage", + "databasesReads", + "databasesWrites" ] }, "usageDatabase": { @@ -36959,6 +35811,18 @@ "x-example": 0, "format": "int32" }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "collections": { "type": "array", "description": "Aggregated number of collections per period.", @@ -36982,6 +35846,22 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -36989,9 +35869,13 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", "collections", "documents", - "storage" + "storage", + "databaseReads", + "databaseWrites" ] }, "usageCollection": { @@ -37586,6 +36470,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "requests": { "type": "array", "description": "Aggregated number of requests per period.", @@ -37665,6 +36561,42 @@ "$ref": "#\/components\/schemas\/metricBreakdown" }, "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -37680,6 +36612,8 @@ "bucketsTotal", "executionsMbSecondsTotal", "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", "requests", "network", "users", @@ -37689,7 +36623,12 @@ "databasesStorageBreakdown", "executionsMbSecondsBreakdown", "buildsMbSecondsBreakdown", - "functionsStorageBreakdown" + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites" ] }, "headers": { @@ -37736,7 +36675,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38374,7 +37313,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38396,6 +37335,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38405,7 +37349,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -38419,7 +37364,7 @@ }, "$createdAt": { "type": "string", - "description": "Variable creation date in ISO 8601 format.", + "description": "Migration creation date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$updatedAt": { @@ -38442,9 +37387,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -38478,6 +37428,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", @@ -38553,26 +37504,6 @@ "size", "version" ] - }, - "firebaseProject": { - "description": "MigrationFirebaseProject", - "type": "object", - "properties": { - "projectId": { - "type": "string", - "description": "Project ID.", - "x-example": "my-project" - }, - "displayName": { - "type": "string", - "description": "Project display name.", - "x-example": "My Project" - } - }, - "required": [ - "projectId", - "displayName" - ] } }, "securitySchemes": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 274eac9686..68d408762a 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -43,7 +43,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -58,9 +58,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -95,7 +92,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -110,9 +107,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -167,7 +161,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -182,7 +176,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -197,9 +191,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -261,7 +252,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -276,9 +267,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -323,7 +311,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -338,9 +326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -389,7 +374,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -404,9 +389,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -440,7 +422,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -455,9 +437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -509,7 +488,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -524,9 +503,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -582,7 +558,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -597,9 +573,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -651,7 +624,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -666,9 +639,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -732,7 +702,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -747,9 +717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -803,7 +770,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -818,9 +785,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -866,10 +830,10 @@ ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content", + "200": { + "description": "Session", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/session" } @@ -879,7 +843,7 @@ }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -894,9 +858,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -958,7 +919,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -973,9 +934,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1012,7 +970,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1027,9 +985,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1064,7 +1019,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1079,9 +1034,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1116,7 +1068,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1131,9 +1083,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1170,7 +1119,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1185,9 +1134,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1243,7 +1189,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1258,9 +1204,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1321,7 +1264,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1336,9 +1279,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1400,7 +1340,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1415,9 +1355,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1452,7 +1389,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1467,9 +1404,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1525,7 +1459,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1543,9 +1477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1590,7 +1521,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1605,7 +1536,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1620,9 +1551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1690,7 +1618,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1705,9 +1633,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1735,7 +1660,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1750,9 +1675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1789,7 +1711,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1804,9 +1726,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1825,7 +1744,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1840,7 +1759,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1855,9 +1774,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1916,7 +1832,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -1931,9 +1847,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1992,7 +1905,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2007,9 +1920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2068,7 +1978,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2083,9 +1993,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2144,7 +2051,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2159,9 +2066,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2208,7 +2112,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2223,9 +2127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2265,7 +2166,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2280,9 +2181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2331,7 +2229,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2346,9 +2244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2370,7 +2265,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2385,7 +2280,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2400,9 +2295,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2451,7 +2343,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2466,7 +2358,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2484,9 +2376,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2540,7 +2429,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "File" @@ -2548,7 +2437,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2563,9 +2452,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2676,7 +2562,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2691,7 +2577,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -2709,9 +2595,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2755,7 +2638,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -2770,7 +2653,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -2785,9 +2668,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2841,7 +2721,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -2856,9 +2736,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2920,7 +2797,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -2938,9 +2815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2975,7 +2849,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -2990,9 +2864,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3039,7 +2910,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image" @@ -3047,7 +2918,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3063,9 +2934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3169,7 +3037,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3177,7 +3045,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3193,9 +3061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3303,7 +3168,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3311,7 +3176,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3327,9 +3192,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3365,7 +3227,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3373,7 +3235,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3389,9 +3251,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3857,7 +3716,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image" @@ -3865,7 +3724,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -3881,9 +3740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3943,7 +3799,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image" @@ -3951,7 +3807,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -3967,9 +3823,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4039,7 +3892,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image" @@ -4047,7 +3900,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4063,9 +3916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4150,7 +4000,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4164,9 +4014,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4211,7 +4058,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4226,7 +4073,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4240,9 +4087,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4308,7 +4152,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4322,9 +4166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4370,7 +4211,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4384,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4449,7 +4287,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -4463,9 +4301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4513,7 +4348,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -4527,9 +4362,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4599,7 +4431,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -4613,9 +4445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4706,7 +4535,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -4720,9 +4549,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4778,7 +4604,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -4792,9 +4618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4880,7 +4703,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -4894,9 +4717,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4954,7 +4774,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -4968,9 +4788,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5026,7 +4843,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5041,7 +4858,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5055,9 +4872,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5140,7 +4954,7 @@ "200": { "description": "AttributeBoolean", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeBoolean" } @@ -5150,7 +4964,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5164,9 +4978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5264,7 +5075,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5278,9 +5089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5363,7 +5171,7 @@ "200": { "description": "AttributeDatetime", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeDatetime" } @@ -5373,7 +5181,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5387,9 +5195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5472,7 +5277,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5487,7 +5292,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -5501,9 +5306,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5581,12 +5383,12 @@ "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEmail" } @@ -5596,7 +5398,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -5610,9 +5412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5695,7 +5494,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5710,7 +5509,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -5724,9 +5523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5813,12 +5609,12 @@ "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeEnum" } @@ -5828,7 +5624,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -5842,9 +5638,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5936,7 +5729,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -5951,7 +5744,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -5965,9 +5758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6055,12 +5845,12 @@ "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeFloat" } @@ -6070,7 +5860,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6084,9 +5874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6181,7 +5968,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6196,7 +5983,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6210,9 +5997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6300,12 +6084,12 @@ "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeInteger" } @@ -6315,7 +6099,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6329,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6426,7 +6207,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6441,7 +6222,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -6455,9 +6236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6535,12 +6313,12 @@ "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeIp" } @@ -6550,7 +6328,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -6564,9 +6342,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6649,7 +6424,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -6664,7 +6439,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -6678,9 +6453,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6783,7 +6555,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -6798,7 +6570,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -6812,9 +6584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6903,12 +6672,12 @@ "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeString" } @@ -6918,7 +6687,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -6932,9 +6701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6997,7 +6763,7 @@ "size": { "type": "integer", "description": "Maximum size of the string attribute.", - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7022,7 +6788,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7037,7 +6803,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7051,9 +6817,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7131,12 +6894,12 @@ "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeUrl" } @@ -7146,7 +6909,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7160,9 +6923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7291,7 +7051,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7305,9 +7065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7365,7 +7122,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7379,9 +7136,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7433,12 +7187,12 @@ "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", "content": { - "": { + "application\/json": { "schema": { "$ref": "#\/components\/schemas\/attributeRelationship" } @@ -7448,7 +7202,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -7462,9 +7216,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7559,7 +7310,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -7575,9 +7326,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7648,7 +7396,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -7664,9 +7412,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7759,7 +7504,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -7775,9 +7520,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7858,7 +7600,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -7874,9 +7616,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7961,7 +7700,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -7977,9 +7716,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8049,7 +7785,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8063,9 +7799,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8119,7 +7852,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8134,7 +7867,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8148,9 +7881,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8257,7 +7987,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8271,9 +8001,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8331,7 +8058,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8345,9 +8072,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8414,7 +8138,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8428,9 +8152,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8490,7 +8211,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8504,9 +8225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8545,6 +8263,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8563,6 +8282,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8570,24 +8291,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -8730,7 +8458,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8744,9 +8472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8767,7 +8492,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -8782,7 +8507,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8797,9 +8522,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8835,7 +8557,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8849,9 +8571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8897,7 +8616,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -8911,9 +8630,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8959,6 +8675,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8977,6 +8694,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8984,24 +8703,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9114,7 +8840,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9128,9 +8854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9178,7 +8901,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9192,9 +8915,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9249,7 +8969,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9264,7 +8984,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9278,9 +8998,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9363,7 +9080,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9377,9 +9094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9435,7 +9149,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9449,9 +9163,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9500,7 +9211,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9514,9 +9225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9559,7 +9267,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -9567,12 +9275,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9581,9 +9289,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9640,7 +9345,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -9655,12 +9360,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9669,9 +9374,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9722,7 +9424,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9737,9 +9439,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9798,7 +9497,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9814,9 +9513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -9888,7 +9584,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -9904,9 +9600,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -9941,7 +9634,7 @@ "body": { "type": "string", "description": "HTTP body of execution. Default value is empty string.", - "x-example": null + "x-example": "" }, "async": { "type": "boolean", @@ -10007,7 +9700,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10023,9 +9716,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10068,7 +9758,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -10076,7 +9766,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10090,9 +9780,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10150,7 +9837,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10164,9 +9851,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10212,7 +9896,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10226,9 +9910,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10301,7 +9982,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10315,9 +9996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10373,7 +10051,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10387,9 +10065,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10462,7 +10137,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10476,9 +10151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10536,7 +10208,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10552,9 +10224,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10592,7 +10261,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10608,9 +10277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10648,7 +10314,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -10662,9 +10328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10700,7 +10363,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -10714,9 +10377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10752,7 +10412,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10766,9 +10426,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10804,7 +10461,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -10818,9 +10475,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10867,7 +10521,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -10881,9 +10535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10919,7 +10570,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -10933,9 +10584,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10971,7 +10619,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -10985,9 +10633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11023,7 +10668,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11037,9 +10682,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11088,7 +10730,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11102,9 +10744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11153,7 +10792,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11167,9 +10806,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11229,7 +10865,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11243,9 +10879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11279,7 +10912,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -11294,7 +10927,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11308,9 +10941,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11385,7 +11015,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11399,9 +11029,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11450,7 +11077,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11464,9 +11091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11515,7 +11139,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11529,9 +11153,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11580,7 +11201,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11594,9 +11215,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11645,7 +11263,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11659,9 +11277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11710,7 +11325,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11724,9 +11339,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11775,7 +11387,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11789,9 +11401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11840,7 +11449,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11854,9 +11463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11905,7 +11511,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -11919,9 +11525,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11957,7 +11560,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11971,9 +11574,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12009,7 +11609,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12023,9 +11623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12046,7 +11643,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -12061,7 +11658,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -12077,9 +11674,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12117,7 +11711,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12133,9 +11727,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12173,7 +11764,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12189,9 +11780,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12229,7 +11817,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12245,9 +11833,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12285,7 +11870,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12301,9 +11886,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12341,7 +11923,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12357,9 +11939,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12397,7 +11976,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12413,9 +11992,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12453,7 +12029,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12469,9 +12045,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12509,7 +12082,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12524,9 +12097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12588,7 +12158,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -12603,9 +12173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12720,7 +12287,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -12735,7 +12302,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -12750,9 +12317,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12884,7 +12448,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12899,9 +12463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12960,7 +12521,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "x-example": "{}" }, "action": { @@ -12980,7 +12541,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "x-example": "" }, "color": { @@ -12994,9 +12555,9 @@ "x-example": "" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "x-example": "" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null }, "draft": { "type": "boolean", @@ -13007,12 +12568,31 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -13027,7 +12607,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13042,7 +12622,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13057,9 +12637,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13172,6 +12749,27 @@ "type": "string", "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -13202,7 +12800,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13217,9 +12815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13299,7 +12894,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13314,12 +12909,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13329,9 +12924,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13414,7 +13006,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13429,7 +13021,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13444,9 +13036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13485,7 +13074,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13500,9 +13089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13550,7 +13136,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13565,9 +13151,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13628,7 +13211,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13643,9 +13226,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13706,7 +13286,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13721,9 +13301,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13785,7 +13362,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13800,9 +13377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13893,7 +13467,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13908,9 +13482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14004,7 +13575,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14019,9 +13590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14092,7 +13660,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14107,9 +13675,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14183,7 +13748,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14198,9 +13763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14301,7 +13863,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14316,9 +13878,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14422,7 +13981,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14437,9 +13996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14520,7 +14076,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14535,9 +14091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14621,7 +14174,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14636,9 +14189,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14729,7 +14279,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14744,9 +14294,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14840,7 +14387,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14855,9 +14402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14986,7 +14530,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15001,9 +14545,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15134,7 +14675,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15149,9 +14690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15232,7 +14770,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15247,9 +14785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15333,7 +14868,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15348,9 +14883,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15431,7 +14963,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15446,9 +14978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15532,7 +15061,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15547,9 +15076,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15630,7 +15156,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15645,9 +15171,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15731,7 +15254,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15746,9 +15269,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15829,7 +15349,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15844,9 +15364,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15915,7 +15432,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -15930,7 +15447,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15945,9 +15462,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15986,7 +15500,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16001,9 +15515,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16051,7 +15562,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16066,9 +15577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16129,7 +15637,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16144,9 +15652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16207,7 +15712,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16222,9 +15727,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16284,7 +15786,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16299,9 +15801,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16355,7 +15854,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16370,7 +15869,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16385,9 +15884,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16418,7 +15914,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16433,7 +15929,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16448,9 +15944,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16513,7 +16006,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16528,9 +16021,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16578,7 +16068,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16593,9 +16083,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16656,7 +16143,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16671,9 +16158,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16743,7 +16227,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16760,9 +16244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -16822,7 +16303,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -16837,7 +16318,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16852,9 +16333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16903,7 +16381,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16920,9 +16398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -16982,7 +16457,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -16996,9 +16471,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17058,7 +16530,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17072,9 +16544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17188,7 +16657,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17202,9 +16671,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17250,7 +16716,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17264,9 +16730,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17377,7 +16840,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17391,9 +16854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17441,7 +16901,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17457,9 +16917,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17516,7 +16973,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -17531,7 +16988,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -17547,9 +17004,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17633,7 +17087,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -17649,9 +17103,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17709,7 +17160,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -17725,9 +17176,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17802,7 +17250,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -17818,9 +17266,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17873,7 +17318,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -17889,9 +17334,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17944,7 +17386,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -17960,9 +17402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18138,6 +17577,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -18164,7 +17604,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18180,9 +17620,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18242,7 +17679,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18258,9 +17695,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18322,7 +17756,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18338,9 +17772,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18411,7 +17842,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18427,9 +17858,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18477,7 +17905,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18493,9 +17921,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18555,7 +17980,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -18571,9 +17996,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18608,7 +18030,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -18623,7 +18045,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -18639,9 +18061,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18698,7 +18117,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -18713,7 +18132,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -18729,9 +18148,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18813,7 +18229,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -18828,7 +18244,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -18844,9 +18260,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18889,7 +18302,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -18904,7 +18317,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -18920,9 +18333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18995,7 +18405,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19011,9 +18421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19058,7 +18465,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -19073,7 +18480,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19088,9 +18495,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19174,7 +18578,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19189,9 +18593,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19238,7 +18639,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19253,9 +18654,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19323,7 +18721,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19337,9 +18735,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19399,7 +18794,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19413,9 +18808,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19490,7 +18882,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19504,9 +18896,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19578,7 +18967,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -19592,9 +18981,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19666,7 +19052,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -19680,9 +19066,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19737,7 +19120,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -19751,9 +19134,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19801,7 +19181,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -19815,9 +19195,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19889,7 +19266,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -19903,9 +19280,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19977,7 +19351,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -19991,9 +19365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20095,7 +19466,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20109,9 +19480,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20201,7 +19569,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20215,9 +19583,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20309,7 +19674,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20323,9 +19688,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20364,7 +19726,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20378,9 +19740,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20428,7 +19787,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20442,9 +19801,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20511,7 +19867,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -20525,9 +19881,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20581,7 +19934,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -20596,7 +19949,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -20610,9 +19963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20682,7 +20032,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -20696,9 +20046,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20759,7 +20106,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -20773,9 +20120,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20823,7 +20167,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -20837,9 +20181,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20893,20 +20234,13 @@ ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/user" - } - } - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -20920,9 +20254,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20985,7 +20316,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -20999,9 +20330,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21049,7 +20377,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21063,9 +20391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21111,7 +20436,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21125,9 +20450,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21173,7 +20495,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21187,9 +20509,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21237,7 +20556,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21251,9 +20570,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21320,7 +20636,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21334,9 +20650,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21403,7 +20716,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21417,9 +20730,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21486,7 +20796,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -21500,9 +20810,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21548,7 +20855,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -21562,9 +20869,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21631,7 +20935,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -21645,9 +20949,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21678,7 +20979,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -21693,7 +20994,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -21707,9 +21008,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21748,7 +21046,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -21762,9 +21060,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21805,7 +21100,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -21819,9 +21114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21879,7 +21171,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -21893,9 +21185,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21962,7 +21251,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -21977,9 +21266,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22038,7 +21324,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22053,9 +21339,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22151,7 +21434,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22166,9 +21449,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22224,7 +21504,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22239,9 +21519,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22316,7 +21593,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22331,9 +21608,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22376,7 +21650,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -22391,7 +21665,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22405,9 +21679,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22476,7 +21747,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -22490,9 +21761,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22559,7 +21827,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -22573,9 +21841,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -25580,12 +24845,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -25615,7 +24880,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -25728,7 +24993,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -25780,7 +25045,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -26592,7 +25857,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27040,7 +26305,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27062,6 +26327,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27071,7 +26341,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-1.6.x-client.json b/app/config/specs/swagger2-1.6.x-client.json index f070b1a4b0..c0980c44ce 100644 --- a/app/config/specs/swagger2-1.6.x-client.json +++ b/app/config/specs/swagger2-1.6.x-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -102,9 +102,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -155,9 +152,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -248,9 +242,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -330,9 +321,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -394,9 +382,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -459,9 +444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -581,9 +560,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -656,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -724,9 +697,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -805,9 +775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -875,9 +842,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -922,14 +886,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -949,9 +918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1031,9 +997,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1086,9 +1049,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1139,9 +1099,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1192,9 +1149,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1247,9 +1201,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1322,9 +1273,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1403,9 +1351,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1485,9 +1430,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1538,9 +1480,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1616,9 +1555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1696,9 +1632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1785,9 +1718,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1833,9 +1763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1888,9 +1815,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1941,9 +1865,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2021,9 +1942,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2098,9 +2016,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2236,9 +2151,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2316,9 +2228,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2396,9 +2305,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2459,9 +2365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2517,9 +2420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2582,9 +2482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2611,7 +2508,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2627,7 +2524,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2636,9 +2533,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2697,7 +2591,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2713,7 +2607,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2722,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2770,13 +2661,11 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { "description": "No content" @@ -2789,7 +2678,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2798,9 +2687,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2862,9 +2748,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2922,7 +2805,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2951,9 +2834,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3040,9 +2920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3181,9 +3058,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3261,9 +3135,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3334,9 +3205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3419,9 +3287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3472,9 +3337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3555,9 +3417,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3684,9 +3543,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3817,9 +3673,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3884,9 +3737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4375,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4462,9 +4309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4557,9 +4401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4652,9 +4493,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4736,9 +4574,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4844,9 +4679,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4936,9 +4768,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5035,9 +4864,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5101,7 +4927,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5117,9 +4943,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5186,7 +5009,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5202,9 +5025,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5307,7 +5127,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5323,9 +5143,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5381,7 +5198,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5397,9 +5214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5457,7 +5271,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5473,9 +5287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5549,9 +5360,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5605,9 +5413,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5661,9 +5466,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5717,9 +5519,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5773,9 +5572,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5829,9 +5625,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5885,9 +5678,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5941,9 +5731,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5981,7 +5768,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -5998,9 +5785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6056,9 +5840,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -6070,7 +5852,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -6087,9 +5869,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6145,7 +5924,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -6161,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6230,7 +6006,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6246,9 +6022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6324,7 +6097,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6340,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6396,7 +6166,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6412,9 +6182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6487,7 +6254,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6503,9 +6270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6561,7 +6325,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6577,9 +6341,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6635,7 +6396,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6651,9 +6412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6802,6 +6560,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -6836,7 +6595,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6852,9 +6611,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6910,7 +6666,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6926,9 +6682,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6987,7 +6740,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -7003,9 +6756,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7081,7 +6831,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -7097,9 +6847,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7145,7 +6892,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7161,9 +6908,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7222,7 +6966,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7238,9 +6982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7277,7 +7018,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -7288,7 +7029,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7304,9 +7045,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7373,7 +7111,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7389,9 +7127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7479,7 +7214,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -7490,7 +7225,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7506,9 +7241,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7562,7 +7294,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7578,9 +7310,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7650,7 +7379,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7666,9 +7395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7724,7 +7450,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7739,9 +7465,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7822,7 +7545,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7837,9 +7560,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7885,7 +7605,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7900,9 +7620,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9445,12 +9162,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -9480,7 +9197,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -10008,7 +9725,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -10030,6 +9747,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -10039,7 +9761,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-1.6.x-console.json b/app/config/specs/swagger2-1.6.x-console.json index ef651e4723..94b0d55199 100644 --- a/app/config/specs/swagger2-1.6.x-console.json +++ b/app/config/specs/swagger2-1.6.x-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -114,9 +114,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -166,9 +163,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -251,9 +245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -304,9 +295,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -385,9 +373,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -448,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -512,9 +494,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -565,9 +544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -633,9 +609,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -707,9 +680,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -774,9 +744,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -854,9 +821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -923,9 +887,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -970,14 +931,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -997,9 +963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1078,9 +1041,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1132,9 +1092,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1184,9 +1141,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1236,9 +1190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1290,9 +1241,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1364,9 +1312,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1444,9 +1389,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1525,9 +1467,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1577,9 +1516,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1654,9 +1590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1733,9 +1666,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1821,9 +1751,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1868,9 +1795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1922,9 +1846,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1975,9 +1896,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2055,9 +1973,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2132,9 +2047,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2270,9 +2182,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2350,9 +2259,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2430,9 +2336,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2492,9 +2395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2549,9 +2449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2613,9 +2510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2641,7 +2535,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2657,7 +2551,7 @@ "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2666,9 +2560,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2726,7 +2617,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2742,7 +2633,7 @@ "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2751,9 +2642,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2798,13 +2686,11 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { "description": "No content" @@ -2817,7 +2703,7 @@ "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2826,9 +2712,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2889,9 +2772,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2949,7 +2829,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2978,9 +2858,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3067,9 +2944,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3208,9 +3082,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3288,9 +3159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3360,9 +3228,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3444,9 +3309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3496,9 +3358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3578,9 +3437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3707,9 +3563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3840,9 +3693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3907,9 +3757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4398,9 +4245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4485,9 +4329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4580,9 +4421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4648,7 +4486,7 @@ "tags": [ "assistant" ], - "description": "", + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", "responses": { "200": { "description": "File", @@ -4659,7 +4497,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4673,9 +4511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4731,7 +4566,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4745,9 +4580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4797,9 +4629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4871,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4932,7 +4758,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4948,7 +4774,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4957,9 +4783,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5031,9 +4854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5092,9 +4912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5172,9 +4989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5235,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5317,9 +5128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5426,9 +5234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5495,9 +5300,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5598,9 +5400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5669,9 +5468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5752,9 +5548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5829,7 +5622,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5858,9 +5653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5968,9 +5760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6045,7 +5834,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6074,9 +5865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6184,9 +5972,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6261,7 +6046,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6290,9 +6077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6400,9 +6184,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6487,7 +6268,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6516,9 +6299,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6636,9 +6416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6725,7 +6502,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6754,9 +6533,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6878,9 +6654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6967,7 +6740,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6996,9 +6771,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7120,9 +6892,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7197,7 +6966,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7226,9 +6997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7336,9 +7104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7471,9 +7236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7561,7 +7323,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7590,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7650,7 +7411,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7706,9 +7467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7783,7 +7541,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7812,9 +7572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7953,9 +7710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8024,9 +7778,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8071,7 +7822,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -8100,9 +7853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8208,9 +7958,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8292,9 +8039,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8400,9 +8144,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8492,9 +8233,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8591,9 +8329,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8671,9 +8406,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8761,9 +8493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8842,9 +8571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8964,9 +8690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9035,9 +8758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9113,9 +8833,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9170,7 +8887,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageCollection", @@ -9186,7 +8903,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9195,9 +8912,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9285,9 +8999,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9334,7 +9045,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabase", @@ -9350,7 +9061,7 @@ "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9359,9 +9070,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9427,7 +9135,7 @@ }, "x-appwrite": { "method": "list", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9441,9 +9149,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9501,7 +9206,7 @@ }, "x-appwrite": { "method": "create", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9515,9 +9220,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9609,7 +9311,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9734,7 +9438,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9772,7 +9476,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9786,9 +9490,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9825,7 +9526,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9840,9 +9541,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9879,7 +9577,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9893,9 +9591,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9977,7 +9672,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9991,9 +9686,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10028,7 +9720,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -10039,12 +9731,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 293, + "weight": 294, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10053,9 +9745,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10113,7 +9802,7 @@ }, "x-appwrite": { "method": "get", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -10127,9 +9816,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10174,7 +9860,7 @@ }, "x-appwrite": { "method": "update", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10188,9 +9874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10284,7 +9967,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -10386,7 +10071,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -10415,7 +10100,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10429,9 +10114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10478,7 +10160,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10492,9 +10174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10560,7 +10239,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 298, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10574,9 +10253,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10654,7 +10330,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10668,9 +10344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10723,7 +10396,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10737,9 +10410,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10787,7 +10457,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10801,9 +10471,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10841,11 +10508,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -10853,12 +10522,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10867,9 +10536,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10926,7 +10592,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -10937,12 +10603,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10951,9 +10617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11008,7 +10671,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 295, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -11023,9 +10686,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11081,7 +10741,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11097,9 +10757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11166,7 +10823,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11182,9 +10839,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11287,7 +10941,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11303,9 +10957,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11354,7 +11005,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11368,9 +11019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11414,7 +11062,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11425,12 +11073,12 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 292, + "weight": 293, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11439,9 +11087,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11507,7 +11152,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11521,9 +11166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11568,7 +11210,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11582,9 +11224,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11656,7 +11295,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11670,9 +11309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11725,7 +11361,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11739,9 +11375,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11813,7 +11446,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11827,9 +11460,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11884,7 +11514,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11900,9 +11530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11960,7 +11587,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -11976,9 +11603,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12050,9 +11674,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12103,9 +11724,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12156,9 +11774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12209,9 +11824,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12271,9 +11883,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12324,9 +11933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12377,9 +11983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12430,9 +12033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12494,9 +12094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12558,9 +12155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12631,9 +12225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12695,9 +12286,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12783,9 +12371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12847,9 +12432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12911,9 +12493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12975,9 +12554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13039,9 +12615,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13103,9 +12676,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13167,9 +12737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13231,9 +12798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13295,9 +12859,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13348,9 +12909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13401,9 +12959,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13456,9 +13011,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13512,9 +13064,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13568,9 +13117,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13624,9 +13170,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13680,9 +13223,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13736,9 +13276,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13792,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13848,9 +13382,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13888,7 +13419,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 389, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13903,9 +13434,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13965,7 +13493,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 386, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -13980,9 +13508,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14114,7 +13639,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14125,7 +13650,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 393, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14140,9 +13665,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14282,7 +13804,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 388, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14297,9 +13819,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14326,13 +13845,13 @@ "title": { "type": "string", "description": "Title for push notification.", - "default": null, + "default": "", "x-example": "" }, "body": { "type": "string", "description": "Body for push notification.", - "default": null, + "default": "", "x-example": "<BODY>" }, "topics": { @@ -14364,7 +13883,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "default": {}, "x-example": "{}" }, @@ -14388,7 +13907,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "default": "", "x-example": "<SOUND>" }, @@ -14405,10 +13924,10 @@ "x-example": "<TAG>" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "default": "", - "x-example": "<BADGE>" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null }, "draft": { "type": "boolean", @@ -14421,12 +13940,34 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -14446,7 +13987,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14457,7 +13998,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 395, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14472,9 +14013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14598,6 +14136,30 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -14629,7 +14191,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 387, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -14644,9 +14206,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14738,7 +14297,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14749,12 +14308,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 394, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -14764,9 +14323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14867,7 +14423,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 392, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14882,9 +14438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14912,9 +14465,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -14926,7 +14477,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 396, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14941,9 +14492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14990,7 +14538,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 390, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -15005,9 +14553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15066,7 +14611,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 391, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -15081,9 +14626,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15142,7 +14684,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 361, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15157,9 +14699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15219,7 +14758,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 360, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15234,9 +14773,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15336,7 +14872,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 373, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15351,9 +14887,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15451,7 +14984,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 359, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15466,9 +14999,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15544,7 +15074,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 372, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15559,9 +15089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15635,7 +15162,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 351, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15650,9 +15177,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15764,7 +15288,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 364, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15779,9 +15303,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15891,7 +15412,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 354, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15906,9 +15427,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15996,7 +15514,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 367, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16011,9 +15529,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16099,7 +15614,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 352, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16114,9 +15629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16216,7 +15728,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 365, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16231,9 +15743,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16331,7 +15840,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 353, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16346,9 +15855,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16492,7 +15998,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 366, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16507,9 +16013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16650,7 +16153,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 355, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16665,9 +16168,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16755,7 +16255,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 368, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16770,9 +16270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16858,7 +16355,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 356, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16873,9 +16370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16963,7 +16457,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 369, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16978,9 +16472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17066,7 +16557,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 357, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17081,9 +16572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17171,7 +16659,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 370, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -17186,9 +16674,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17274,7 +16759,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 358, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17289,9 +16774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17379,7 +16861,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 371, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -17394,9 +16876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17482,7 +16961,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 363, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17497,9 +16976,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17527,9 +17003,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17541,7 +17015,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 374, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -17556,9 +17030,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17605,7 +17076,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 362, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17620,9 +17091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17681,7 +17149,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 383, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17696,9 +17164,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17757,7 +17222,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 376, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17772,9 +17237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17832,7 +17294,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 375, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17847,9 +17309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17924,7 +17383,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 378, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17939,9 +17398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17986,7 +17442,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 379, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -18001,9 +17457,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18055,9 +17508,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18069,7 +17520,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 380, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -18084,9 +17535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18133,7 +17581,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 377, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -18148,9 +17596,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18209,7 +17654,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 382, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -18224,9 +17669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18292,7 +17734,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -18309,9 +17751,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18384,7 +17823,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 384, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -18399,9 +17838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18437,9 +17873,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18451,7 +17885,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18468,9 +17902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18515,7 +17946,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", "responses": { "200": { "description": "Migrations List", @@ -18540,9 +17971,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18555,7 +17983,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "type": "array", "collectionFormat": "multi", @@ -18590,7 +18018,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", "responses": { "202": { "description": "Migration", @@ -18601,7 +18029,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18615,9 +18043,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18686,7 +18111,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18711,9 +18136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18765,7 +18187,7 @@ }, "\/migrations\/firebase": { "post": { - "summary": "Migrate Firebase data (Service Account)", + "summary": "Migrate Firebase data", "operationId": "migrationsCreateFirebaseMigration", "consumes": [ "application\/json" @@ -18776,7 +18198,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", "responses": { "202": { "description": "Migration", @@ -18801,9 +18223,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18845,192 +18264,6 @@ ] } }, - "\/migrations\/firebase\/deauthorize": { - "get": { - "summary": "Revoke Appwrite's authorization to access Firebase projects", - "operationId": "migrationsDeleteFirebaseAuth", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "File", - "schema": { - "type": "file" - } - } - }, - "x-appwrite": { - "method": "deleteFirebaseAuth", - "weight": 346, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, - "\/migrations\/firebase\/oauth": { - "post": { - "summary": "Migrate Firebase data (OAuth)", - "operationId": "migrationsCreateFirebaseOAuthMigration", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "202": { - "description": "Migration", - "schema": { - "$ref": "#\/definitions\/migration" - } - } - }, - "x-appwrite": { - "method": "createFirebaseOAuthMigration", - "weight": 334, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/create-firebase-o-auth-migration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "resources": { - "type": "array", - "description": "List of resources to migrate", - "default": null, - "x-example": null, - "items": { - "type": "string" - } - }, - "projectId": { - "type": "string", - "description": "Project ID of the Firebase Project", - "default": null, - "x-example": "<PROJECT_ID>" - } - }, - "required": [ - "resources", - "projectId" - ] - } - } - ] - } - }, - "\/migrations\/firebase\/projects": { - "get": { - "summary": "List Firebase projects", - "operationId": "migrationsListFirebaseProjects", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migrations Firebase Projects List", - "schema": { - "$ref": "#\/definitions\/firebaseProjectList" - } - } - }, - "x-appwrite": { - "method": "listFirebaseProjects", - "weight": 345, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.read", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/migrations\/firebase\/report": { "get": { "summary": "Generate a report on Firebase data", @@ -19044,7 +18277,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -19069,9 +18302,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19104,79 +18334,6 @@ ] } }, - "\/migrations\/firebase\/report\/oauth": { - "get": { - "summary": "Generate a report on Firebase data using OAuth", - "operationId": "migrationsGetFirebaseReportOAuth", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migration Report", - "schema": { - "$ref": "#\/definitions\/migrationReport" - } - } - }, - "x-appwrite": { - "method": "getFirebaseReportOAuth", - "weight": 342, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/get-firebase-report-o-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "resources", - "description": "List of resources to migrate", - "required": true, - "type": "array", - "collectionFormat": "multi", - "items": { - "type": "string" - }, - "in": "query" - }, - { - "name": "projectId", - "description": "Project ID", - "required": true, - "type": "string", - "x-example": "<PROJECT_ID>", - "in": "query" - } - ] - } - }, "\/migrations\/nhost": { "post": { "summary": "Migrate NHost data", @@ -19190,7 +18347,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", "responses": { "202": { "description": "Migration", @@ -19215,9 +18372,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19313,7 +18467,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19324,7 +18478,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 348, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19338,9 +18492,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19435,7 +18586,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", "responses": { "202": { "description": "Migration", @@ -19460,9 +18611,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19551,7 +18699,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19562,7 +18710,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 347, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -19576,9 +18724,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19666,7 +18811,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", "responses": { "200": { "description": "Migration", @@ -19691,9 +18836,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19726,7 +18868,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", "responses": { "202": { "description": "Migration", @@ -19737,7 +18879,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 349, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19751,9 +18893,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19784,7 +18923,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", "responses": { "204": { "description": "No content" @@ -19792,7 +18931,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 350, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19806,9 +18945,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19843,7 +18979,7 @@ "tags": [ "project" ], - "description": "", + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", "responses": { "200": { "description": "UsageProject", @@ -19854,12 +18990,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 195, + "weight": 196, "cookies": false, "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19868,9 +19004,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19940,7 +19073,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 197, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19954,9 +19087,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19990,7 +19120,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 196, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -20004,9 +19134,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20069,7 +19196,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 198, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -20083,9 +19210,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20129,7 +19253,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 199, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -20143,9 +19267,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20208,7 +19329,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 200, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -20222,9 +19343,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20259,7 +19377,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all projects. You can use the query params to filter your results. ", "responses": { "200": { "description": "Projects List", @@ -20275,7 +19393,7 @@ "type": "", "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20284,9 +19402,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20332,7 +19447,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new project. You can create a maximum of 100 projects per account. ", "responses": { "201": { "description": "Project", @@ -20348,7 +19463,7 @@ "type": "", "deprecated": false, "demo": "projects\/create.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20357,9 +19472,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20484,7 +19596,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", "responses": { "200": { "description": "Project", @@ -20500,7 +19612,7 @@ "type": "", "deprecated": false, "demo": "projects\/get.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20509,9 +19621,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20544,7 +19653,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a project by its unique ID.", "responses": { "200": { "description": "Project", @@ -20560,7 +19669,7 @@ "type": "", "deprecated": false, "demo": "projects\/update.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20569,9 +19678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20674,7 +19780,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a project by its unique ID.", "responses": { "204": { "description": "No content" @@ -20682,12 +19788,12 @@ }, "x-appwrite": { "method": "delete", - "weight": 169, + "weight": 170, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20696,9 +19802,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20733,7 +19836,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", "responses": { "200": { "description": "Project", @@ -20749,7 +19852,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-api-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20758,9 +19861,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20827,7 +19927,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", "responses": { "200": { "description": "Project", @@ -20843,7 +19943,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-api-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20852,9 +19952,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20907,7 +20004,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update how long sessions created within a project should stay active for.", "responses": { "200": { "description": "Project", @@ -20918,12 +20015,12 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 162, + "weight": 163, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-duration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20932,9 +20029,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20987,7 +20081,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", "responses": { "200": { "description": "Project", @@ -20998,12 +20092,12 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 161, + "weight": 162, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21012,9 +20106,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21067,7 +20158,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", "responses": { "200": { "description": "Project", @@ -21078,12 +20169,12 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 167, + "weight": 168, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21092,9 +20183,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21134,6 +20222,97 @@ ] } }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "default": null, + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "default": null, + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "default": null, + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + ] + } + }, "\/projects\/{projectId}\/auth\/mock-numbers": { "patch": { "summary": "Update the mock numbers for the project", @@ -21147,7 +20326,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", "responses": { "200": { "description": "Project", @@ -21158,12 +20337,12 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 168, + "weight": 169, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-mock-numbers.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21172,9 +20351,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21230,7 +20406,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", "responses": { "200": { "description": "Project", @@ -21241,12 +20417,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 165, + "weight": 166, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21255,9 +20431,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21310,7 +20483,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", "responses": { "200": { "description": "Project", @@ -21321,12 +20494,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 164, + "weight": 165, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-history.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21335,9 +20508,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21390,7 +20560,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", "responses": { "200": { "description": "Project", @@ -21401,12 +20571,12 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 166, + "weight": 167, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-personal-data-check.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21415,9 +20585,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21470,7 +20637,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", "responses": { "200": { "description": "Project", @@ -21486,7 +20653,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-session-alerts.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21495,9 +20662,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21550,7 +20714,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", "responses": { "200": { "description": "Project", @@ -21561,12 +20725,12 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 163, + "weight": 164, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21575,9 +20739,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21649,7 +20810,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", "responses": { "201": { "description": "JWT", @@ -21660,12 +20821,12 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 181, + "weight": 182, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-j-w-t.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21674,9 +20835,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21738,7 +20896,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all API keys from the current project. ", "responses": { "200": { "description": "API Keys List", @@ -21749,12 +20907,12 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 177, + "weight": 178, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-keys.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21763,9 +20921,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21798,7 +20953,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", "responses": { "201": { "description": "Key", @@ -21809,12 +20964,12 @@ }, "x-appwrite": { "method": "createKey", - "weight": 176, + "weight": 177, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21823,9 +20978,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21894,7 +21046,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", "responses": { "200": { "description": "Key", @@ -21905,12 +21057,12 @@ }, "x-appwrite": { "method": "getKey", - "weight": 178, + "weight": 179, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21919,9 +21071,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21962,7 +21111,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", "responses": { "200": { "description": "Key", @@ -21973,12 +21122,12 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 179, + "weight": 180, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21987,9 +21136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22062,7 +21208,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", "responses": { "204": { "description": "No content" @@ -22070,12 +21216,12 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 180, + "weight": 181, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22084,9 +21230,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22129,7 +21272,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", "responses": { "200": { "description": "Project", @@ -22145,7 +21288,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-o-auth2.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22154,9 +21297,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22270,7 +21410,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", "responses": { "200": { "description": "Platforms List", @@ -22281,12 +21421,12 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 183, + "weight": 184, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-platforms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22295,9 +21435,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22330,7 +21467,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", "responses": { "201": { "description": "Platform", @@ -22341,12 +21478,12 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 182, + "weight": 183, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22355,9 +21492,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22454,7 +21588,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", "responses": { "200": { "description": "Platform", @@ -22465,12 +21599,12 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 184, + "weight": 185, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22479,9 +21613,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22522,7 +21653,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", "responses": { "200": { "description": "Platform", @@ -22533,12 +21664,12 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 185, + "weight": 186, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22547,9 +21678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22624,7 +21752,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", "responses": { "204": { "description": "No content" @@ -22632,12 +21760,12 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 186, + "weight": 187, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22646,9 +21774,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22691,7 +21816,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", "responses": { "200": { "description": "Project", @@ -22707,7 +21832,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-service-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22716,9 +21841,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22793,7 +21915,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", "responses": { "200": { "description": "Project", @@ -22809,7 +21931,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-service-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22818,9 +21940,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22873,7 +21992,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", "responses": { "200": { "description": "Project", @@ -22884,12 +22003,12 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 187, + "weight": 188, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-smtp.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22898,9 +22017,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23001,11 +22117,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], - "description": "", + "description": "Send a test email to verify SMTP configuration. ", "responses": { "204": { "description": "No content" @@ -23013,12 +22131,12 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 188, + "weight": 189, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-smtp-test.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23027,9 +22145,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23142,7 +22257,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the team ID of a project allowing for it to be transferred to another team.", "responses": { "200": { "description": "Project", @@ -23158,7 +22273,7 @@ "type": "", "deprecated": false, "demo": "projects\/update-team.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23167,9 +22282,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23222,7 +22334,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", "responses": { "200": { "description": "EmailTemplate", @@ -23233,12 +22345,12 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 190, + "weight": 191, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23247,9 +22359,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23444,23 +22553,23 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "schema": { - "$ref": "#\/definitions\/project" + "$ref": "#\/definitions\/emailTemplate" } } }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 192, + "weight": 193, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23469,9 +22578,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23709,7 +22815,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", "responses": { "200": { "description": "EmailTemplate", @@ -23720,12 +22826,12 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 194, + "weight": 195, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23734,9 +22840,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23933,7 +23036,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", "responses": { "200": { "description": "SmsTemplate", @@ -23944,12 +23047,12 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 189, + "weight": 190, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23958,9 +23061,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24152,7 +23252,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", "responses": { "200": { "description": "SmsTemplate", @@ -24163,12 +23263,12 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 191, + "weight": 192, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24177,9 +23277,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24389,7 +23486,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", "responses": { "200": { "description": "SmsTemplate", @@ -24400,12 +23497,12 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 193, + "weight": 194, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24414,9 +23511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24610,7 +23704,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", "responses": { "200": { "description": "Webhooks List", @@ -24621,12 +23715,12 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 171, + "weight": 172, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-webhooks.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24635,9 +23729,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24670,7 +23761,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", "responses": { "201": { "description": "Webhook", @@ -24681,12 +23772,12 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 170, + "weight": 171, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24695,9 +23786,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24792,7 +23880,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", "responses": { "200": { "description": "Webhook", @@ -24803,12 +23891,12 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 172, + "weight": 173, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24817,9 +23905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24860,7 +23945,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", "responses": { "200": { "description": "Webhook", @@ -24871,12 +23956,12 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 173, + "weight": 174, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24885,9 +23970,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24986,7 +24068,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", "responses": { "204": { "description": "No content" @@ -24994,12 +24076,12 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 175, + "weight": 176, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25008,9 +24090,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25053,7 +24132,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", "responses": { "200": { "description": "Webhook", @@ -25064,12 +24143,12 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 174, + "weight": 175, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook-signature.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25078,9 +24157,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25134,7 +24210,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -25148,9 +24224,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25207,7 +24280,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -25221,9 +24294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25298,7 +24368,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -25312,9 +24382,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25353,7 +24420,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -25367,9 +24434,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25404,7 +24468,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "responses": { "200": { "description": "Rule", @@ -25415,12 +24479,12 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25429,9 +24493,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25477,7 +24538,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25491,9 +24552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25551,7 +24609,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25565,9 +24623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25692,7 +24747,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25706,9 +24761,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25753,7 +24805,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25767,9 +24819,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25888,7 +24937,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25902,9 +24951,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25951,7 +24997,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25967,9 +25013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26036,7 +25079,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -26052,9 +25095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26130,7 +25170,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -26146,9 +25186,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26202,7 +25239,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -26218,9 +25255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26293,7 +25327,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -26309,9 +25343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26367,7 +25398,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -26383,9 +25414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26441,7 +25469,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -26457,9 +25485,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26608,6 +25633,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -26642,7 +25668,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26658,9 +25684,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26705,7 +25728,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "StorageUsage", @@ -26716,12 +25739,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 215, + "weight": 216, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26730,9 +25753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26779,7 +25799,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageBuckets", @@ -26790,12 +25810,12 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 216, + "weight": 217, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26804,9 +25824,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26872,7 +25889,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26888,9 +25905,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26949,7 +25963,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26965,9 +25979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27043,7 +26054,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -27059,9 +26070,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27107,7 +26115,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27123,9 +26131,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27184,7 +26189,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27200,9 +26205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27250,7 +26252,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 230, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27264,9 +26266,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27313,7 +26312,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -27324,7 +26323,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -27340,9 +26339,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27409,7 +26405,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27425,9 +26421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27515,7 +26508,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -27526,7 +26519,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27542,9 +26535,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27598,7 +26588,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27614,9 +26604,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27686,7 +26673,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27702,9 +26689,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27760,7 +26744,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27775,9 +26759,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27857,7 +26838,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27872,9 +26853,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27919,7 +26897,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27934,9 +26912,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28001,7 +26976,7 @@ }, "x-appwrite": { "method": "list", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -28015,9 +26990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28075,7 +27047,7 @@ }, "x-appwrite": { "method": "create", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -28089,9 +27061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28172,7 +27141,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -28186,9 +27155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28265,7 +27231,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -28279,9 +27245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28358,7 +27321,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28372,9 +27335,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28429,7 +27389,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28443,9 +27403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28492,7 +27449,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28506,9 +27463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28585,7 +27539,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28599,9 +27553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28678,7 +27629,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28692,9 +27643,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28806,7 +27754,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28820,9 +27768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28920,7 +27865,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28934,9 +27879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29023,7 +27965,7 @@ "tags": [ "users" ], - "description": "", + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageUsers", @@ -29034,12 +27976,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 273, + "weight": 274, "cookies": false, "type": "", "deprecated": false, "demo": "users\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -29048,9 +27990,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29108,7 +28047,7 @@ }, "x-appwrite": { "method": "get", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -29122,9 +28061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29164,7 +28100,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29178,9 +28114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29227,7 +28160,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29241,9 +28174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29308,7 +28238,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -29322,9 +28252,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29392,7 +28319,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29406,9 +28333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29476,7 +28400,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29490,9 +28414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29551,7 +28472,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29565,9 +28486,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29614,7 +28532,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29628,9 +28546,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29678,24 +28593,19 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29709,9 +28619,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29771,7 +28678,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29785,9 +28692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29834,7 +28738,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29848,9 +28752,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29895,7 +28796,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29909,9 +28810,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29956,7 +28854,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29970,9 +28868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30019,7 +28914,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30033,9 +28928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30100,7 +28992,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30114,9 +29006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30181,7 +29070,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -30195,9 +29084,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30262,7 +29148,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -30276,9 +29162,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30323,7 +29206,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30337,9 +29220,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30404,7 +29284,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30418,9 +29298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30465,7 +29342,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -30479,9 +29356,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30521,7 +29395,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30535,9 +29409,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30579,7 +29450,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30593,9 +29464,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30650,7 +29518,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30664,9 +29532,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30731,7 +29596,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30746,9 +29611,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30805,7 +29667,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30820,9 +29682,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30920,7 +29779,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30935,9 +29794,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30990,7 +29846,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -31005,9 +29861,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31070,9 +29923,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -31084,7 +29935,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -31099,9 +29950,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31156,7 +30004,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -31170,9 +30018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31240,7 +30085,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -31254,9 +30099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31321,7 +30163,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -31335,9 +30177,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31391,7 +30230,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", "responses": { "200": { "description": "Provider Repositories List", @@ -31402,12 +30241,12 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 278, + "weight": 279, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repositories.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31416,9 +30255,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31460,7 +30296,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", "responses": { "200": { "description": "ProviderRepository", @@ -31471,12 +30307,12 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 279, + "weight": 280, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31485,9 +30321,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31547,7 +30380,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", "responses": { "200": { "description": "ProviderRepository", @@ -31558,12 +30391,12 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 280, + "weight": 281, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31572,9 +30405,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31617,7 +30447,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", "responses": { "200": { "description": "Branches List", @@ -31628,12 +30458,12 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 281, + "weight": 282, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repository-branches.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31642,9 +30472,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31687,7 +30514,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", "responses": { "200": { "description": "VCS Content List", @@ -31698,12 +30525,12 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 276, + "weight": 277, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository-contents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31712,9 +30539,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31766,7 +30590,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "Detection", @@ -31777,12 +30601,12 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 277, + "weight": 278, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository-detection.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31791,9 +30615,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31845,11 +30666,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], - "description": "", + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", "responses": { "204": { "description": "No content" @@ -31857,12 +30680,12 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 286, + "weight": 287, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/update-external-deployments.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31871,9 +30694,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31934,7 +30754,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", "responses": { "200": { "description": "Installations List", @@ -31945,7 +30765,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 283, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -31959,9 +30779,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32009,7 +30826,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", "responses": { "200": { "description": "Installation", @@ -32020,7 +30837,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 284, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -32034,9 +30851,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32067,7 +30881,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", "responses": { "204": { "description": "No content" @@ -32075,7 +30889,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 285, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -32089,9 +30903,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -33154,31 +31965,6 @@ "migrations" ] }, - "firebaseProjectList": { - "description": "Migrations Firebase Projects List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of projects documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "projects": { - "type": "array", - "description": "List of projects.", - "items": { - "type": "object", - "$ref": "#\/definitions\/firebaseProject" - }, - "x-example": "" - } - }, - "required": [ - "total", - "projects" - ] - }, "specificationList": { "description": "Specifications List", "type": "object", @@ -35373,12 +34159,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -35408,7 +34194,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -35522,7 +34308,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -35574,7 +34360,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -36495,6 +35281,21 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -36704,6 +35505,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -37380,7 +36184,8 @@ "resourceId": { "type": "string", "description": "Resource ID.", - "x-example": "5e5ea5c16897e" + "x-example": "5e5ea5c16897e", + "x-nullable": true }, "name": { "type": "string", @@ -37392,10 +36197,16 @@ "description": "The value of this metric at the timestamp.", "x-example": 1, "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "x-nullable": true } }, "required": [ - "resourceId", "name", "value" ] @@ -37433,6 +36244,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "databases": { "type": "array", "description": "Aggregated number of databases per period.", @@ -37468,6 +36291,24 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -37476,10 +36317,14 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", "databases", "collections", "documents", - "storage" + "storage", + "databasesReads", + "databasesWrites" ] }, "usageDatabase": { @@ -37509,6 +36354,18 @@ "x-example": 0, "format": "int32" }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "collections": { "type": "array", "description": "Aggregated number of collections per period.", @@ -37535,6 +36392,24 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -37542,9 +36417,13 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", "collections", "documents", - "storage" + "storage", + "databaseReads", + "databaseWrites" ] }, "usageCollection": { @@ -38166,6 +37045,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "requests": { "type": "array", "description": "Aggregated number of requests per period.", @@ -38255,6 +37146,45 @@ "$ref": "#\/definitions\/metricBreakdown" }, "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -38270,6 +37200,8 @@ "bucketsTotal", "executionsMbSecondsTotal", "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", "requests", "network", "users", @@ -38279,7 +37211,12 @@ "databasesStorageBreakdown", "executionsMbSecondsBreakdown", "buildsMbSecondsBreakdown", - "functionsStorageBreakdown" + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites" ] }, "headers": { @@ -38326,7 +37263,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38967,7 +37904,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38989,6 +37926,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38998,7 +37940,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -39035,9 +37978,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -39073,6 +38021,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", @@ -39148,26 +38097,6 @@ "size", "version" ] - }, - "firebaseProject": { - "description": "MigrationFirebaseProject", - "type": "object", - "properties": { - "projectId": { - "type": "string", - "description": "Project ID.", - "x-example": "my-project" - }, - "displayName": { - "type": "string", - "description": "Project display name.", - "x-example": "My Project" - } - }, - "required": [ - "projectId", - "displayName" - ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-1.6.x-server.json b/app/config/specs/swagger2-1.6.x-server.json index 37018916fa..e38495629c 100644 --- a/app/config/specs/swagger2-1.6.x-server.json +++ b/app/config/specs/swagger2-1.6.x-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -117,9 +117,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -171,9 +168,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -264,9 +258,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -347,9 +338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -412,9 +400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -478,9 +463,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -531,9 +513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -601,9 +580,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -677,9 +653,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -746,9 +719,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -828,9 +798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -899,9 +866,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -946,14 +910,19 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { @@ -973,9 +942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1056,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1112,9 +1075,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1166,9 +1126,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1220,9 +1177,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1276,9 +1230,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1352,9 +1303,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1434,9 +1382,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1517,9 +1462,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1571,9 +1513,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1650,9 +1589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1731,9 +1667,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1821,9 +1754,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1870,9 +1800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1926,9 +1853,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1979,9 +1903,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2059,9 +1980,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2139,9 +2057,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2219,9 +2134,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2299,9 +2211,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2363,9 +2272,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2422,9 +2328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2488,9 +2391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2544,9 +2444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2604,7 +2501,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2633,9 +2530,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2722,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2863,9 +2754,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2943,9 +2831,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3017,9 +2902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3103,9 +2985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3157,9 +3036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3241,9 +3117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3372,9 +3245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3507,9 +3377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3576,9 +3443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4069,9 +3933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4158,9 +4019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4255,9 +4113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4350,9 +4205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4425,9 +4277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4512,9 +4361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4574,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4655,9 +4498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4719,9 +4559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4802,9 +4639,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4912,9 +4746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4982,9 +4813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5086,9 +4914,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5158,9 +4983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5242,9 +5064,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5320,7 +5139,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5349,9 +5170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5460,9 +5278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5538,7 +5353,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5567,9 +5384,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5678,9 +5492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5756,7 +5567,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5785,9 +5598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5896,9 +5706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5984,7 +5791,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6013,9 +5822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6134,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6224,7 +6027,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6253,9 +6058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6378,9 +6180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6468,7 +6267,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6497,9 +6298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6622,9 +6420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6700,7 +6495,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6729,9 +6526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6840,9 +6634,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6976,9 +6767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7067,7 +6855,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7096,9 +6886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7157,7 +6944,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7213,9 +7000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7291,7 +7075,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7320,9 +7106,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7462,9 +7245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7534,9 +7314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7582,7 +7359,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -7611,9 +7390,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7720,9 +7496,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7806,9 +7579,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7916,9 +7686,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8010,9 +7777,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8111,9 +7875,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8193,9 +7954,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8275,9 +8033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8398,9 +8153,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8470,9 +8222,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8535,7 +8284,7 @@ }, "x-appwrite": { "method": "list", - "weight": 288, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8549,9 +8298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8610,7 +8356,7 @@ }, "x-appwrite": { "method": "create", - "weight": 287, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8624,9 +8370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8719,7 +8462,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -8844,7 +8589,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -8882,7 +8627,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 289, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8896,9 +8641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8936,7 +8678,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 290, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8951,9 +8693,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8991,7 +8730,7 @@ }, "x-appwrite": { "method": "get", - "weight": 291, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -9005,9 +8744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9053,7 +8789,7 @@ }, "x-appwrite": { "method": "update", - "weight": 294, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9067,9 +8803,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9164,7 +8897,9 @@ "cpp-20", "bun-1.0", "bun-1.1", - "go-1.23" + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9266,7 +9001,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9295,7 +9030,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 297, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9309,9 +9044,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9359,7 +9091,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 299, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9373,9 +9105,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9442,7 +9171,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 298, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9456,9 +9185,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9537,7 +9263,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 300, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9551,9 +9277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9607,7 +9330,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 296, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9621,9 +9344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9672,7 +9392,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 301, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9686,9 +9406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9727,11 +9444,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -9739,12 +9458,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 302, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9753,9 +9472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9813,7 +9529,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -9824,12 +9540,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 303, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9838,9 +9554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9896,7 +9609,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 295, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9911,9 +9624,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9970,7 +9680,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 305, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9986,9 +9696,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10057,7 +9764,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 304, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10073,9 +9780,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10180,7 +9884,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 306, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10196,9 +9900,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10249,7 +9950,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10263,9 +9964,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10321,7 +10019,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10335,9 +10033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10383,7 +10078,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10397,9 +10092,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10472,7 +10164,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10486,9 +10178,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10542,7 +10231,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10556,9 +10245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10631,7 +10317,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10645,9 +10331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10703,7 +10386,7 @@ }, "x-appwrite": { "method": "query", - "weight": 330, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10719,9 +10402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10781,7 +10461,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 329, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10797,9 +10477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10873,9 +10550,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10927,9 +10601,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10981,9 +10652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11035,9 +10703,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11098,9 +10763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11152,9 +10814,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11206,9 +10865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11260,9 +10916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11325,9 +10978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11390,9 +11040,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11464,9 +11111,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11529,9 +11173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11618,9 +11259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11683,9 +11321,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11748,9 +11383,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11813,9 +11445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11878,9 +11507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11943,9 +11569,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12008,9 +11631,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12073,9 +11693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12138,9 +11755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12192,9 +11806,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12246,9 +11857,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12302,9 +11910,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12360,9 +11965,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12418,9 +12020,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12476,9 +12075,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12534,9 +12130,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12592,9 +12185,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12650,9 +12240,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12708,9 +12295,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12750,7 +12334,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 389, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12765,9 +12349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12828,7 +12409,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 386, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -12843,9 +12424,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12978,7 +12556,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -12989,7 +12567,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 393, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13004,9 +12582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13147,7 +12722,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 388, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13162,9 +12737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13192,13 +12764,13 @@ "title": { "type": "string", "description": "Title for push notification.", - "default": null, + "default": "", "x-example": "<TITLE>" }, "body": { "type": "string", "description": "Body for push notification.", - "default": null, + "default": "", "x-example": "<BODY>" }, "topics": { @@ -13230,7 +12802,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "default": {}, "x-example": "{}" }, @@ -13254,7 +12826,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "default": "", "x-example": "<SOUND>" }, @@ -13271,10 +12843,10 @@ "x-example": "<TAG>" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "default": "", - "x-example": "<BADGE>" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null }, "draft": { "type": "boolean", @@ -13287,12 +12859,34 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -13312,7 +12906,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13323,7 +12917,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 395, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13338,9 +12932,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13465,6 +13056,30 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -13496,7 +13111,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 387, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13511,9 +13126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13606,7 +13218,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13617,12 +13229,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 394, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13632,9 +13244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13736,7 +13345,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 392, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13751,9 +13360,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13782,9 +13388,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -13796,7 +13400,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 396, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13811,9 +13415,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13861,7 +13462,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 390, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13876,9 +13477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13938,7 +13536,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 391, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13953,9 +13551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14015,7 +13610,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 361, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14030,9 +13625,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14093,7 +13685,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 360, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14108,9 +13700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14211,7 +13800,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 373, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14226,9 +13815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14327,7 +13913,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 359, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14342,9 +13928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14421,7 +14004,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 372, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14436,9 +14019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14513,7 +14093,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 351, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14528,9 +14108,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14643,7 +14220,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 364, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14658,9 +14235,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14771,7 +14345,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 354, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14786,9 +14360,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14877,7 +14448,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 367, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14892,9 +14463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14981,7 +14549,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 352, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14996,9 +14564,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15099,7 +14664,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 365, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15114,9 +14679,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15215,7 +14777,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 353, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15230,9 +14792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15377,7 +14936,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 366, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15392,9 +14951,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15536,7 +15092,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 355, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15551,9 +15107,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15642,7 +15195,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 368, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15657,9 +15210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15746,7 +15296,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 356, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15761,9 +15311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15852,7 +15399,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 369, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15867,9 +15414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15956,7 +15500,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 357, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15971,9 +15515,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16062,7 +15603,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 370, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16077,9 +15618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16166,7 +15704,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 358, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16181,9 +15719,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16272,7 +15807,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 371, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16287,9 +15822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16376,7 +15908,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 363, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16391,9 +15923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16422,9 +15951,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16436,7 +15963,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 374, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16451,9 +15978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16501,7 +16025,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 362, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16516,9 +16040,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16578,7 +16099,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 383, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16593,9 +16114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16655,7 +16173,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 376, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16670,9 +16188,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16731,7 +16246,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 375, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16746,9 +16261,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16824,7 +16336,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 378, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16839,9 +16351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16887,7 +16396,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 379, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16902,9 +16411,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16957,9 +16463,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16971,7 +16475,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 380, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16986,9 +16490,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17036,7 +16537,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 377, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17051,9 +16552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17113,7 +16611,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 382, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17128,9 +16626,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17197,7 +16692,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 381, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17214,9 +16709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17291,7 +16783,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 384, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17306,9 +16798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17345,9 +16834,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17359,7 +16846,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 385, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17376,9 +16863,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17436,7 +16920,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 202, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17450,9 +16934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17511,7 +16992,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 201, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17525,9 +17006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17653,7 +17131,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 203, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17667,9 +17145,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17715,7 +17190,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 204, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17729,9 +17204,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17851,7 +17323,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 205, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17865,9 +17337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17915,7 +17384,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 207, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17931,9 +17400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18002,7 +17468,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 206, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -18018,9 +17484,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18098,7 +17561,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 208, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -18114,9 +17577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18172,7 +17632,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 213, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -18188,9 +17648,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18265,7 +17722,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 214, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -18281,9 +17738,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18341,7 +17795,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 210, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18357,9 +17811,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18417,7 +17868,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 209, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -18433,9 +17884,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18586,6 +18034,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -18620,7 +18069,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 211, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18636,9 +18085,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18696,7 +18142,7 @@ }, "x-appwrite": { "method": "list", - "weight": 218, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18712,9 +18158,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18775,7 +18218,7 @@ }, "x-appwrite": { "method": "create", - "weight": 217, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18791,9 +18234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18871,7 +18311,7 @@ }, "x-appwrite": { "method": "get", - "weight": 219, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18887,9 +18327,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18937,7 +18374,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 221, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18953,9 +18390,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19016,7 +18450,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 223, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19032,9 +18466,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19073,7 +18504,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -19084,7 +18515,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 225, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -19100,9 +18531,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19171,7 +18599,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 224, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19187,9 +18615,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19279,7 +18704,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -19290,7 +18715,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 226, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -19306,9 +18731,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19364,7 +18786,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 227, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19380,9 +18802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19454,7 +18873,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 229, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19470,9 +18889,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19530,7 +18946,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 228, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19545,9 +18961,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19629,7 +19042,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 220, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19644,9 +19057,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19693,7 +19103,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 222, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19708,9 +19118,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19777,7 +19184,7 @@ }, "x-appwrite": { "method": "list", - "weight": 240, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19791,9 +19198,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19852,7 +19256,7 @@ }, "x-appwrite": { "method": "create", - "weight": 231, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19866,9 +19270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19950,7 +19351,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 234, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19964,9 +19365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20044,7 +19442,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 232, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -20058,9 +19456,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20138,7 +19533,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 248, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20152,9 +19547,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20210,7 +19602,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 271, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20224,9 +19616,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20274,7 +19663,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 233, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -20288,9 +19677,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20368,7 +19754,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 236, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20382,9 +19768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20462,7 +19845,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 237, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20476,9 +19859,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20591,7 +19971,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 238, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20605,9 +19985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20706,7 +20083,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 235, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20720,9 +20097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20821,7 +20195,7 @@ }, "x-appwrite": { "method": "get", - "weight": 241, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20835,9 +20209,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20878,7 +20249,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 269, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20892,9 +20263,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20942,7 +20310,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 254, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20956,9 +20324,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21024,7 +20389,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 272, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -21038,9 +20403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21109,7 +20471,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 250, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21123,9 +20485,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21194,7 +20553,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 246, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21208,9 +20567,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21270,7 +20626,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 245, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21284,9 +20640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21334,7 +20687,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 259, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21348,9 +20701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21399,24 +20749,19 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 264, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21430,9 +20775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21493,7 +20835,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 260, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21507,9 +20849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21557,7 +20896,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 261, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21571,9 +20910,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21619,7 +20955,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 263, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21633,9 +20969,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21681,7 +21014,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 262, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21695,9 +21028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21745,7 +21075,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 252, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21759,9 +21089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21827,7 +21154,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 253, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21841,9 +21168,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21909,7 +21233,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 255, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21923,9 +21247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21991,7 +21312,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 242, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -22005,9 +21326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22053,7 +21371,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 257, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22067,9 +21385,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22135,7 +21450,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 244, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22149,9 +21464,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22197,7 +21509,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 265, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -22211,9 +21523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22254,7 +21563,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 268, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22268,9 +21577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22313,7 +21619,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 267, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22327,9 +21633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22385,7 +21688,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 249, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -22399,9 +21702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22467,7 +21767,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 247, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -22482,9 +21782,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22542,7 +21839,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 239, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22557,9 +21854,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22658,7 +21952,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 243, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22673,9 +21967,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22729,7 +22020,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 258, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22744,9 +22035,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22810,9 +22098,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22824,7 +22110,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 270, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22839,9 +22125,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22897,7 +22180,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 266, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22911,9 +22194,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22982,7 +22262,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 256, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -22996,9 +22276,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23064,7 +22341,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 251, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23078,9 +22355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -26082,12 +25356,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -26117,7 +25391,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -26231,7 +25505,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -26283,7 +25557,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27097,7 +26371,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27548,7 +26822,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27570,6 +26844,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27579,7 +26858,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index fce6a871a3..c0980c44ce 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -87,7 +87,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -102,9 +102,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -140,7 +137,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -155,9 +152,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -222,7 +216,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -233,7 +227,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -248,9 +242,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -315,7 +306,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -330,9 +321,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -379,7 +367,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -394,9 +382,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -444,7 +429,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -459,9 +444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -497,7 +479,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -512,9 +494,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -566,7 +545,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -581,9 +560,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -641,7 +617,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -656,9 +632,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -709,7 +682,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -724,9 +697,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -790,7 +760,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -805,9 +775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -860,7 +827,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -875,9 +842,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -922,19 +886,24 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -949,9 +918,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1016,7 +982,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1031,9 +997,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1071,7 +1034,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1086,9 +1049,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1124,7 +1084,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1139,9 +1099,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1177,7 +1134,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1192,9 +1149,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1232,7 +1186,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1247,9 +1201,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1307,7 +1258,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1322,9 +1273,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1388,7 +1336,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1403,9 +1351,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1470,7 +1415,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1485,9 +1430,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1523,7 +1465,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1538,9 +1480,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1598,7 +1537,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1616,9 +1555,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1670,7 +1606,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1681,7 +1617,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1696,9 +1632,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1770,7 +1703,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1785,9 +1718,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1818,7 +1748,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1833,9 +1763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1873,7 +1800,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1888,9 +1815,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1915,7 +1839,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1926,7 +1850,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1941,9 +1865,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2006,7 +1927,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2021,9 +1942,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2075,7 +1993,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "No content" @@ -2083,7 +2001,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2098,9 +2016,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2221,7 +2136,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2236,9 +2151,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2301,7 +2213,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2316,9 +2228,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2381,7 +2290,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2396,9 +2305,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2444,7 +2350,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2459,9 +2365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2502,7 +2405,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2517,9 +2420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2567,7 +2467,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2582,9 +2482,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2611,7 +2508,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2622,12 +2519,12 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2636,9 +2533,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2697,7 +2591,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2708,12 +2602,12 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2722,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2770,13 +2661,11 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { "description": "No content" @@ -2784,12 +2673,12 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2798,9 +2687,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2836,7 +2722,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2847,7 +2733,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2862,9 +2748,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2922,7 +2805,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2933,7 +2816,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2951,9 +2834,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3017,7 +2897,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -3025,7 +2905,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3040,9 +2920,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3152,7 +3029,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3163,7 +3040,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3181,9 +3058,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3235,7 +3109,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3246,7 +3120,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3261,9 +3135,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3319,7 +3190,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3334,9 +3205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3401,7 +3269,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3419,9 +3287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3457,7 +3322,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3472,9 +3337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3528,7 +3390,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3539,7 +3401,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3555,9 +3417,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3657,7 +3516,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3668,7 +3527,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3684,9 +3543,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3790,7 +3646,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3801,7 +3657,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3817,9 +3673,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3857,7 +3710,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3868,7 +3721,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3884,9 +3737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4348,7 +4198,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4359,7 +4209,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4375,9 +4225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4435,7 +4282,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4446,7 +4293,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4462,9 +4309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4530,7 +4374,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4541,7 +4385,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4557,9 +4401,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4636,7 +4477,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -4652,9 +4493,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4720,7 +4558,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -4736,9 +4574,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4828,7 +4663,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -4844,9 +4679,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4920,7 +4752,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -4936,9 +4768,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5019,7 +4848,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -5035,9 +4864,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5101,7 +4927,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -5117,9 +4943,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5167,7 +4990,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -5186,7 +5009,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -5202,9 +5025,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5226,65 +5046,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "<PATH>", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -5313,7 +5127,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -5329,9 +5143,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5387,7 +5198,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -5403,9 +5214,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5463,7 +5271,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -5479,9 +5287,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5528,7 +5333,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -5539,7 +5344,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -5555,9 +5360,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5595,7 +5397,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -5611,9 +5413,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5651,7 +5450,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -5667,9 +5466,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5707,7 +5503,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5723,9 +5519,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5763,7 +5556,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -5779,9 +5572,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5819,7 +5609,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -5835,9 +5625,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -5875,7 +5662,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -5891,9 +5678,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5931,7 +5715,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5947,9 +5731,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -5987,7 +5768,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -6004,9 +5785,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6062,9 +5840,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -6076,7 +5852,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -6093,9 +5869,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6151,7 +5924,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -6167,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6225,7 +5995,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -6236,7 +6006,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -6252,9 +6022,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6330,7 +6097,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -6346,9 +6113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6402,7 +6166,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6418,9 +6182,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6493,7 +6254,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6509,9 +6270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6567,7 +6325,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -6583,9 +6341,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6641,7 +6396,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -6657,9 +6412,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6808,6 +6560,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -6842,7 +6595,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -6858,9 +6611,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6916,7 +6666,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -6932,9 +6682,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6993,7 +6740,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -7009,9 +6756,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7087,7 +6831,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -7103,9 +6847,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7151,7 +6892,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -7167,9 +6908,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7228,7 +6966,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -7244,9 +6982,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7283,7 +7018,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -7294,7 +7029,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7310,9 +7045,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7368,7 +7100,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -7379,7 +7111,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -7395,9 +7127,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7485,7 +7214,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -7496,7 +7225,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7512,9 +7241,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7557,7 +7283,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -7568,7 +7294,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7584,9 +7310,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7656,7 +7379,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7672,9 +7395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7719,7 +7439,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -7730,7 +7450,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -7745,9 +7465,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7828,7 +7545,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -7843,9 +7560,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7891,7 +7605,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -7906,9 +7620,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9451,12 +9162,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -9486,7 +9197,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -9590,7 +9301,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -10014,7 +9725,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -10036,6 +9747,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -10045,7 +9761,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 9200c80593..94b0d55199 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -99,7 +99,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -114,9 +114,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -151,7 +148,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -166,9 +163,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -237,7 +231,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 9, + "weight": 10, "cookies": false, "type": "", "deprecated": false, @@ -251,9 +245,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -278,7 +269,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -289,7 +280,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -304,9 +295,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -370,7 +358,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -385,9 +373,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -433,7 +418,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -448,9 +433,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -497,7 +479,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -512,9 +494,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -550,7 +529,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -565,9 +544,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -618,7 +594,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -633,9 +609,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -692,7 +665,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -707,9 +680,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -759,7 +729,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -774,9 +744,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -839,7 +806,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -854,9 +821,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -908,7 +872,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -923,9 +887,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -970,19 +931,24 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -997,9 +963,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1063,7 +1026,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1078,9 +1041,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1117,7 +1077,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1132,9 +1092,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1169,7 +1126,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1184,9 +1141,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1221,7 +1175,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1236,9 +1190,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1275,7 +1226,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1290,9 +1241,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1349,7 +1297,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1364,9 +1312,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1429,7 +1374,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1444,9 +1389,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1510,7 +1452,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1525,9 +1467,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1562,7 +1501,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1577,9 +1516,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1636,7 +1572,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1654,9 +1590,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1707,7 +1640,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1718,7 +1651,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1733,9 +1666,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1806,7 +1736,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1821,9 +1751,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1853,7 +1780,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1868,9 +1795,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1907,7 +1831,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1922,9 +1846,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1949,7 +1870,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1960,7 +1881,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1975,9 +1896,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2040,7 +1958,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2055,9 +1973,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2109,7 +2024,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\r\n\r\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "301": { "description": "No content" @@ -2117,7 +2032,7 @@ }, "x-appwrite": { "method": "createOAuth2Session", - "weight": 18, + "weight": 19, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2132,9 +2047,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2255,7 +2167,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2270,9 +2182,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2335,7 +2244,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2350,9 +2259,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2415,7 +2321,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2430,9 +2336,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2477,7 +2380,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2492,9 +2395,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2534,7 +2434,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2549,9 +2449,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2598,7 +2495,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2613,9 +2510,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2641,7 +2535,7 @@ "tags": [ "account" ], - "description": "", + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", "responses": { "201": { "description": "Target", @@ -2652,12 +2546,12 @@ }, "x-appwrite": { "method": "createPushTarget", - "weight": 53, + "weight": 54, "cookies": false, "type": "", "deprecated": false, "demo": "account\/create-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2666,9 +2560,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2726,7 +2617,7 @@ "tags": [ "account" ], - "description": "", + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", "responses": { "200": { "description": "Target", @@ -2737,12 +2628,12 @@ }, "x-appwrite": { "method": "updatePushTarget", - "weight": 54, + "weight": 55, "cookies": false, "type": "", "deprecated": false, "demo": "account\/update-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2751,9 +2642,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2798,13 +2686,11 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "account" ], - "description": "", + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", "responses": { "204": { "description": "No content" @@ -2812,12 +2698,12 @@ }, "x-appwrite": { "method": "deletePushTarget", - "weight": 55, + "weight": 56, "cookies": false, "type": "", "deprecated": false, "demo": "account\/delete-push-target.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -2826,9 +2712,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2863,7 +2746,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2874,7 +2757,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2889,9 +2772,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2949,7 +2829,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2960,7 +2840,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2978,9 +2858,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3044,7 +2921,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -3052,7 +2929,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -3067,9 +2944,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3179,7 +3053,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -3190,7 +3064,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -3208,9 +3082,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3262,7 +3133,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -3273,7 +3144,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -3288,9 +3159,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3345,7 +3213,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3360,9 +3228,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3426,7 +3291,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3444,9 +3309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3481,7 +3343,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3496,9 +3358,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3551,7 +3410,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3562,7 +3421,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3578,9 +3437,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3680,7 +3536,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3691,7 +3547,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3707,9 +3563,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3813,7 +3666,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3824,7 +3677,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3840,9 +3693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -3880,7 +3730,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3891,7 +3741,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3907,9 +3757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4371,7 +4218,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4382,7 +4229,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4398,9 +4245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4458,7 +4302,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4469,7 +4313,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4485,9 +4329,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4553,7 +4394,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4564,7 +4405,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4580,9 +4421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4648,7 +4486,7 @@ "tags": [ "assistant" ], - "description": "", + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", "responses": { "200": { "description": "File", @@ -4659,7 +4497,7 @@ }, "x-appwrite": { "method": "chat", - "weight": 331, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -4673,9 +4511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4731,7 +4566,7 @@ }, "x-appwrite": { "method": "variables", - "weight": 330, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -4745,9 +4580,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4783,7 +4615,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4797,9 +4629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4846,7 +4675,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4857,7 +4686,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4871,9 +4700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -4932,7 +4758,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabases", @@ -4943,12 +4769,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 113, + "weight": 114, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -4957,9 +4783,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5017,7 +4840,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -5031,9 +4854,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5078,7 +4898,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -5092,9 +4912,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5158,7 +4975,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -5172,9 +4989,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5221,7 +5035,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -5235,9 +5049,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5303,7 +5114,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -5317,9 +5128,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5412,7 +5220,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -5426,9 +5234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5481,7 +5286,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -5495,9 +5300,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5584,7 +5386,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5598,9 +5400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5655,7 +5454,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5669,9 +5468,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5727,7 +5523,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5738,7 +5534,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5752,9 +5548,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5829,7 +5622,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5844,7 +5639,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5858,9 +5653,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -5954,7 +5746,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5968,9 +5760,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6045,7 +5834,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -6060,7 +5851,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -6074,9 +5865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6159,7 +5947,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -6170,7 +5958,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -6184,9 +5972,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6261,11 +6046,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -6276,7 +6063,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -6290,9 +6077,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6375,7 +6159,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -6386,7 +6170,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -6400,9 +6184,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6487,11 +6268,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -6502,7 +6285,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6516,9 +6299,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6611,7 +6391,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6622,7 +6402,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6636,9 +6416,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6725,11 +6502,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6740,7 +6519,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6754,9 +6533,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6853,7 +6629,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6864,7 +6640,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6878,9 +6654,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -6967,11 +6740,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6982,7 +6757,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6996,9 +6771,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7095,7 +6867,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -7106,7 +6878,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -7120,9 +6892,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7197,11 +6966,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -7212,7 +6983,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -7226,9 +6997,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7311,7 +7079,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -7322,7 +7090,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -7336,9 +7104,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7446,7 +7211,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -7457,7 +7222,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -7471,9 +7236,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7561,11 +7323,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -7576,7 +7340,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7590,9 +7354,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7650,7 +7411,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7681,7 +7442,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7692,7 +7453,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7706,9 +7467,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7783,11 +7541,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7798,7 +7558,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7812,9 +7572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -7939,7 +7696,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7953,9 +7710,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8010,7 +7764,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -8024,9 +7778,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8071,11 +7822,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -8086,7 +7839,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -8100,9 +7853,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8192,7 +7942,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -8208,9 +7958,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8276,7 +8023,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -8292,9 +8039,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8384,7 +8128,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -8400,9 +8144,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8476,7 +8217,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8492,9 +8233,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8575,7 +8313,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8591,9 +8329,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8657,7 +8392,7 @@ }, "x-appwrite": { "method": "listDocumentLogs", - "weight": 110, + "weight": 111, "cookies": false, "type": "", "deprecated": false, @@ -8671,9 +8406,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8747,7 +8479,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8761,9 +8493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8817,7 +8546,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8828,7 +8557,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8842,9 +8571,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -8950,7 +8676,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8964,9 +8690,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9021,7 +8744,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -9035,9 +8758,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9099,7 +8819,7 @@ }, "x-appwrite": { "method": "listCollectionLogs", - "weight": 77, + "weight": 78, "cookies": false, "type": "", "deprecated": false, @@ -9113,9 +8833,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9170,7 +8887,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageCollection", @@ -9181,12 +8898,12 @@ }, "x-appwrite": { "method": "getCollectionUsage", - "weight": 115, + "weight": 116, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-collection-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9195,9 +8912,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9271,7 +8985,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 71, + "weight": 72, "cookies": false, "type": "", "deprecated": false, @@ -9285,9 +8999,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9334,7 +9045,7 @@ "tags": [ "databases" ], - "description": "", + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", "responses": { "200": { "description": "UsageDatabase", @@ -9345,12 +9056,12 @@ }, "x-appwrite": { "method": "getDatabaseUsage", - "weight": 114, + "weight": 115, "cookies": false, "type": "", "deprecated": false, "demo": "databases\/get-database-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9359,9 +9070,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9427,7 +9135,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -9441,9 +9149,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9501,7 +9206,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -9515,9 +9220,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9559,6 +9261,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9577,6 +9280,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9584,24 +9289,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9726,7 +9438,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9764,7 +9476,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -9778,9 +9490,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9806,7 +9515,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -9817,7 +9526,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -9832,9 +9541,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9871,7 +9577,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 312, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -9885,9 +9591,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -9969,7 +9672,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 313, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -9983,9 +9686,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10020,7 +9720,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -10031,12 +9731,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-functions-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10045,9 +9745,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10105,7 +9802,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -10119,9 +9816,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10166,7 +9860,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -10180,9 +9874,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10226,6 +9917,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -10244,6 +9936,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -10251,24 +9945,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -10370,7 +10071,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -10399,7 +10100,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -10413,9 +10114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10462,7 +10160,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -10476,9 +10174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10533,7 +10228,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10544,7 +10239,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -10558,9 +10253,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10638,7 +10330,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -10652,9 +10344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10707,7 +10396,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -10721,9 +10410,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10771,7 +10457,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -10785,9 +10471,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10825,11 +10508,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -10837,12 +10522,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10851,9 +10536,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10910,7 +10592,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -10921,12 +10603,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -10935,9 +10617,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -10992,7 +10671,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -11007,9 +10686,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11065,7 +10741,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -11081,9 +10757,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11131,7 +10804,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -11150,7 +10823,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -11166,9 +10839,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11190,65 +10860,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "<PATH>", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -11277,7 +10941,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -11293,9 +10957,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11336,7 +10997,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -11344,7 +11005,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -11358,9 +11019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11404,7 +11062,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11415,12 +11073,12 @@ }, "x-appwrite": { "method": "getFunctionUsage", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/get-function-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11429,9 +11087,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11497,7 +11152,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -11511,9 +11166,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11558,7 +11210,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -11572,9 +11224,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11646,7 +11295,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -11660,9 +11309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11715,7 +11361,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -11729,9 +11375,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11803,7 +11446,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -11817,9 +11460,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11874,7 +11514,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -11890,9 +11530,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -11950,7 +11587,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -11966,9 +11603,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12026,7 +11660,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12040,9 +11674,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12079,7 +11710,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12093,9 +11724,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12132,7 +11760,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12146,9 +11774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12185,7 +11810,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12199,9 +11824,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12247,7 +11869,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12261,9 +11883,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12300,7 +11919,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12314,9 +11933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12353,7 +11969,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12367,9 +11983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12406,7 +12019,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12420,9 +12033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12470,7 +12080,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12484,9 +12094,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12534,7 +12141,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12548,9 +12155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12607,7 +12211,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12621,9 +12225,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12660,7 +12261,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -12671,7 +12272,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -12685,9 +12286,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12759,7 +12357,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12773,9 +12371,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12823,7 +12418,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -12837,9 +12432,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12887,7 +12479,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12901,9 +12493,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -12951,7 +12540,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12965,9 +12554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13015,7 +12601,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -13029,9 +12615,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13079,7 +12662,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -13093,9 +12676,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13143,7 +12723,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -13157,9 +12737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13207,7 +12784,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -13221,9 +12798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13271,7 +12845,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13285,9 +12859,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13324,7 +12895,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13338,9 +12909,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13377,7 +12945,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -13391,9 +12959,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13419,7 +12984,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -13430,7 +12995,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -13446,9 +13011,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13486,7 +13048,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -13502,9 +13064,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13542,7 +13101,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -13558,9 +13117,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13598,7 +13154,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -13614,9 +13170,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13654,7 +13207,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -13670,9 +13223,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13710,7 +13260,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -13726,9 +13276,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [] } @@ -13766,7 +13313,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -13782,9 +13329,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13822,7 +13366,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13838,9 +13382,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [] } @@ -13878,7 +13419,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13893,9 +13434,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -13955,7 +13493,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -13970,9 +13508,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14104,7 +13639,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14115,7 +13650,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14130,9 +13665,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14272,7 +13804,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14287,9 +13819,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14316,13 +13845,13 @@ "title": { "type": "string", "description": "Title for push notification.", - "default": null, + "default": "", "x-example": "<TITLE>" }, "body": { "type": "string", "description": "Body for push notification.", - "default": null, + "default": "", "x-example": "<BODY>" }, "topics": { @@ -14354,7 +13883,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "default": {}, "x-example": "{}" }, @@ -14378,7 +13907,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "default": "", "x-example": "<SOUND>" }, @@ -14395,10 +13924,10 @@ "x-example": "<TAG>" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "default": "", - "x-example": "<BADGE>" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null }, "draft": { "type": "boolean", @@ -14411,12 +13940,34 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -14436,7 +13987,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14447,7 +13998,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14462,9 +14013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14588,6 +14136,30 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -14619,7 +14191,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -14634,9 +14206,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14728,7 +14297,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -14739,12 +14308,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -14754,9 +14323,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14846,7 +14412,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -14857,7 +14423,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14872,9 +14438,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14902,9 +14465,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -14916,7 +14477,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14931,9 +14492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -14980,7 +14538,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -14995,9 +14553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15056,7 +14611,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -15071,9 +14626,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15132,7 +14684,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -15147,9 +14699,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15209,7 +14758,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15224,9 +14773,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15326,7 +14872,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15341,9 +14887,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15441,7 +14984,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15456,9 +14999,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15534,7 +15074,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15549,9 +15089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15625,7 +15162,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -15640,9 +15177,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15754,7 +15288,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15769,9 +15303,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15881,7 +15412,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15896,9 +15427,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -15986,7 +15514,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16001,9 +15529,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16089,7 +15614,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16104,9 +15629,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16206,7 +15728,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -16221,9 +15743,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16321,7 +15840,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16336,9 +15855,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16482,7 +15998,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -16497,9 +16013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16640,7 +16153,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16655,9 +16168,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16745,7 +16255,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -16760,9 +16270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16848,7 +16355,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16863,9 +16370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -16953,7 +16457,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16968,9 +16472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17056,7 +16557,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17071,9 +16572,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17161,7 +16659,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -17176,9 +16674,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17264,7 +16759,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17279,9 +16774,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17369,7 +16861,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -17384,9 +16876,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17461,7 +16950,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -17472,7 +16961,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17487,9 +16976,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17517,9 +17003,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17531,7 +17015,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -17546,9 +17030,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17595,7 +17076,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17610,9 +17091,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17671,7 +17149,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17686,9 +17164,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17747,7 +17222,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17762,9 +17237,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17822,7 +17294,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17837,9 +17309,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17903,7 +17372,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17914,7 +17383,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17929,9 +17398,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -17965,7 +17431,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -17976,7 +17442,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17991,9 +17457,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18045,9 +17508,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18059,7 +17520,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -18074,9 +17535,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18123,7 +17581,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -18138,9 +17596,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18199,7 +17654,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -18214,9 +17669,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18282,7 +17734,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -18299,9 +17751,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18363,7 +17812,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -18374,7 +17823,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -18389,9 +17838,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18427,9 +17873,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -18441,7 +17885,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -18458,9 +17902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18505,7 +17946,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", "responses": { "200": { "description": "Migrations List", @@ -18516,7 +17957,7 @@ }, "x-appwrite": { "method": "list", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -18530,9 +17971,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18545,7 +17983,7 @@ "parameters": [ { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", "required": false, "type": "array", "collectionFormat": "multi", @@ -18580,7 +18018,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", "responses": { "202": { "description": "Migration", @@ -18591,7 +18029,7 @@ }, "x-appwrite": { "method": "createAppwriteMigration", - "weight": 332, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -18605,9 +18043,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18676,7 +18111,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -18687,7 +18122,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18701,9 +18136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18755,7 +18187,7 @@ }, "\/migrations\/firebase": { "post": { - "summary": "Migrate Firebase data (Service Account)", + "summary": "Migrate Firebase data", "operationId": "migrationsCreateFirebaseMigration", "consumes": [ "application\/json" @@ -18766,7 +18198,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", "responses": { "202": { "description": "Migration", @@ -18777,7 +18209,7 @@ }, "x-appwrite": { "method": "createFirebaseMigration", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -18791,9 +18223,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -18835,192 +18264,6 @@ ] } }, - "\/migrations\/firebase\/deauthorize": { - "get": { - "summary": "Revoke Appwrite's authorization to access Firebase projects", - "operationId": "migrationsDeleteFirebaseAuth", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "File", - "schema": { - "type": "file" - } - } - }, - "x-appwrite": { - "method": "deleteFirebaseAuth", - "weight": 345, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/delete-firebase-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, - "\/migrations\/firebase\/oauth": { - "post": { - "summary": "Migrate Firebase data (OAuth)", - "operationId": "migrationsCreateFirebaseOAuthMigration", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "202": { - "description": "Migration", - "schema": { - "$ref": "#\/definitions\/migration" - } - } - }, - "x-appwrite": { - "method": "createFirebaseOAuthMigration", - "weight": 333, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/create-firebase-o-auth-migration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "payload", - "in": "body", - "schema": { - "type": "object", - "properties": { - "resources": { - "type": "array", - "description": "List of resources to migrate", - "default": null, - "x-example": null, - "items": { - "type": "string" - } - }, - "projectId": { - "type": "string", - "description": "Project ID of the Firebase Project", - "default": null, - "x-example": "<PROJECT_ID>" - } - }, - "required": [ - "resources", - "projectId" - ] - } - } - ] - } - }, - "\/migrations\/firebase\/projects": { - "get": { - "summary": "List Firebase projects", - "operationId": "migrationsListFirebaseProjects", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migrations Firebase Projects List", - "schema": { - "$ref": "#\/definitions\/firebaseProjectList" - } - } - }, - "x-appwrite": { - "method": "listFirebaseProjects", - "weight": 344, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/list-firebase-projects.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.read", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ] - } - }, "\/migrations\/firebase\/report": { "get": { "summary": "Generate a report on Firebase data", @@ -19034,7 +18277,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", "responses": { "200": { "description": "Migration Report", @@ -19045,7 +18288,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -19059,9 +18302,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19094,79 +18334,6 @@ ] } }, - "\/migrations\/firebase\/report\/oauth": { - "get": { - "summary": "Generate a report on Firebase data using OAuth", - "operationId": "migrationsGetFirebaseReportOAuth", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "migrations" - ], - "description": "", - "responses": { - "200": { - "description": "Migration Report", - "schema": { - "$ref": "#\/definitions\/migrationReport" - } - } - }, - "x-appwrite": { - "method": "getFirebaseReportOAuth", - "weight": 341, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "migrations\/get-firebase-report-o-auth.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "migrations.write", - "platforms": [ - "console" - ], - "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [] - } - ], - "parameters": [ - { - "name": "resources", - "description": "List of resources to migrate", - "required": true, - "type": "array", - "collectionFormat": "multi", - "items": { - "type": "string" - }, - "in": "query" - }, - { - "name": "projectId", - "description": "Project ID", - "required": true, - "type": "string", - "x-example": "<PROJECT_ID>", - "in": "query" - } - ] - } - }, "\/migrations\/nhost": { "post": { "summary": "Migrate NHost data", @@ -19180,7 +18347,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", "responses": { "202": { "description": "Migration", @@ -19191,7 +18358,7 @@ }, "x-appwrite": { "method": "createNHostMigration", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -19205,9 +18372,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19303,7 +18467,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19314,7 +18478,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 347, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -19328,9 +18492,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19425,7 +18586,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", "responses": { "202": { "description": "Migration", @@ -19436,7 +18597,7 @@ }, "x-appwrite": { "method": "createSupabaseMigration", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -19450,9 +18611,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19541,7 +18699,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", "responses": { "200": { "description": "Migration Report", @@ -19552,7 +18710,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 346, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -19566,9 +18724,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19656,7 +18811,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", "responses": { "200": { "description": "Migration", @@ -19667,7 +18822,7 @@ }, "x-appwrite": { "method": "get", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -19681,9 +18836,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19716,7 +18868,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", "responses": { "202": { "description": "Migration", @@ -19727,7 +18879,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 348, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -19741,9 +18893,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19774,7 +18923,7 @@ "tags": [ "migrations" ], - "description": "", + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", "responses": { "204": { "description": "No content" @@ -19782,7 +18931,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 349, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -19796,9 +18945,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19833,7 +18979,7 @@ "tags": [ "project" ], - "description": "", + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", "responses": { "200": { "description": "UsageProject", @@ -19844,12 +18990,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, "demo": "project\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -19858,9 +19004,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19930,7 +19073,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -19944,9 +19087,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -19980,7 +19120,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -19994,9 +19134,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20059,7 +19196,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -20073,9 +19210,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20119,7 +19253,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -20133,9 +19267,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20198,7 +19329,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -20212,9 +19343,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20249,7 +19377,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all projects. You can use the query params to filter your results. ", "responses": { "200": { "description": "Projects List", @@ -20260,12 +19388,12 @@ }, "x-appwrite": { "method": "list", - "weight": 150, + "weight": 151, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20274,9 +19402,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20322,7 +19447,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new project. You can create a maximum of 100 projects per account. ", "responses": { "201": { "description": "Project", @@ -20333,12 +19458,12 @@ }, "x-appwrite": { "method": "create", - "weight": 149, + "weight": 150, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20347,9 +19472,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20474,7 +19596,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", "responses": { "200": { "description": "Project", @@ -20485,12 +19607,12 @@ }, "x-appwrite": { "method": "get", - "weight": 151, + "weight": 152, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20499,9 +19621,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20534,7 +19653,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a project by its unique ID.", "responses": { "200": { "description": "Project", @@ -20545,12 +19664,12 @@ }, "x-appwrite": { "method": "update", - "weight": 152, + "weight": 153, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20559,9 +19678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20664,7 +19780,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a project by its unique ID.", "responses": { "204": { "description": "No content" @@ -20672,12 +19788,12 @@ }, "x-appwrite": { "method": "delete", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20686,9 +19802,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20723,7 +19836,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", "responses": { "200": { "description": "Project", @@ -20734,12 +19847,12 @@ }, "x-appwrite": { "method": "updateApiStatus", - "weight": 156, + "weight": 157, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-api-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20748,9 +19861,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20817,7 +19927,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", "responses": { "200": { "description": "Project", @@ -20828,12 +19938,12 @@ }, "x-appwrite": { "method": "updateApiStatusAll", - "weight": 157, + "weight": 158, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-api-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20842,9 +19952,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20897,7 +20004,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update how long sessions created within a project should stay active for.", "responses": { "200": { "description": "Project", @@ -20908,12 +20015,12 @@ }, "x-appwrite": { "method": "updateAuthDuration", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-duration.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -20922,9 +20029,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -20977,7 +20081,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", "responses": { "200": { "description": "Project", @@ -20988,12 +20092,12 @@ }, "x-appwrite": { "method": "updateAuthLimit", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21002,9 +20106,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21057,7 +20158,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", "responses": { "200": { "description": "Project", @@ -21068,12 +20169,12 @@ }, "x-appwrite": { "method": "updateAuthSessionsLimit", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-sessions-limit.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21082,9 +20183,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21124,6 +20222,97 @@ ] } }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "default": null, + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "default": null, + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "default": null, + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + ] + } + }, "\/projects\/{projectId}\/auth\/mock-numbers": { "patch": { "summary": "Update the mock numbers for the project", @@ -21137,7 +20326,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", "responses": { "200": { "description": "Project", @@ -21148,12 +20337,12 @@ }, "x-appwrite": { "method": "updateMockNumbers", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-mock-numbers.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21162,9 +20351,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21220,7 +20406,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", "responses": { "200": { "description": "Project", @@ -21231,12 +20417,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordDictionary", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-dictionary.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21245,9 +20431,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21300,7 +20483,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", "responses": { "200": { "description": "Project", @@ -21311,12 +20494,12 @@ }, "x-appwrite": { "method": "updateAuthPasswordHistory", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-password-history.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21325,9 +20508,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21380,7 +20560,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", "responses": { "200": { "description": "Project", @@ -21391,12 +20571,12 @@ }, "x-appwrite": { "method": "updatePersonalDataCheck", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-personal-data-check.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21405,9 +20585,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21460,7 +20637,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", "responses": { "200": { "description": "Project", @@ -21471,12 +20648,12 @@ }, "x-appwrite": { "method": "updateSessionAlerts", - "weight": 159, + "weight": 160, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-session-alerts.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21485,9 +20662,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21540,7 +20714,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", "responses": { "200": { "description": "Project", @@ -21551,12 +20725,12 @@ }, "x-appwrite": { "method": "updateAuthStatus", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-auth-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21565,9 +20739,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21639,7 +20810,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", "responses": { "201": { "description": "JWT", @@ -21650,12 +20821,12 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-j-w-t.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21664,9 +20835,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21728,7 +20896,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all API keys from the current project. ", "responses": { "200": { "description": "API Keys List", @@ -21739,12 +20907,12 @@ }, "x-appwrite": { "method": "listKeys", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-keys.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21753,9 +20921,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21788,7 +20953,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", "responses": { "201": { "description": "Key", @@ -21799,12 +20964,12 @@ }, "x-appwrite": { "method": "createKey", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21813,9 +20978,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21884,7 +21046,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", "responses": { "200": { "description": "Key", @@ -21895,12 +21057,12 @@ }, "x-appwrite": { "method": "getKey", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21909,9 +21071,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -21952,7 +21111,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", "responses": { "200": { "description": "Key", @@ -21963,12 +21122,12 @@ }, "x-appwrite": { "method": "updateKey", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -21977,9 +21136,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22052,7 +21208,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", "responses": { "204": { "description": "No content" @@ -22060,12 +21216,12 @@ }, "x-appwrite": { "method": "deleteKey", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-key.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22074,9 +21230,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22119,7 +21272,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", "responses": { "200": { "description": "Project", @@ -22130,12 +21283,12 @@ }, "x-appwrite": { "method": "updateOAuth2", - "weight": 158, + "weight": 159, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-o-auth2.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22144,9 +21297,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22260,7 +21410,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", "responses": { "200": { "description": "Platforms List", @@ -22271,12 +21421,12 @@ }, "x-appwrite": { "method": "listPlatforms", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-platforms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22285,9 +21435,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22320,7 +21467,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", "responses": { "201": { "description": "Platform", @@ -22331,12 +21478,12 @@ }, "x-appwrite": { "method": "createPlatform", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22345,9 +21492,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22444,7 +21588,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", "responses": { "200": { "description": "Platform", @@ -22455,12 +21599,12 @@ }, "x-appwrite": { "method": "getPlatform", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22469,9 +21613,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22512,7 +21653,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", "responses": { "200": { "description": "Platform", @@ -22523,12 +21664,12 @@ }, "x-appwrite": { "method": "updatePlatform", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22537,9 +21678,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22614,7 +21752,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", "responses": { "204": { "description": "No content" @@ -22622,12 +21760,12 @@ }, "x-appwrite": { "method": "deletePlatform", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-platform.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22636,9 +21774,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22681,7 +21816,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", "responses": { "200": { "description": "Project", @@ -22692,12 +21827,12 @@ }, "x-appwrite": { "method": "updateServiceStatus", - "weight": 154, + "weight": 155, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-service-status.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22706,9 +21841,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22783,7 +21915,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", "responses": { "200": { "description": "Project", @@ -22794,12 +21926,12 @@ }, "x-appwrite": { "method": "updateServiceStatusAll", - "weight": 155, + "weight": 156, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-service-status-all.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22808,9 +21940,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22863,7 +21992,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", "responses": { "200": { "description": "Project", @@ -22874,12 +22003,12 @@ }, "x-appwrite": { "method": "updateSmtp", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-smtp.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -22888,9 +22017,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -22991,11 +22117,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "projects" ], - "description": "", + "description": "Send a test email to verify SMTP configuration. ", "responses": { "204": { "description": "No content" @@ -23003,12 +22131,12 @@ }, "x-appwrite": { "method": "createSmtpTest", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-smtp-test.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23017,9 +22145,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23132,7 +22257,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the team ID of a project allowing for it to be transferred to another team.", "responses": { "200": { "description": "Project", @@ -23143,12 +22268,12 @@ }, "x-appwrite": { "method": "updateTeam", - "weight": 153, + "weight": 154, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-team.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23157,9 +22282,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23212,7 +22334,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", "responses": { "200": { "description": "EmailTemplate", @@ -23223,12 +22345,12 @@ }, "x-appwrite": { "method": "getEmailTemplate", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23237,9 +22359,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23434,23 +22553,23 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", "responses": { "200": { - "description": "Project", + "description": "EmailTemplate", "schema": { - "$ref": "#\/definitions\/project" + "$ref": "#\/definitions\/emailTemplate" } } }, "x-appwrite": { "method": "updateEmailTemplate", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23459,9 +22578,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23699,7 +22815,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", "responses": { "200": { "description": "EmailTemplate", @@ -23710,12 +22826,12 @@ }, "x-appwrite": { "method": "deleteEmailTemplate", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-email-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23724,9 +22840,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -23923,7 +23036,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", "responses": { "200": { "description": "SmsTemplate", @@ -23934,12 +23047,12 @@ }, "x-appwrite": { "method": "getSmsTemplate", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -23948,9 +23061,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24142,7 +23252,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", "responses": { "200": { "description": "SmsTemplate", @@ -24153,12 +23263,12 @@ }, "x-appwrite": { "method": "updateSmsTemplate", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24167,9 +23277,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24379,7 +23486,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", "responses": { "200": { "description": "SmsTemplate", @@ -24390,12 +23497,12 @@ }, "x-appwrite": { "method": "deleteSmsTemplate", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-sms-template.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24404,9 +23511,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24600,7 +23704,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", "responses": { "200": { "description": "Webhooks List", @@ -24611,12 +23715,12 @@ }, "x-appwrite": { "method": "listWebhooks", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/list-webhooks.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24625,9 +23729,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24660,7 +23761,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", "responses": { "201": { "description": "Webhook", @@ -24671,12 +23772,12 @@ }, "x-appwrite": { "method": "createWebhook", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/create-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24685,9 +23786,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24782,7 +23880,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", "responses": { "200": { "description": "Webhook", @@ -24793,12 +23891,12 @@ }, "x-appwrite": { "method": "getWebhook", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/get-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24807,9 +23905,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24850,7 +23945,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", "responses": { "200": { "description": "Webhook", @@ -24861,12 +23956,12 @@ }, "x-appwrite": { "method": "updateWebhook", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24875,9 +23970,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -24976,7 +24068,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", "responses": { "204": { "description": "No content" @@ -24984,12 +24076,12 @@ }, "x-appwrite": { "method": "deleteWebhook", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/delete-webhook.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -24998,9 +24090,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25043,7 +24132,7 @@ "tags": [ "projects" ], - "description": "", + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", "responses": { "200": { "description": "Webhook", @@ -25054,12 +24143,12 @@ }, "x-appwrite": { "method": "updateWebhookSignature", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, "demo": "projects\/update-webhook-signature.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25068,9 +24157,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25124,7 +24210,7 @@ }, "x-appwrite": { "method": "listRules", - "weight": 315, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -25138,9 +24224,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25197,7 +24280,7 @@ }, "x-appwrite": { "method": "createRule", - "weight": 314, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -25211,9 +24294,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25288,7 +24368,7 @@ }, "x-appwrite": { "method": "getRule", - "weight": 316, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -25302,9 +24382,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25343,7 +24420,7 @@ }, "x-appwrite": { "method": "deleteRule", - "weight": 317, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -25357,9 +24434,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25394,7 +24468,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", "responses": { "200": { "description": "Rule", @@ -25405,12 +24479,12 @@ }, "x-appwrite": { "method": "updateRuleVerification", - "weight": 318, + "weight": 320, "cookies": false, "type": "", "deprecated": false, "demo": "proxy\/update-rule-verification.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -25419,9 +24493,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25467,7 +24538,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -25481,9 +24552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25541,7 +24609,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -25555,9 +24623,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25682,7 +24747,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -25696,9 +24761,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25743,7 +24805,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -25757,9 +24819,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25878,7 +24937,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -25892,9 +24951,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -25941,7 +24997,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -25957,9 +25013,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26015,7 +25068,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -26026,7 +25079,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -26042,9 +25095,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26120,7 +25170,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -26136,9 +25186,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26192,7 +25239,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -26208,9 +25255,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26283,7 +25327,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -26299,9 +25343,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26357,7 +25398,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -26373,9 +25414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26431,7 +25469,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -26447,9 +25485,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26598,6 +25633,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -26632,7 +25668,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -26648,9 +25684,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26695,7 +25728,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "StorageUsage", @@ -26706,12 +25739,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 214, + "weight": 216, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26720,9 +25753,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26769,7 +25799,7 @@ "tags": [ "storage" ], - "description": "", + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageBuckets", @@ -26780,12 +25810,12 @@ }, "x-appwrite": { "method": "getBucketUsage", - "weight": 215, + "weight": 217, "cookies": false, "type": "", "deprecated": false, "demo": "storage\/get-bucket-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -26794,9 +25824,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26862,7 +25889,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -26878,9 +25905,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -26939,7 +25963,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -26955,9 +25979,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27033,7 +26054,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -27049,9 +26070,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27097,7 +26115,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -27113,9 +26131,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27174,7 +26189,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -27190,9 +26205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27240,7 +26252,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -27254,9 +26266,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27303,7 +26312,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -27314,7 +26323,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -27330,9 +26339,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27388,7 +26394,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -27399,7 +26405,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -27415,9 +26421,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27505,7 +26508,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -27516,7 +26519,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -27532,9 +26535,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27577,7 +26577,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -27588,7 +26588,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -27604,9 +26604,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27676,7 +26673,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -27692,9 +26689,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27739,7 +26733,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -27750,7 +26744,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -27765,9 +26759,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27847,7 +26838,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -27862,9 +26853,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27909,7 +26897,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -27924,9 +26912,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -27991,7 +26976,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -28005,9 +26990,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28065,7 +27047,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -28079,9 +27061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28162,7 +27141,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -28176,9 +27155,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28255,7 +27231,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -28269,9 +27245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28348,7 +27321,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -28362,9 +27335,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28419,7 +27389,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -28433,9 +27403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28482,7 +27449,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -28496,9 +27463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28575,7 +27539,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -28589,9 +27553,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28668,7 +27629,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -28682,9 +27643,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28796,7 +27754,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -28810,9 +27768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -28910,7 +27865,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -28924,9 +27879,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29013,7 +27965,7 @@ "tags": [ "users" ], - "description": "", + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", "responses": { "200": { "description": "UsageUsers", @@ -29024,12 +27976,12 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, "demo": "users\/get-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -29038,9 +27990,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29098,7 +28047,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -29112,9 +28061,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29154,7 +28100,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -29168,9 +28114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29217,7 +28160,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -29231,9 +28174,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29298,7 +28238,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -29312,9 +28252,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29371,7 +28308,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -29382,7 +28319,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -29396,9 +28333,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29466,7 +28400,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -29480,9 +28414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29541,7 +28472,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -29555,9 +28486,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29604,7 +28532,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -29618,9 +28546,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29668,24 +28593,19 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -29699,9 +28619,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29761,7 +28678,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -29775,9 +28692,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29824,7 +28738,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -29838,9 +28752,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29885,7 +28796,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -29899,9 +28810,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -29946,7 +28854,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -29960,9 +28868,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30009,7 +28914,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -30023,9 +28928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30090,7 +28992,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -30104,9 +29006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30171,7 +29070,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -30185,9 +29084,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30252,7 +29148,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -30266,9 +29162,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30313,7 +29206,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -30327,9 +29220,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30394,7 +29284,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -30408,9 +29298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30444,7 +29331,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -30455,7 +29342,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -30469,9 +29356,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30511,7 +29395,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -30525,9 +29409,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30569,7 +29450,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -30583,9 +29464,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30640,7 +29518,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -30654,9 +29532,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30721,7 +29596,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -30736,9 +29611,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30795,7 +29667,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -30810,9 +29682,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30910,7 +29779,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -30925,9 +29794,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -30980,7 +29846,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -30995,9 +29861,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31060,9 +29923,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -31074,7 +29935,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -31089,9 +29950,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31135,7 +29993,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -31146,7 +30004,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -31160,9 +30018,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31230,7 +30085,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -31244,9 +30099,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31311,7 +30163,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -31325,9 +30177,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31381,7 +30230,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", "responses": { "200": { "description": "Provider Repositories List", @@ -31392,12 +30241,12 @@ }, "x-appwrite": { "method": "listRepositories", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repositories.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31406,9 +30255,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31450,7 +30296,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", "responses": { "200": { "description": "ProviderRepository", @@ -31461,12 +30307,12 @@ }, "x-appwrite": { "method": "createRepository", - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31475,9 +30321,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31537,7 +30380,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", "responses": { "200": { "description": "ProviderRepository", @@ -31548,12 +30391,12 @@ }, "x-appwrite": { "method": "getRepository", - "weight": 279, + "weight": 281, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31562,9 +30405,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31607,7 +30447,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", "responses": { "200": { "description": "Branches List", @@ -31618,12 +30458,12 @@ }, "x-appwrite": { "method": "listRepositoryBranches", - "weight": 280, + "weight": 282, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/list-repository-branches.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31632,9 +30472,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31677,7 +30514,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", "responses": { "200": { "description": "VCS Content List", @@ -31688,12 +30525,12 @@ }, "x-appwrite": { "method": "getRepositoryContents", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/get-repository-contents.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31702,9 +30539,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31756,7 +30590,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "Detection", @@ -31767,12 +30601,12 @@ }, "x-appwrite": { "method": "createRepositoryDetection", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/create-repository-detection.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31781,9 +30615,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31835,11 +30666,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "vcs" ], - "description": "", + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", "responses": { "204": { "description": "No content" @@ -31847,12 +30680,12 @@ }, "x-appwrite": { "method": "updateExternalDeployments", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, "demo": "vcs\/update-external-deployments.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -31861,9 +30694,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31924,7 +30754,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", "responses": { "200": { "description": "Installations List", @@ -31935,7 +30765,7 @@ }, "x-appwrite": { "method": "listInstallations", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -31949,9 +30779,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -31999,7 +30826,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", "responses": { "200": { "description": "Installation", @@ -32010,7 +30837,7 @@ }, "x-appwrite": { "method": "getInstallation", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -32024,9 +30851,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -32057,7 +30881,7 @@ "tags": [ "vcs" ], - "description": "", + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", "responses": { "204": { "description": "No content" @@ -32065,7 +30889,7 @@ }, "x-appwrite": { "method": "deleteInstallation", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -32079,9 +30903,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -33144,31 +31965,6 @@ "migrations" ] }, - "firebaseProjectList": { - "description": "Migrations Firebase Projects List", - "type": "object", - "properties": { - "total": { - "type": "integer", - "description": "Total number of projects documents that matched your query.", - "x-example": 5, - "format": "int32" - }, - "projects": { - "type": "array", - "description": "List of projects.", - "items": { - "type": "object", - "$ref": "#\/definitions\/firebaseProject" - }, - "x-example": "" - } - }, - "required": [ - "total", - "projects" - ] - }, "specificationList": { "description": "Specifications List", "type": "object", @@ -35363,12 +34159,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -35398,7 +34194,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -35512,7 +34308,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -35564,7 +34360,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -36238,7 +35034,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -36485,6 +35281,21 @@ "description": "Whether or not to send session alert emails to users.", "x-example": true }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, "oAuthProviders": { "type": "array", "description": "List of Auth Providers.", @@ -36569,6 +35380,17 @@ "description": "SMTP server secure protocol", "x-example": "tls" }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, "authEmailPassword": { "type": "boolean", "description": "Email\/Password auth method status", @@ -36683,6 +35505,9 @@ "authPersonalDataCheck", "authMockNumbers", "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", "oAuthProviders", "platforms", "webhooks", @@ -36696,6 +35521,8 @@ "smtpUsername", "smtpPassword", "smtpSecure", + "pingCount", + "pingedAt", "authEmailPassword", "authUsersAuthMagicURL", "authEmailOtp", @@ -37357,7 +36184,8 @@ "resourceId": { "type": "string", "description": "Resource ID.", - "x-example": "5e5ea5c16897e" + "x-example": "5e5ea5c16897e", + "x-nullable": true }, "name": { "type": "string", @@ -37369,10 +36197,16 @@ "description": "The value of this metric at the timestamp.", "x-example": 1, "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "x-nullable": true } }, "required": [ - "resourceId", "name", "value" ] @@ -37410,6 +36244,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "databases": { "type": "array", "description": "Aggregated number of databases per period.", @@ -37445,6 +36291,24 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -37453,10 +36317,14 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", "databases", "collections", "documents", - "storage" + "storage", + "databasesReads", + "databasesWrites" ] }, "usageDatabase": { @@ -37486,6 +36354,18 @@ "x-example": 0, "format": "int32" }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "collections": { "type": "array", "description": "Aggregated number of collections per period.", @@ -37512,6 +36392,24 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -37519,9 +36417,13 @@ "collectionsTotal", "documentsTotal", "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", "collections", "documents", - "storage" + "storage", + "databaseReads", + "databaseWrites" ] }, "usageCollection": { @@ -38143,6 +37045,18 @@ "x-example": 0, "format": "int32" }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, "requests": { "type": "array", "description": "Aggregated number of requests per period.", @@ -38232,6 +37146,45 @@ "$ref": "#\/definitions\/metricBreakdown" }, "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -38247,6 +37200,8 @@ "bucketsTotal", "executionsMbSecondsTotal", "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", "requests", "network", "users", @@ -38256,7 +37211,12 @@ "databasesStorageBreakdown", "executionsMbSecondsBreakdown", "buildsMbSecondsBreakdown", - "functionsStorageBreakdown" + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites" ] }, "headers": { @@ -38303,7 +37263,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -38944,7 +37904,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -38966,6 +37926,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -38975,7 +37940,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] }, "migration": { @@ -38989,7 +37955,7 @@ }, "$createdAt": { "type": "string", - "description": "Variable creation date in ISO 8601 format.", + "description": "Migration creation date in ISO 8601 format.", "x-example": "2020-10-15T06:38:00.000+00:00" }, "$updatedAt": { @@ -39012,9 +37978,14 @@ "description": "A string containing the type of source of the migration.", "x-example": "Appwrite" }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, "resources": { "type": "array", - "description": "Resources to migration.", + "description": "Resources to migrate.", "items": { "type": "string" }, @@ -39050,6 +38021,7 @@ "status", "stage", "source", + "destination", "resources", "statusCounters", "resourceData", @@ -39125,26 +38097,6 @@ "size", "version" ] - }, - "firebaseProject": { - "description": "MigrationFirebaseProject", - "type": "object", - "properties": { - "projectId": { - "type": "string", - "description": "Project ID.", - "x-example": "my-project" - }, - "displayName": { - "type": "string", - "description": "Project display name.", - "x-example": "My Project" - } - }, - "required": [ - "projectId", - "displayName" - ] } }, "externalDocs": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 80c9e6037f..e38495629c 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.0", + "version": "1.6.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", @@ -102,7 +102,7 @@ }, "x-appwrite": { "method": "get", - "weight": 8, + "weight": 9, "cookies": false, "type": "", "deprecated": false, @@ -117,9 +117,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -156,7 +153,7 @@ }, "x-appwrite": { "method": "create", - "weight": 7, + "weight": 8, "cookies": false, "type": "", "deprecated": false, @@ -171,9 +168,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -238,7 +232,7 @@ "tags": [ "account" ], - "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\r\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\r\n", + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", "responses": { "200": { "description": "User", @@ -249,7 +243,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 33, + "weight": 34, "cookies": false, "type": "", "deprecated": false, @@ -264,9 +258,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -332,7 +323,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 56, + "weight": 57, "cookies": false, "type": "", "deprecated": false, @@ -347,9 +338,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/identities", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -397,7 +385,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 57, + "weight": 58, "cookies": false, "type": "", "deprecated": false, @@ -412,9 +400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -463,7 +448,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 28, + "weight": 29, "cookies": false, "type": "", "deprecated": false, @@ -478,9 +463,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -516,7 +498,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 30, + "weight": 31, "cookies": false, "type": "", "deprecated": false, @@ -531,9 +513,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -586,7 +565,7 @@ }, "x-appwrite": { "method": "updateMFA", - "weight": 43, + "weight": 44, "cookies": false, "type": "", "deprecated": false, @@ -601,9 +580,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -662,7 +638,7 @@ }, "x-appwrite": { "method": "createMfaAuthenticator", - "weight": 45, + "weight": 46, "cookies": false, "type": "", "deprecated": false, @@ -677,9 +653,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -731,7 +704,7 @@ }, "x-appwrite": { "method": "updateMfaAuthenticator", - "weight": 46, + "weight": 47, "cookies": false, "type": "", "deprecated": false, @@ -746,9 +719,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -813,7 +783,7 @@ }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 50, + "weight": 51, "cookies": false, "type": "", "deprecated": false, @@ -828,9 +798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -884,7 +851,7 @@ }, "x-appwrite": { "method": "createMfaChallenge", - "weight": 51, + "weight": 52, "cookies": false, "type": "", "deprecated": false, @@ -899,9 +866,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -946,19 +910,24 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "account" ], "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", "responses": { - "204": { - "description": "No content" + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } } }, "x-appwrite": { "method": "updateMfaChallenge", - "weight": 52, + "weight": 53, "cookies": false, "type": "", "deprecated": false, @@ -973,9 +942,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1041,7 +1007,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 44, + "weight": 45, "cookies": false, "type": "", "deprecated": false, @@ -1056,9 +1022,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1097,7 +1060,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 49, + "weight": 50, "cookies": false, "type": "", "deprecated": false, @@ -1112,9 +1075,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1151,7 +1111,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 47, + "weight": 48, "cookies": false, "type": "", "deprecated": false, @@ -1166,9 +1126,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1205,7 +1162,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 48, + "weight": 49, "cookies": false, "type": "", "deprecated": false, @@ -1220,9 +1177,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1261,7 +1215,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 31, + "weight": 32, "cookies": false, "type": "", "deprecated": false, @@ -1276,9 +1230,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1337,7 +1288,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 32, + "weight": 33, "cookies": false, "type": "", "deprecated": false, @@ -1352,9 +1303,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1419,7 +1367,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 34, + "weight": 35, "cookies": false, "type": "", "deprecated": false, @@ -1434,9 +1382,6 @@ "server" ], "packaging": false, - "offline-model": "\/account", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1502,7 +1447,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 29, + "weight": 30, "cookies": false, "type": "", "deprecated": false, @@ -1517,9 +1462,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1556,7 +1498,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 35, + "weight": 36, "cookies": false, "type": "", "deprecated": false, @@ -1571,9 +1513,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/prefs", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1632,7 +1571,7 @@ }, "x-appwrite": { "method": "createRecovery", - "weight": 37, + "weight": 38, "cookies": false, "type": "", "deprecated": false, @@ -1650,9 +1589,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1705,7 +1641,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", + "description": "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST \/account\/recovery](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.", "responses": { "200": { "description": "Token", @@ -1716,7 +1652,7 @@ }, "x-appwrite": { "method": "updateRecovery", - "weight": 38, + "weight": 39, "cookies": false, "type": "", "deprecated": false, @@ -1731,9 +1667,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1806,7 +1739,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 10, + "weight": 11, "cookies": false, "type": "", "deprecated": false, @@ -1821,9 +1754,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1855,7 +1785,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 11, + "weight": 12, "cookies": false, "type": "", "deprecated": false, @@ -1870,9 +1800,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -1911,7 +1838,7 @@ }, "x-appwrite": { "method": "createAnonymousSession", - "weight": 16, + "weight": 17, "cookies": false, "type": "", "deprecated": false, @@ -1926,9 +1853,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -1953,7 +1877,7 @@ "tags": [ "account" ], - "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Session", @@ -1964,7 +1888,7 @@ }, "x-appwrite": { "method": "createEmailPasswordSession", - "weight": 15, + "weight": 16, "cookies": false, "type": "", "deprecated": false, @@ -1979,9 +1903,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2044,7 +1965,7 @@ }, "x-appwrite": { "method": "updateMagicURLSession", - "weight": 25, + "weight": 26, "cookies": false, "type": "", "deprecated": true, @@ -2059,9 +1980,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2124,7 +2042,7 @@ }, "x-appwrite": { "method": "updatePhoneSession", - "weight": 26, + "weight": 27, "cookies": false, "type": "", "deprecated": true, @@ -2139,9 +2057,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2204,7 +2119,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 17, + "weight": 18, "cookies": false, "type": "", "deprecated": false, @@ -2219,9 +2134,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2284,7 +2196,7 @@ }, "x-appwrite": { "method": "getSession", - "weight": 12, + "weight": 13, "cookies": false, "type": "", "deprecated": false, @@ -2299,9 +2211,6 @@ "server" ], "packaging": false, - "offline-model": "\/account\/sessions", - "offline-key": "{sessionId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2348,7 +2257,7 @@ }, "x-appwrite": { "method": "updateSession", - "weight": 14, + "weight": 15, "cookies": false, "type": "", "deprecated": false, @@ -2363,9 +2272,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2407,7 +2313,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 13, + "weight": 14, "cookies": false, "type": "", "deprecated": false, @@ -2422,9 +2328,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2473,7 +2376,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 36, + "weight": 37, "cookies": false, "type": "", "deprecated": false, @@ -2488,9 +2391,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -2518,7 +2418,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2529,7 +2429,7 @@ }, "x-appwrite": { "method": "createEmailToken", - "weight": 24, + "weight": 25, "cookies": false, "type": "", "deprecated": false, @@ -2544,9 +2444,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2604,7 +2501,7 @@ "tags": [ "account" ], - "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\r\n", + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", "responses": { "201": { "description": "Token", @@ -2615,7 +2512,7 @@ }, "x-appwrite": { "method": "createMagicURLToken", - "weight": 23, + "weight": 24, "cookies": false, "type": "", "deprecated": false, @@ -2633,9 +2530,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2699,7 +2593,7 @@ "tags": [ "account" ], - "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \r\n\r\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "301": { "description": "No content" @@ -2707,7 +2601,7 @@ }, "x-appwrite": { "method": "createOAuth2Token", - "weight": 22, + "weight": 23, "cookies": false, "type": "webAuth", "deprecated": false, @@ -2722,9 +2616,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2834,7 +2725,7 @@ "tags": [ "account" ], - "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\r\n\r\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", "responses": { "201": { "description": "Token", @@ -2845,7 +2736,7 @@ }, "x-appwrite": { "method": "createPhoneToken", - "weight": 27, + "weight": 28, "cookies": false, "type": "", "deprecated": false, @@ -2863,9 +2754,6 @@ "client" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [] } @@ -2917,7 +2805,7 @@ "tags": [ "account" ], - "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\r\n\r\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\r\n", + "description": "Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n", "responses": { "201": { "description": "Token", @@ -2928,7 +2816,7 @@ }, "x-appwrite": { "method": "createVerification", - "weight": 39, + "weight": 40, "cookies": false, "type": "", "deprecated": false, @@ -2943,9 +2831,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3002,7 +2887,7 @@ }, "x-appwrite": { "method": "updateVerification", - "weight": 40, + "weight": 41, "cookies": false, "type": "", "deprecated": false, @@ -3017,9 +2902,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3085,7 +2967,7 @@ }, "x-appwrite": { "method": "createPhoneVerification", - "weight": 41, + "weight": 42, "cookies": false, "type": "", "deprecated": false, @@ -3103,9 +2985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3142,7 +3021,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 42, + "weight": 43, "cookies": false, "type": "", "deprecated": false, @@ -3157,9 +3036,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3214,7 +3090,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "description": "You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", "responses": { "200": { "description": "Image", @@ -3225,7 +3101,7 @@ }, "x-appwrite": { "method": "getBrowser", - "weight": 59, + "weight": 60, "cookies": false, "type": "location", "deprecated": false, @@ -3241,9 +3117,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3345,7 +3218,7 @@ "tags": [ "avatars" ], - "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3356,7 +3229,7 @@ }, "x-appwrite": { "method": "getCreditCard", - "weight": 58, + "weight": 59, "cookies": false, "type": "location", "deprecated": false, @@ -3372,9 +3245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3480,7 +3350,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -3491,7 +3361,7 @@ }, "x-appwrite": { "method": "getFavicon", - "weight": 62, + "weight": 63, "cookies": false, "type": "location", "deprecated": false, @@ -3507,9 +3377,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -3549,7 +3416,7 @@ "tags": [ "avatars" ], - "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -3560,7 +3427,7 @@ }, "x-appwrite": { "method": "getFlag", - "weight": 60, + "weight": 61, "cookies": false, "type": "location", "deprecated": false, @@ -3576,9 +3443,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4042,7 +3906,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\r\n\r\nThis endpoint does not follow HTTP redirects.", + "description": "Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", "responses": { "200": { "description": "Image", @@ -4053,7 +3917,7 @@ }, "x-appwrite": { "method": "getImage", - "weight": 61, + "weight": 62, "cookies": false, "type": "location", "deprecated": false, @@ -4069,9 +3933,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4131,7 +3992,7 @@ "tags": [ "avatars" ], - "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\r\n\r\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\r\n\r\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\r\n", + "description": "Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", "responses": { "200": { "description": "Image", @@ -4142,7 +4003,7 @@ }, "x-appwrite": { "method": "getInitials", - "weight": 64, + "weight": 65, "cookies": false, "type": "location", "deprecated": false, @@ -4158,9 +4019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4228,7 +4086,7 @@ "tags": [ "avatars" ], - "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\r\n", + "description": "Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n", "responses": { "200": { "description": "Image", @@ -4239,7 +4097,7 @@ }, "x-appwrite": { "method": "getQR", - "weight": 63, + "weight": 64, "cookies": false, "type": "location", "deprecated": false, @@ -4255,9 +4113,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -4336,7 +4191,7 @@ }, "x-appwrite": { "method": "list", - "weight": 69, + "weight": 70, "cookies": false, "type": "", "deprecated": false, @@ -4350,9 +4205,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4400,7 +4252,7 @@ "tags": [ "databases" ], - "description": "Create a new Database.\r\n", + "description": "Create a new Database.\n", "responses": { "201": { "description": "Database", @@ -4411,7 +4263,7 @@ }, "x-appwrite": { "method": "create", - "weight": 68, + "weight": 69, "cookies": false, "type": "", "deprecated": false, @@ -4425,9 +4277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4498,7 +4347,7 @@ }, "x-appwrite": { "method": "get", - "weight": 70, + "weight": 71, "cookies": false, "type": "", "deprecated": false, @@ -4512,9 +4361,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4560,7 +4406,7 @@ }, "x-appwrite": { "method": "update", - "weight": 72, + "weight": 73, "cookies": false, "type": "", "deprecated": false, @@ -4574,9 +4420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4641,7 +4484,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 73, + "weight": 74, "cookies": false, "type": "", "deprecated": false, @@ -4655,9 +4498,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4705,7 +4545,7 @@ }, "x-appwrite": { "method": "listCollections", - "weight": 75, + "weight": 76, "cookies": false, "type": "", "deprecated": false, @@ -4719,9 +4559,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4788,7 +4625,7 @@ }, "x-appwrite": { "method": "createCollection", - "weight": 74, + "weight": 75, "cookies": false, "type": "", "deprecated": false, @@ -4802,9 +4639,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4898,7 +4732,7 @@ }, "x-appwrite": { "method": "getCollection", - "weight": 76, + "weight": 77, "cookies": false, "type": "", "deprecated": false, @@ -4912,9 +4746,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -4968,7 +4799,7 @@ }, "x-appwrite": { "method": "updateCollection", - "weight": 78, + "weight": 79, "cookies": false, "type": "", "deprecated": false, @@ -4982,9 +4813,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5072,7 +4900,7 @@ }, "x-appwrite": { "method": "deleteCollection", - "weight": 79, + "weight": 80, "cookies": false, "type": "", "deprecated": false, @@ -5086,9 +4914,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5144,7 +4969,7 @@ }, "x-appwrite": { "method": "listAttributes", - "weight": 90, + "weight": 91, "cookies": false, "type": "", "deprecated": false, @@ -5158,9 +4983,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5217,7 +5039,7 @@ "tags": [ "databases" ], - "description": "Create a boolean attribute.\r\n", + "description": "Create a boolean attribute.\n", "responses": { "202": { "description": "AttributeBoolean", @@ -5228,7 +5050,7 @@ }, "x-appwrite": { "method": "createBooleanAttribute", - "weight": 87, + "weight": 88, "cookies": false, "type": "", "deprecated": false, @@ -5242,9 +5064,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5320,7 +5139,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5335,7 +5156,7 @@ }, "x-appwrite": { "method": "updateBooleanAttribute", - "weight": 99, + "weight": 100, "cookies": false, "type": "", "deprecated": false, @@ -5349,9 +5170,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5446,7 +5264,7 @@ }, "x-appwrite": { "method": "createDatetimeAttribute", - "weight": 88, + "weight": 89, "cookies": false, "type": "", "deprecated": false, @@ -5460,9 +5278,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5538,7 +5353,9 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], @@ -5553,7 +5370,7 @@ }, "x-appwrite": { "method": "updateDatetimeAttribute", - "weight": 100, + "weight": 101, "cookies": false, "type": "", "deprecated": false, @@ -5567,9 +5384,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5653,7 +5467,7 @@ "tags": [ "databases" ], - "description": "Create an email attribute.\r\n", + "description": "Create an email attribute.\n", "responses": { "202": { "description": "AttributeEmail", @@ -5664,7 +5478,7 @@ }, "x-appwrite": { "method": "createEmailAttribute", - "weight": 81, + "weight": 82, "cookies": false, "type": "", "deprecated": false, @@ -5678,9 +5492,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5756,11 +5567,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEmail", @@ -5771,7 +5584,7 @@ }, "x-appwrite": { "method": "updateEmailAttribute", - "weight": 93, + "weight": 94, "cookies": false, "type": "", "deprecated": false, @@ -5785,9 +5598,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5871,7 +5681,7 @@ "tags": [ "databases" ], - "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \r\n", + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", "responses": { "202": { "description": "AttributeEnum", @@ -5882,7 +5692,7 @@ }, "x-appwrite": { "method": "createEnumAttribute", - "weight": 82, + "weight": 83, "cookies": false, "type": "", "deprecated": false, @@ -5896,9 +5706,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -5984,11 +5791,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeEnum", @@ -5999,7 +5808,7 @@ }, "x-appwrite": { "method": "updateEnumAttribute", - "weight": 94, + "weight": 95, "cookies": false, "type": "", "deprecated": false, @@ -6013,9 +5822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6109,7 +5915,7 @@ "tags": [ "databases" ], - "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeFloat", @@ -6120,7 +5926,7 @@ }, "x-appwrite": { "method": "createFloatAttribute", - "weight": 86, + "weight": 87, "cookies": false, "type": "", "deprecated": false, @@ -6134,9 +5940,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6224,11 +6027,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeFloat", @@ -6239,7 +6044,7 @@ }, "x-appwrite": { "method": "updateFloatAttribute", - "weight": 98, + "weight": 99, "cookies": false, "type": "", "deprecated": false, @@ -6253,9 +6058,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6353,7 +6155,7 @@ "tags": [ "databases" ], - "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\r\n", + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", "responses": { "202": { "description": "AttributeInteger", @@ -6364,7 +6166,7 @@ }, "x-appwrite": { "method": "createIntegerAttribute", - "weight": 85, + "weight": 86, "cookies": false, "type": "", "deprecated": false, @@ -6378,9 +6180,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6468,11 +6267,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeInteger", @@ -6483,7 +6284,7 @@ }, "x-appwrite": { "method": "updateIntegerAttribute", - "weight": 97, + "weight": 98, "cookies": false, "type": "", "deprecated": false, @@ -6497,9 +6298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6597,7 +6395,7 @@ "tags": [ "databases" ], - "description": "Create IP address attribute.\r\n", + "description": "Create IP address attribute.\n", "responses": { "202": { "description": "AttributeIP", @@ -6608,7 +6406,7 @@ }, "x-appwrite": { "method": "createIpAttribute", - "weight": 83, + "weight": 84, "cookies": false, "type": "", "deprecated": false, @@ -6622,9 +6420,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6700,11 +6495,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeIP", @@ -6715,7 +6512,7 @@ }, "x-appwrite": { "method": "updateIpAttribute", - "weight": 95, + "weight": 96, "cookies": false, "type": "", "deprecated": false, @@ -6729,9 +6526,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6815,7 +6609,7 @@ "tags": [ "databases" ], - "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "202": { "description": "AttributeRelationship", @@ -6826,7 +6620,7 @@ }, "x-appwrite": { "method": "createRelationshipAttribute", - "weight": 89, + "weight": 90, "cookies": false, "type": "", "deprecated": false, @@ -6840,9 +6634,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -6951,7 +6742,7 @@ "tags": [ "databases" ], - "description": "Create a string attribute.\r\n", + "description": "Create a string attribute.\n", "responses": { "202": { "description": "AttributeString", @@ -6962,7 +6753,7 @@ }, "x-appwrite": { "method": "createStringAttribute", - "weight": 80, + "weight": 81, "cookies": false, "type": "", "deprecated": false, @@ -6976,9 +6767,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7067,11 +6855,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeString", @@ -7082,7 +6872,7 @@ }, "x-appwrite": { "method": "updateStringAttribute", - "weight": 92, + "weight": 93, "cookies": false, "type": "", "deprecated": false, @@ -7096,9 +6886,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7157,7 +6944,7 @@ "type": "integer", "description": "Maximum size of the string attribute.", "default": null, - "x-example": null + "x-example": 1 }, "newKey": { "type": "string", @@ -7188,7 +6975,7 @@ "tags": [ "databases" ], - "description": "Create a URL attribute.\r\n", + "description": "Create a URL attribute.\n", "responses": { "202": { "description": "AttributeURL", @@ -7199,7 +6986,7 @@ }, "x-appwrite": { "method": "createUrlAttribute", - "weight": 84, + "weight": 85, "cookies": false, "type": "", "deprecated": false, @@ -7213,9 +7000,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7291,11 +7075,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\r\n", + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", "responses": { "200": { "description": "AttributeURL", @@ -7306,7 +7092,7 @@ }, "x-appwrite": { "method": "updateUrlAttribute", - "weight": 96, + "weight": 97, "cookies": false, "type": "", "deprecated": false, @@ -7320,9 +7106,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7448,7 +7231,7 @@ }, "x-appwrite": { "method": "getAttribute", - "weight": 91, + "weight": 92, "cookies": false, "type": "", "deprecated": false, @@ -7462,9 +7245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7520,7 +7300,7 @@ }, "x-appwrite": { "method": "deleteAttribute", - "weight": 102, + "weight": 103, "cookies": false, "type": "", "deprecated": false, @@ -7534,9 +7314,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7582,11 +7359,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "databases" ], - "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\r\n", + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", "responses": { "200": { "description": "AttributeRelationship", @@ -7597,7 +7376,7 @@ }, "x-appwrite": { "method": "updateRelationshipAttribute", - "weight": 101, + "weight": 102, "cookies": false, "type": "", "deprecated": false, @@ -7611,9 +7390,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -7704,7 +7480,7 @@ }, "x-appwrite": { "method": "listDocuments", - "weight": 108, + "weight": 109, "cookies": false, "type": "", "deprecated": false, @@ -7720,9 +7496,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7790,7 +7563,7 @@ }, "x-appwrite": { "method": "createDocument", - "weight": 107, + "weight": 108, "cookies": false, "type": "", "deprecated": false, @@ -7806,9 +7579,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7900,7 +7670,7 @@ }, "x-appwrite": { "method": "getDocument", - "weight": 109, + "weight": 110, "cookies": false, "type": "", "deprecated": false, @@ -7916,9 +7686,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -7994,7 +7761,7 @@ }, "x-appwrite": { "method": "updateDocument", - "weight": 111, + "weight": 112, "cookies": false, "type": "", "deprecated": false, @@ -8010,9 +7777,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8095,7 +7859,7 @@ }, "x-appwrite": { "method": "deleteDocument", - "weight": 112, + "weight": 113, "cookies": false, "type": "", "deprecated": false, @@ -8111,9 +7875,6 @@ "server" ], "packaging": false, - "offline-model": "\/databases\/{databaseId}\/collections\/{collectionId}\/documents", - "offline-key": "{documentId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -8179,7 +7940,7 @@ }, "x-appwrite": { "method": "listIndexes", - "weight": 104, + "weight": 105, "cookies": false, "type": "", "deprecated": false, @@ -8193,9 +7954,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8250,7 +8008,7 @@ "tags": [ "databases" ], - "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\r\nAttributes can be `key`, `fulltext`, and `unique`.", + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", "responses": { "202": { "description": "Index", @@ -8261,7 +8019,7 @@ }, "x-appwrite": { "method": "createIndex", - "weight": 103, + "weight": 104, "cookies": false, "type": "", "deprecated": false, @@ -8275,9 +8033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8384,7 +8139,7 @@ }, "x-appwrite": { "method": "getIndex", - "weight": 105, + "weight": 106, "cookies": false, "type": "", "deprecated": false, @@ -8398,9 +8153,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8456,7 +8208,7 @@ }, "x-appwrite": { "method": "deleteIndex", - "weight": 106, + "weight": 107, "cookies": false, "type": "", "deprecated": false, @@ -8470,9 +8222,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8535,7 +8284,7 @@ }, "x-appwrite": { "method": "list", - "weight": 287, + "weight": 289, "cookies": false, "type": "", "deprecated": false, @@ -8549,9 +8298,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8610,7 +8356,7 @@ }, "x-appwrite": { "method": "create", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -8624,9 +8370,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8669,6 +8412,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -8687,6 +8431,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -8694,24 +8440,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -8836,7 +8589,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -8874,7 +8627,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -8888,9 +8641,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8917,7 +8667,7 @@ "tags": [ "functions" ], - "description": "List allowed function specifications for this instance.\r\n", + "description": "List allowed function specifications for this instance.\n", "responses": { "200": { "description": "Specifications List", @@ -8928,7 +8678,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -8943,9 +8693,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -8983,7 +8730,7 @@ }, "x-appwrite": { "method": "get", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -8997,9 +8744,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9045,7 +8789,7 @@ }, "x-appwrite": { "method": "update", - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -9059,9 +8803,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9106,6 +8847,7 @@ "node-19.0", "node-20.0", "node-21.0", + "node-22", "php-8.0", "php-8.1", "php-8.2", @@ -9124,6 +8866,8 @@ "deno-1.24", "deno-1.35", "deno-1.40", + "deno-1.46", + "deno-2.0", "dart-2.15", "dart-2.16", "dart-2.17", @@ -9131,24 +8875,31 @@ "dart-3.0", "dart-3.1", "dart-3.3", - "dotnet-3.1", + "dart-3.5", "dotnet-6.0", "dotnet-7.0", + "dotnet-8.0", "java-8.0", "java-11.0", "java-17.0", "java-18.0", "java-21.0", + "java-22", "swift-5.5", "swift-5.8", "swift-5.9", + "swift-5.10", "kotlin-1.6", "kotlin-1.8", "kotlin-1.9", + "kotlin-2.0", "cpp-17", "cpp-20", "bun-1.0", - "go-1.23" + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24" ], "x-enum-name": null, "x-enum-keys": [] @@ -9250,7 +9001,7 @@ "specification": { "type": "string", "description": "Runtime specification for the function and builds.", - "default": "s-0.5vcpu-512mb", + "default": "s-1vcpu-512mb", "x-example": null } }, @@ -9279,7 +9030,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 296, + "weight": 298, "cookies": false, "type": "", "deprecated": false, @@ -9293,9 +9044,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9343,7 +9091,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 298, + "weight": 300, "cookies": false, "type": "", "deprecated": false, @@ -9357,9 +9105,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9415,7 +9160,7 @@ "tags": [ "functions" ], - "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\r\n\r\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\r\n\r\nUse the \"command\" param to set the entrypoint used to execute your code.", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9426,7 +9171,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 297, + "weight": 299, "cookies": false, "type": "upload", "deprecated": false, @@ -9440,9 +9185,6 @@ "server" ], "packaging": true, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9521,7 +9263,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 299, + "weight": 301, "cookies": false, "type": "", "deprecated": false, @@ -9535,9 +9277,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9591,7 +9330,7 @@ }, "x-appwrite": { "method": "updateDeployment", - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -9605,9 +9344,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9656,7 +9392,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 300, + "weight": 302, "cookies": false, "type": "", "deprecated": false, @@ -9670,9 +9406,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9711,11 +9444,13 @@ "consumes": [ "application\/json" ], - "produces": [], + "produces": [ + "application\/json" + ], "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "204": { "description": "No content" @@ -9723,12 +9458,12 @@ }, "x-appwrite": { "method": "createBuild", - "weight": 301, + "weight": 303, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/create-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9737,9 +9472,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9797,7 +9529,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Build", @@ -9808,12 +9540,12 @@ }, "x-appwrite": { "method": "updateDeploymentBuild", - "weight": 302, + "weight": 304, "cookies": false, "type": "", "deprecated": false, "demo": "functions\/update-deployment-build.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-deployment-build.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -9822,9 +9554,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9880,7 +9609,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 294, + "weight": 296, "cookies": false, "type": "location", "deprecated": false, @@ -9895,9 +9624,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -9954,7 +9680,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 304, + "weight": 306, "cookies": false, "type": "", "deprecated": false, @@ -9970,9 +9696,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10022,7 +9745,7 @@ "summary": "Create execution", "operationId": "functionsCreateExecution", "consumes": [ - "multipart\/form-data" + "application\/json" ], "produces": [ "multipart\/form-data" @@ -10041,7 +9764,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 303, + "weight": 305, "cookies": false, "type": "", "deprecated": false, @@ -10057,9 +9780,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10083,65 +9803,59 @@ "in": "path" }, { - "name": "body", - "description": "HTTP body of execution. Default value is empty string.", - "required": false, - "type": "payload", - "default": "", - "in": "formData" - }, - { - "name": "async", - "description": "Execute code in the background. Default value is false.", - "required": false, - "type": "boolean", - "x-example": false, - "default": false, - "in": "formData" - }, - { - "name": "path", - "description": "HTTP path of execution. Path can include query params. Default value is \/", - "required": false, - "type": "string", - "x-example": "<PATH>", - "default": "\/", - "in": "formData" - }, - { - "name": "method", - "description": "HTTP method of execution. Default value is GET.", - "required": false, - "type": "string", - "x-example": "GET", - "enum": [ - "GET", - "POST", - "PUT", - "PATCH", - "DELETE", - "OPTIONS" - ], - "x-enum-name": "ExecutionMethod", - "x-enum-keys": [], - "default": "POST", - "in": "formData" - }, - { - "name": "headers", - "description": "HTTP headers of execution. Defaults to empty.", - "required": false, - "type": "object", - "default": [], - "x-example": "{}", - "in": "formData" - }, - { - "name": "scheduledAt", - "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", - "required": false, - "type": "string", - "in": "formData" + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } } ] } @@ -10170,7 +9884,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 305, + "weight": 307, "cookies": false, "type": "", "deprecated": false, @@ -10186,9 +9900,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -10231,7 +9942,7 @@ "tags": [ "functions" ], - "description": "Delete a function execution by its unique ID.\r\n", + "description": "Delete a function execution by its unique ID.\n", "responses": { "204": { "description": "No content" @@ -10239,7 +9950,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 306, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -10253,9 +9964,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10311,7 +10019,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 308, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -10325,9 +10033,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10373,7 +10078,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 307, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -10387,9 +10092,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10462,7 +10164,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 309, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -10476,9 +10178,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10532,7 +10231,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 310, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -10546,9 +10245,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10621,7 +10317,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 311, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -10635,9 +10331,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10693,7 +10386,7 @@ }, "x-appwrite": { "method": "query", - "weight": 329, + "weight": 331, "cookies": false, "type": "graphql", "deprecated": false, @@ -10709,9 +10402,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10771,7 +10461,7 @@ }, "x-appwrite": { "method": "mutation", - "weight": 328, + "weight": 330, "cookies": false, "type": "graphql", "deprecated": false, @@ -10787,9 +10477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10849,7 +10536,7 @@ }, "x-appwrite": { "method": "get", - "weight": 124, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -10863,9 +10550,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10903,7 +10587,7 @@ }, "x-appwrite": { "method": "getAntivirus", - "weight": 146, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -10917,9 +10601,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -10957,7 +10638,7 @@ }, "x-appwrite": { "method": "getCache", - "weight": 127, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -10971,9 +10652,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11011,7 +10689,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 133, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11025,9 +10703,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11074,7 +10749,7 @@ }, "x-appwrite": { "method": "getDB", - "weight": 126, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -11088,9 +10763,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11128,7 +10800,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 129, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -11142,9 +10814,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11182,7 +10851,7 @@ }, "x-appwrite": { "method": "getQueue", - "weight": 128, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11196,9 +10865,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11236,7 +10902,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 135, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11250,9 +10916,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11301,7 +10964,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 134, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11315,9 +10978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11366,7 +11026,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 136, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11380,9 +11040,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11440,7 +11097,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 137, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11454,9 +11111,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11494,7 +11148,7 @@ "tags": [ "health" ], - "description": "Returns the amount of failed jobs in a given queue.\r\n", + "description": "Returns the amount of failed jobs in a given queue.\n", "responses": { "200": { "description": "Health Queue", @@ -11505,7 +11159,7 @@ }, "x-appwrite": { "method": "getFailedJobs", - "weight": 147, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11519,9 +11173,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11594,7 +11245,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 141, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11608,9 +11259,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11659,7 +11307,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 132, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11673,9 +11321,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11724,7 +11369,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 138, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11738,9 +11383,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11789,7 +11431,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 139, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11803,9 +11445,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11854,7 +11493,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 140, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11868,9 +11507,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11919,7 +11555,7 @@ }, "x-appwrite": { "method": "getQueueUsage", - "weight": 142, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11933,9 +11569,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -11984,7 +11617,7 @@ }, "x-appwrite": { "method": "getQueueUsageDump", - "weight": 143, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11998,9 +11631,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12049,7 +11679,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 131, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12063,9 +11693,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12114,7 +11741,7 @@ }, "x-appwrite": { "method": "getStorage", - "weight": 145, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12128,9 +11755,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12168,7 +11792,7 @@ }, "x-appwrite": { "method": "getStorageLocal", - "weight": 144, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12182,9 +11806,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12222,7 +11843,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 130, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12236,9 +11857,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12265,7 +11883,7 @@ "tags": [ "locale" ], - "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\r\n\r\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", + "description": "Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https:\/\/db-ip.com))", "responses": { "200": { "description": "Locale", @@ -12276,7 +11894,7 @@ }, "x-appwrite": { "method": "get", - "weight": 116, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -12292,9 +11910,6 @@ "server" ], "packaging": false, - "offline-model": "\/localed", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12334,7 +11949,7 @@ }, "x-appwrite": { "method": "listCodes", - "weight": 117, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -12350,9 +11965,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/localeCode", - "offline-key": "current", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -12392,7 +12004,7 @@ }, "x-appwrite": { "method": "listContinents", - "weight": 121, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -12408,9 +12020,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/continents", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12450,7 +12059,7 @@ }, "x-appwrite": { "method": "listCountries", - "weight": 118, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -12466,9 +12075,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12508,7 +12114,7 @@ }, "x-appwrite": { "method": "listCountriesEU", - "weight": 119, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -12524,9 +12130,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/eu", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12566,7 +12169,7 @@ }, "x-appwrite": { "method": "listCountriesPhones", - "weight": 120, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -12582,9 +12185,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/countries\/phones", - "offline-key": "", - "offline-response-key": "countryCode", "auth": { "Project": [], "Session": [] @@ -12624,7 +12224,7 @@ }, "x-appwrite": { "method": "listCurrencies", - "weight": 122, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -12640,9 +12240,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/currencies", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12682,7 +12279,7 @@ }, "x-appwrite": { "method": "listLanguages", - "weight": 123, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12698,9 +12295,6 @@ "server" ], "packaging": false, - "offline-model": "\/locale\/languages", - "offline-key": "", - "offline-response-key": "code", "auth": { "Project": [], "Session": [] @@ -12740,7 +12334,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 388, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12755,9 +12349,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12818,7 +12409,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 385, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -12833,9 +12424,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -12968,7 +12556,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -12979,7 +12567,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 392, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -12994,9 +12582,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13137,7 +12722,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 387, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13152,9 +12737,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13182,13 +12764,13 @@ "title": { "type": "string", "description": "Title for push notification.", - "default": null, + "default": "", "x-example": "<TITLE>" }, "body": { "type": "string", "description": "Body for push notification.", - "default": null, + "default": "", "x-example": "<BODY>" }, "topics": { @@ -13220,7 +12802,7 @@ }, "data": { "type": "object", - "description": "Additional Data for push notification.", + "description": "Additional key-value pair data for push notification.", "default": {}, "x-example": "{}" }, @@ -13244,7 +12826,7 @@ }, "sound": { "type": "string", - "description": "Sound for push notification. Available only for Android and IOS Platform.", + "description": "Sound for push notification. Available only for Android and iOS Platform.", "default": "", "x-example": "<SOUND>" }, @@ -13261,10 +12843,10 @@ "x-example": "<TAG>" }, "badge": { - "type": "string", - "description": "Badge for push notification. Available only for IOS Platform.", - "default": "", - "x-example": "<BADGE>" + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null }, "draft": { "type": "boolean", @@ -13277,12 +12859,34 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } }, "required": [ - "messageId", - "title", - "body" + "messageId" ] } } @@ -13302,7 +12906,7 @@ "tags": [ "messaging" ], - "description": "Update a push notification by its unique ID.\r\n", + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13313,7 +12917,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 394, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13328,9 +12932,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13455,6 +13056,30 @@ "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", "default": null, "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] } } } @@ -13486,7 +13111,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 386, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13501,9 +13126,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13596,7 +13218,7 @@ "tags": [ "messaging" ], - "description": "Update an email message by its unique ID.\r\n", + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", "responses": { "200": { "description": "Message", @@ -13607,12 +13229,12 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 393, + "weight": 389, "cookies": false, "type": "", "deprecated": false, "demo": "messaging\/update-sms.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -13622,9 +13244,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13715,7 +13334,7 @@ "tags": [ "messaging" ], - "description": "Get a message by its unique ID.\r\n", + "description": "Get a message by its unique ID.\n", "responses": { "200": { "description": "Message", @@ -13726,7 +13345,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 391, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13741,9 +13360,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13772,9 +13388,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -13786,7 +13400,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 395, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13801,9 +13415,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13851,7 +13462,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 389, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13866,9 +13477,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -13928,7 +13536,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 390, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13943,9 +13551,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14005,7 +13610,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 360, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14020,9 +13625,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14083,7 +13685,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 359, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14098,9 +13700,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14201,7 +13800,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 372, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14216,9 +13815,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14317,7 +13913,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 358, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -14332,9 +13928,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14411,7 +14004,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 371, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14426,9 +14019,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14503,7 +14093,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 350, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -14518,9 +14108,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14633,7 +14220,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 363, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14648,9 +14235,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14761,7 +14345,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 353, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14776,9 +14360,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14867,7 +14448,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 366, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14882,9 +14463,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -14971,7 +14549,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 351, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14986,9 +14564,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15089,7 +14664,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 364, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15104,9 +14679,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15205,7 +14777,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 352, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15220,9 +14792,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15367,7 +14936,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 365, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15382,9 +14951,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15526,7 +15092,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 354, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15541,9 +15107,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15632,7 +15195,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 367, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15647,9 +15210,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15736,7 +15296,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 355, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15751,9 +15311,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15842,7 +15399,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 368, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15857,9 +15414,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -15946,7 +15500,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 356, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15961,9 +15515,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16052,7 +15603,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 369, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16067,9 +15618,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16156,7 +15704,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 357, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16171,9 +15719,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16262,7 +15807,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 370, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16277,9 +15822,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16355,7 +15897,7 @@ "tags": [ "messaging" ], - "description": "Get a provider by its unique ID.\r\n", + "description": "Get a provider by its unique ID.\n", "responses": { "200": { "description": "Provider", @@ -16366,7 +15908,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 362, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16381,9 +15923,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16412,9 +15951,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16426,7 +15963,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 373, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -16441,9 +15978,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16491,7 +16025,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 361, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -16506,9 +16040,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16568,7 +16099,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 382, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16583,9 +16114,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16645,7 +16173,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 375, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16660,9 +16188,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16721,7 +16246,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 374, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16736,9 +16261,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16803,7 +16325,7 @@ "tags": [ "messaging" ], - "description": "Get a topic by its unique ID.\r\n", + "description": "Get a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16814,7 +16336,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 377, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16829,9 +16351,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16866,7 +16385,7 @@ "tags": [ "messaging" ], - "description": "Update a topic by its unique ID.\r\n", + "description": "Update a topic by its unique ID.\n", "responses": { "200": { "description": "Topic", @@ -16877,7 +16396,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 378, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16892,9 +16411,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -16947,9 +16463,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -16961,7 +16475,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 379, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16976,9 +16490,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17026,7 +16537,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 376, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17041,9 +16552,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17103,7 +16611,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 381, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17118,9 +16626,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17187,7 +16692,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 380, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17204,9 +16709,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17270,7 +16772,7 @@ "tags": [ "messaging" ], - "description": "Get a subscriber by its unique ID.\r\n", + "description": "Get a subscriber by its unique ID.\n", "responses": { "200": { "description": "Subscriber", @@ -17281,7 +16783,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 383, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17296,9 +16798,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17335,9 +16834,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "messaging" ], @@ -17349,7 +16846,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 384, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17366,9 +16863,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "JWT": [] @@ -17426,7 +16920,7 @@ }, "x-appwrite": { "method": "listBuckets", - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -17440,9 +16934,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17501,7 +16992,7 @@ }, "x-appwrite": { "method": "createBucket", - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -17515,9 +17006,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17643,7 +17131,7 @@ }, "x-appwrite": { "method": "getBucket", - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -17657,9 +17145,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17705,7 +17190,7 @@ }, "x-appwrite": { "method": "updateBucket", - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -17719,9 +17204,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17841,7 +17323,7 @@ }, "x-appwrite": { "method": "deleteBucket", - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -17855,9 +17337,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -17905,7 +17384,7 @@ }, "x-appwrite": { "method": "listFiles", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -17921,9 +17400,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -17981,7 +17457,7 @@ "tags": [ "storage" ], - "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\r\n\r\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\r\n\r\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\r\n\r\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\r\n", + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", "responses": { "201": { "description": "File", @@ -17992,7 +17468,7 @@ }, "x-appwrite": { "method": "createFile", - "weight": 205, + "weight": 207, "cookies": false, "type": "upload", "deprecated": false, @@ -18008,9 +17484,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18088,7 +17561,7 @@ }, "x-appwrite": { "method": "getFile", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -18104,9 +17577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18162,7 +17632,7 @@ }, "x-appwrite": { "method": "updateFile", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -18178,9 +17648,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18255,7 +17722,7 @@ }, "x-appwrite": { "method": "deleteFile", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -18271,9 +17738,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18331,7 +17795,7 @@ }, "x-appwrite": { "method": "getFileDownload", - "weight": 209, + "weight": 211, "cookies": false, "type": "location", "deprecated": false, @@ -18347,9 +17811,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18407,7 +17868,7 @@ }, "x-appwrite": { "method": "getFilePreview", - "weight": 208, + "weight": 210, "cookies": false, "type": "location", "deprecated": false, @@ -18423,9 +17884,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18576,6 +18034,7 @@ "gif", "png", "webp", + "heic", "avif" ], "x-enum-name": "ImageFormat", @@ -18610,7 +18069,7 @@ }, "x-appwrite": { "method": "getFileView", - "weight": 210, + "weight": 212, "cookies": false, "type": "location", "deprecated": false, @@ -18626,9 +18085,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18686,7 +18142,7 @@ }, "x-appwrite": { "method": "list", - "weight": 217, + "weight": 219, "cookies": false, "type": "", "deprecated": false, @@ -18702,9 +18158,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18765,7 +18218,7 @@ }, "x-appwrite": { "method": "create", - "weight": 216, + "weight": 218, "cookies": false, "type": "", "deprecated": false, @@ -18781,9 +18234,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18861,7 +18311,7 @@ }, "x-appwrite": { "method": "get", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -18877,9 +18327,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -18927,7 +18374,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -18943,9 +18390,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams", - "offline-key": "{teamId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19006,7 +18450,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -19022,9 +18466,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19063,7 +18504,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.", + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Memberships List", @@ -19074,7 +18515,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -19090,9 +18531,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19150,7 +18588,7 @@ "tags": [ "teams" ], - "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\r\n\r\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\r\n\r\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \r\n\r\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\r\n", + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", "responses": { "201": { "description": "Membership", @@ -19161,7 +18599,7 @@ }, "x-appwrite": { "method": "createMembership", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -19177,9 +18615,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19269,7 +18704,7 @@ "tags": [ "teams" ], - "description": "Get a team member by the membership unique id. All team members have read access for this resource.", + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", "responses": { "200": { "description": "Membership", @@ -19280,7 +18715,7 @@ }, "x-appwrite": { "method": "getMembership", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -19296,9 +18731,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/memberships", - "offline-key": "{membershipId}", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19343,7 +18775,7 @@ "tags": [ "teams" ], - "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\r\n", + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", "responses": { "200": { "description": "Membership", @@ -19354,7 +18786,7 @@ }, "x-appwrite": { "method": "updateMembership", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -19370,9 +18802,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19444,7 +18873,7 @@ }, "x-appwrite": { "method": "deleteMembership", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -19460,9 +18889,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19509,7 +18935,7 @@ "tags": [ "teams" ], - "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\r\n\r\nIf the request is successful, a session for the user is automatically created.\r\n", + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", "responses": { "200": { "description": "Membership", @@ -19520,7 +18946,7 @@ }, "x-appwrite": { "method": "updateMembershipStatus", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -19535,9 +18961,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19619,7 +19042,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -19634,9 +19057,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19683,7 +19103,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -19698,9 +19118,6 @@ "server" ], "packaging": false, - "offline-model": "\/teams\/{teamId}\/prefs", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Session": [] @@ -19767,7 +19184,7 @@ }, "x-appwrite": { "method": "list", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -19781,9 +19198,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19842,7 +19256,7 @@ }, "x-appwrite": { "method": "create", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -19856,9 +19270,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -19940,7 +19351,7 @@ }, "x-appwrite": { "method": "createArgon2User", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -19954,9 +19365,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20034,7 +19442,7 @@ }, "x-appwrite": { "method": "createBcryptUser", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -20048,9 +19456,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20128,7 +19533,7 @@ }, "x-appwrite": { "method": "listIdentities", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -20142,9 +19547,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20200,7 +19602,7 @@ }, "x-appwrite": { "method": "deleteIdentity", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -20214,9 +19616,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20264,7 +19663,7 @@ }, "x-appwrite": { "method": "createMD5User", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -20278,9 +19677,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20358,7 +19754,7 @@ }, "x-appwrite": { "method": "createPHPassUser", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -20372,9 +19768,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20452,7 +19845,7 @@ }, "x-appwrite": { "method": "createScryptUser", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -20466,9 +19859,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20581,7 +19971,7 @@ }, "x-appwrite": { "method": "createScryptModifiedUser", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -20595,9 +19985,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20696,7 +20083,7 @@ }, "x-appwrite": { "method": "createSHAUser", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -20710,9 +20097,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20811,7 +20195,7 @@ }, "x-appwrite": { "method": "get", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -20825,9 +20209,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20868,7 +20249,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -20882,9 +20263,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -20932,7 +20310,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -20946,9 +20324,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21014,7 +20389,7 @@ }, "x-appwrite": { "method": "createJWT", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -21028,9 +20403,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21088,7 +20460,7 @@ "tags": [ "users" ], - "description": "Update the user labels by its unique ID. \r\n\r\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", "responses": { "200": { "description": "User", @@ -21099,7 +20471,7 @@ }, "x-appwrite": { "method": "updateLabels", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -21113,9 +20485,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21184,7 +20553,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -21198,9 +20567,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21260,7 +20626,7 @@ }, "x-appwrite": { "method": "listMemberships", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -21274,9 +20640,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21324,7 +20687,7 @@ }, "x-appwrite": { "method": "updateMfa", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -21338,9 +20701,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21389,24 +20749,19 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], "description": "Delete an authenticator app.", "responses": { - "200": { - "description": "User", - "schema": { - "$ref": "#\/definitions\/user" - } + "204": { + "description": "No content" } }, "x-appwrite": { "method": "deleteMfaAuthenticator", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -21420,9 +20775,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21483,7 +20835,7 @@ }, "x-appwrite": { "method": "listMfaFactors", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -21497,9 +20849,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21547,7 +20896,7 @@ }, "x-appwrite": { "method": "getMfaRecoveryCodes", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -21561,9 +20910,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21609,7 +20955,7 @@ }, "x-appwrite": { "method": "updateMfaRecoveryCodes", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -21623,9 +20969,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21671,7 +21014,7 @@ }, "x-appwrite": { "method": "createMfaRecoveryCodes", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -21685,9 +21028,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21735,7 +21075,7 @@ }, "x-appwrite": { "method": "updateName", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -21749,9 +21089,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21817,7 +21154,7 @@ }, "x-appwrite": { "method": "updatePassword", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -21831,9 +21168,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21899,7 +21233,7 @@ }, "x-appwrite": { "method": "updatePhone", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -21913,9 +21247,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -21981,7 +21312,7 @@ }, "x-appwrite": { "method": "getPrefs", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -21995,9 +21326,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22043,7 +21371,7 @@ }, "x-appwrite": { "method": "updatePrefs", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -22057,9 +21385,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22125,7 +21450,7 @@ }, "x-appwrite": { "method": "listSessions", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -22139,9 +21464,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22176,7 +21498,7 @@ "tags": [ "users" ], - "description": "Creates a session for a user. Returns an immediately usable session object.\r\n\r\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", "responses": { "201": { "description": "Session", @@ -22187,7 +21509,7 @@ }, "x-appwrite": { "method": "createSession", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -22201,9 +21523,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22244,7 +21563,7 @@ }, "x-appwrite": { "method": "deleteSessions", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -22258,9 +21577,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22303,7 +21619,7 @@ }, "x-appwrite": { "method": "deleteSession", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -22317,9 +21633,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22375,7 +21688,7 @@ }, "x-appwrite": { "method": "updateStatus", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -22389,9 +21702,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22457,7 +21767,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -22472,9 +21782,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22532,7 +21839,7 @@ }, "x-appwrite": { "method": "createTarget", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22547,9 +21854,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22648,7 +21952,7 @@ }, "x-appwrite": { "method": "getTarget", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22663,9 +21967,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22719,7 +22020,7 @@ }, "x-appwrite": { "method": "updateTarget", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -22734,9 +22035,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22800,9 +22098,7 @@ "consumes": [ "application\/json" ], - "produces": [ - "application\/json" - ], + "produces": [], "tags": [ "users" ], @@ -22814,7 +22110,7 @@ }, "x-appwrite": { "method": "deleteTarget", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -22829,9 +22125,6 @@ "console" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22876,7 +22169,7 @@ "tags": [ "users" ], - "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\r\n", + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", "responses": { "201": { "description": "Token", @@ -22887,7 +22180,7 @@ }, "x-appwrite": { "method": "createToken", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -22901,9 +22194,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -22972,7 +22262,7 @@ }, "x-appwrite": { "method": "updateEmailVerification", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -22986,9 +22276,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -23054,7 +22341,7 @@ }, "x-appwrite": { "method": "updatePhoneVerification", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23068,9 +22355,6 @@ "server" ], "packaging": false, - "offline-model": "", - "offline-key": "", - "offline-response-key": "$id", "auth": { "Project": [], "Key": [] @@ -26072,12 +25356,12 @@ }, "userName": { "type": "string", - "description": "User name.", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", "x-example": "John Doe" }, "userEmail": { "type": "string", - "description": "User email address.", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", "x-example": "john@appwrite.io" }, "teamId": { @@ -26107,7 +25391,7 @@ }, "mfa": { "type": "boolean", - "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise.", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", "x-example": false }, "roles": { @@ -26221,7 +25505,7 @@ }, "schedule": { "type": "string", - "description": "Function execution schedult in CRON format.", + "description": "Function execution schedule in CRON format.", "x-example": "5 4 * * *" }, "timeout": { @@ -26273,7 +25557,7 @@ "specification": { "type": "string", "description": "Machine specification for builds and executions.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -26591,7 +25875,7 @@ "format": "int32" }, "responseBody": { - "type": "payload", + "type": "string", "description": "HTTP response body. This will return empty unless execution is created as synchronous.", "x-example": "" }, @@ -27087,7 +26371,7 @@ "slug": { "type": "string", "description": "Size slug.", - "x-example": "s-0.5vcpu-512mb" + "x-example": "s-1vcpu-512mb" } }, "required": [ @@ -27538,7 +26822,7 @@ "name": { "type": "string", "description": "Target Name.", - "x-example": "Aegon apple token" + "x-example": "Apple iPhone 12" }, "userId": { "type": "string", @@ -27560,6 +26844,11 @@ "type": "string", "description": "The target identifier.", "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false } }, "required": [ @@ -27569,7 +26858,8 @@ "name", "userId", "providerType", - "identifier" + "identifier", + "expired" ] } }, diff --git a/app/config/storage/inputs.php b/app/config/storage/inputs.php index 3b83269261..4532279b31 100644 --- a/app/config/storage/inputs.php +++ b/app/config/storage/inputs.php @@ -1,8 +1,10 @@ <?php -return [ // Accepted inputs files - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', +return [ + // Accepted inputs files + "jpg" => "image/jpeg", + "jpeg" => "image/jpeg", + "gif" => "image/gif", + "png" => "image/png", + "heic" => "image/heic", ]; diff --git a/app/config/storage/mimes.php b/app/config/storage/mimes.php index df325b37e9..5c1752ca51 100644 --- a/app/config/storage/mimes.php +++ b/app/config/storage/mimes.php @@ -1,69 +1,71 @@ <?php return [ - 'image/jpeg', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - // 'image/heic', - 'image/avif', + "image/jpeg", + "image/jpeg", + "image/gif", + "image/png", + "image/webp", + "image/heic", + "image/heic-sequence", + "image/avif", // Video Files - 'video/mp4', - 'video/x-flv', - 'video/webm', - 'application/x-mpegURL', - 'video/MP2T', - 'video/3gpp', - 'video/quicktime', - 'video/x-msvideo', - 'video/x-ms-wmv', + "video/mp4", + "video/x-flv", + "video/webm", + "application/x-mpegURL", + "video/MP2T", + "video/3gpp", + "video/quicktime", + "video/x-msvideo", + "video/x-ms-wmv", // Audio Files - 'audio/basic', // au snd RFC 2046 - 'auido/L24', // Linear PCM RFC 3190 - 'audio/mid', // mid rmi - 'audio/mpeg', // mp3 RFC 3003 - 'audio/mp4', // mp4 audio - 'audio/x-aiff', // aif aifc aiff - 'audio/x-mpegurl', // m3u - 'audio/vnd.rn-realaudio', // ra ram - 'audio/ogg', // Ogg Vorbis RFC 5334 - 'audio/vorbis', // Vorbis RFC 5215 - 'audio/vnd.wav', // wav RFC 2361 - 'audio/aac', //AAC audio - 'audio/x-hx-aac-adts', // AAC audio + "audio/basic", // au snd RFC 2046 + "auido/L24", // Linear PCM RFC 3190 + "audio/mid", // mid rmi + "audio/mpeg", // mp3 RFC 3003 + "audio/mp4", // mp4 audio + "audio/x-aiff", // aif aifc aiff + "audio/x-mpegurl", // m3u + "audio/vnd.rn-realaudio", // ra ram + "audio/ogg", // Ogg Vorbis RFC 5334 + "audio/vorbis", // Vorbis RFC 5215 + "audio/vnd.wav", // wav RFC 2361 + "audio/x-wav", // php reads .wav as this - https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + "audio/aac", //AAC audio + "audio/x-hx-aac-adts", // AAC audio // Microsoft Word - 'application/msword', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'application/vnd.ms-word.document.macroEnabled.12', + "application/msword", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.openxmlformats-officedocument.wordprocessingml.template", + "application/vnd.ms-word.document.macroEnabled.12", // Microsoft Excel - 'application/vnd.ms-excel', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'application/vnd.ms-excel.template.macroEnabled.12', - 'application/vnd.ms-excel.addin.macroEnabled.12', - 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + "application/vnd.ms-excel", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", + "application/vnd.openxmlformats-officedocument.spreadsheetml.template", + "application/vnd.ms-excel.sheet.macroEnabled.12", + "application/vnd.ms-excel.template.macroEnabled.12", + "application/vnd.ms-excel.addin.macroEnabled.12", + "application/vnd.ms-excel.sheet.binary.macroEnabled.12", // Microsoft Power Point - 'application/vnd.ms-powerpoint', - 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'application/vnd.ms-powerpoint.template.macroEnabled.12', - 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + "application/vnd.ms-powerpoint", + "application/vnd.openxmlformats-officedocument.presentationml.presentation", + "application/vnd.openxmlformats-officedocument.presentationml.template", + "application/vnd.openxmlformats-officedocument.presentationml.slideshow", + "application/vnd.ms-powerpoint.addin.macroEnabled.12", + "application/vnd.ms-powerpoint.presentation.macroEnabled.12", + "application/vnd.ms-powerpoint.template.macroEnabled.12", + "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", // Microsoft Access - 'application/vnd.ms-access', + "application/vnd.ms-access", // Adobe PDF - 'application/pdf', + "application/pdf", ]; diff --git a/app/config/storage/outputs.php b/app/config/storage/outputs.php index cde2a9f38a..49548dda50 100644 --- a/app/config/storage/outputs.php +++ b/app/config/storage/outputs.php @@ -1,12 +1,12 @@ <?php -return [ // Accepted outputs files - 'jpg' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'webp' => 'image/webp', - // 'heic' => 'image/heic', - // 'heics' => 'image/heic', - 'avif' => 'image/avif' +return [ + // Accepted outputs files + "jpg" => "image/jpeg", + "jpeg" => "image/jpeg", + "gif" => "image/gif", + "png" => "image/png", + "webp" => "image/webp", + "heic" => "image/heic", + "avif" => "image/avif", ]; diff --git a/app/config/variables.php b/app/config/variables.php index 113fbae335..57810525c7 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -268,6 +268,24 @@ return [ 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_COMPRESSION_ENABLED', + 'description' => 'This option allows you to enable or disable the response compression for the Appwrite API. It\'s enabled by default with value "enabled", and to disable it, pass value "disabled".', + 'introduction' => '1.6.0', + 'default' => 'enabled', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_COMPRESSION_MIN_SIZE_BYTES', + 'description' => 'This option allows you to set the minimum size in bytes for the response compression to be applied. The default value is 1024 bytes.', + 'introduction' => '1.6.0', + 'default' => 1024, + 'required' => false, + 'question' => '', + 'filter' => '' + ] ], ], [ diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index cb71818df3..bd9562110f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -17,17 +17,25 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Mail; use Appwrite\Event\Messaging; +use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\URL\URL as URLParser; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; +use libphonenumber\PhoneNumberUtil; use MaxMind\Db\Reader; +use Utopia\Abuse\Abuse; use Utopia\App; use Utopia\Audit\Audit as EventAudit; use Utopia\Config\Config; @@ -274,19 +282,24 @@ $createSession = function (string $userId, string $secret, Request $request, Res App::post('/v1/account') ->desc('Create account') ->groups(['api', 'account', 'auth']) - ->label('event', 'users.[userId].create') ->label('scope', 'sessions.write') - ->label('auth.type', 'emailPassword') + ->label('auth.type', 'email-password') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/account/create.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'create', + description: '/docs/references/account/create.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') @@ -297,9 +310,8 @@ App::post('/v1/account') ->inject('user') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { + ->action(function (string $userId, string $email, string $password, string $name, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Hooks $hooks) { $email = \strtolower($email); if ('console' === $project->getId()) { @@ -332,7 +344,7 @@ App::post('/v1/account') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ } @@ -395,7 +407,7 @@ App::post('/v1/account') $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$email]), ]); - if ($existingTarget) { + if (!$existingTarget->isEmpty()) { $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } @@ -409,8 +421,6 @@ App::post('/v1/account') Authorization::setRole(Role::user($user->getId())->toString()); Authorization::setRole(Role::users()->toString()); - $queueForEvents->setParam('userId', $user->getId()); - $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($user, Response::MODEL_ACCOUNT); @@ -420,15 +430,19 @@ App::get('/v1/account') ->desc('Get account') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/account/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'get', + description: '/docs/references/account/get.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -442,16 +456,22 @@ App::get('/v1/account') App::delete('/v1/account') ->desc('Delete account') ->groups(['api', 'account']) - ->label('event', 'users.[userId].delete') ->label('scope', 'account') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/account/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'delete', + description: '/docs/references/account/delete.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->inject('user') ->inject('project') ->inject('response') @@ -491,14 +511,19 @@ App::get('/v1/account/sessions') ->desc('List sessions') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/account/list-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) - ->label('sdk.offline.model', '/account/sessions') + ->label('sdk', new Method( + namespace: 'account', + name: 'listSessions', + description: '/docs/references/account/list-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ], + contentType: ContentType::JSON, + )) ->inject('response') ->inject('user') ->inject('locale') @@ -535,12 +560,19 @@ App::delete('/v1/account/sessions') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/account/delete-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSessions', + description: '/docs/references/account/delete-sessions.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->label('abuse-limit', 100) ->inject('request') ->inject('response') @@ -597,15 +629,19 @@ App::get('/v1/account/sessions/:sessionId') ->desc('Get session') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getSession') - ->label('sdk.description', '/docs/references/account/get-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) - ->label('sdk.offline.model', '/account/sessions') - ->label('sdk.offline.key', '{sessionId}') + ->label('sdk', new Method( + namespace: 'account', + name: 'getSession', + description: '/docs/references/account/get-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to get the current device session.') ->inject('response') ->inject('user') @@ -646,12 +682,19 @@ App::delete('/v1/account/sessions/:sessionId') ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/account/delete-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteSession', + description: '/docs/references/account/delete-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->label('abuse-limit', 100) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to delete the current device session.') ->inject('requestTimestamp') @@ -727,13 +770,19 @@ App::patch('/v1/account/sessions/:sessionId') ->label('audits.event', 'session.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateSession') - ->label('sdk.description', '/docs/references/account/update-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateSession', + description: '/docs/references/account/update-session.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->param('sessionId', '', new UID(), 'Session ID. Use the string \'current\' to update the current device session.') ->inject('response') @@ -801,17 +850,23 @@ App::post('/v1/account/sessions/email') ->groups(['api', 'account', 'auth', 'session']) ->label('event', 'users.[userId].sessions.[sessionId].create') ->label('scope', 'sessions.write') - ->label('auth.type', 'emailPassword') + ->label('auth.type', 'email-password') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailPasswordSession') - ->label('sdk.description', '/docs/references/account/create-session-email-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailPasswordSession', + description: '/docs/references/account/create-session-email-password.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', new Email(), 'User email.') @@ -834,7 +889,7 @@ App::post('/v1/account/sessions/email') Query::equal('email', [$email]), ]); - if (!$profile || empty($profile->getAttribute('passwordUpdate')) || !Auth::passwordVerify($password, $profile->getAttribute('password'), $profile->getAttribute('hash'), $profile->getAttribute('hashOptions'))) { + if ($profile->isEmpty() || empty($profile->getAttribute('passwordUpdate')) || !Auth::passwordVerify($password, $profile->getAttribute('password'), $profile->getAttribute('hash'), $profile->getAttribute('hashOptions'))) { throw new Exception(Exception::USER_INVALID_CREDENTIALS); } @@ -939,13 +994,19 @@ App::post('/v1/account/sessions/anonymous') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createAnonymousSession') - ->label('sdk.description', '/docs/references/account/create-session-anonymous.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createAnonymousSession', + description: '/docs/references/account/create-session-anonymous.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->inject('request') @@ -1076,13 +1137,19 @@ App::post('/v1/account/sessions/token') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'createSession', + description: '/docs/references/account/create-session.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -1103,14 +1170,21 @@ App::get('/v1/account/sessions/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.hide', [APP_PLATFORM_SERVER]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Session') - ->label('sdk.description', '/docs/references/account/create-session-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Session', + description: '/docs/references/account/create-session-oauth2.md', + type: MethodType::WEBAUTH, + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::HTML, + hide: [APP_PLATFORM_SERVER], + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1374,7 +1448,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Query::equal('providerEmail', [$email]), Query::notEqual('userInternalId', $user->getInternalId()), ]); - if (!empty($identityWithMatchingEmail)) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_ALREADY_EXISTS); } @@ -1405,7 +1479,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Query::equal('provider', [$provider]), Query::equal('providerUid', [$oauth2ID]), ]); - if ($session !== false && !$session->isEmpty()) { + if (!$session->isEmpty()) { $user->setAttributes($dbForProject->getDocument('users', $session->getAttribute('userId'))->getArrayCopy()); } } @@ -1423,7 +1497,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $userWithEmail = $dbForProject->findOne('users', [ Query::equal('email', [$email]), ]); - if ($userWithEmail !== false && !$userWithEmail->isEmpty()) { + if (!$userWithEmail->isEmpty()) { $user->setAttributes($userWithEmail->getArrayCopy()); } @@ -1434,7 +1508,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Query::equal('providerUid', [$oauth2ID]), ]); - if ($identity !== false && !$identity->isEmpty()) { + if (!$identity->isEmpty()) { $user = $dbForProject->getDocument('users', $identity->getAttribute('userId')); } } @@ -1454,7 +1528,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ } @@ -1499,6 +1573,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'providerType' => MESSAGE_TYPE_EMAIL, 'identifier' => $email, ])); + } catch (Duplicate) { $failureRedirect(Exception::USER_ALREADY_EXISTS); } @@ -1517,7 +1592,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Query::equal('provider', [$provider]), Query::equal('providerUid', [$oauth2ID]), ]); - if ($identity === false || $identity->isEmpty()) { + if ($identity->isEmpty()) { // Before creating the identity, check if the email is already associated with another user $userId = $user->getId(); @@ -1692,13 +1767,20 @@ App::get('/v1/account/tokens/oauth2/:provider') ->groups(['api', 'account']) ->label('error', __DIR__ . '/../../views/general/error.phtml') ->label('scope', 'sessions.write') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createOAuth2Token') - ->label('sdk.description', '/docs/references/account/create-token-oauth2.md') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') + ->label('sdk', new Method( + namespace: 'account', + name: 'createOAuth2Token', + description: '/docs/references/account/create-token-oauth2.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, + )) ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') @@ -1765,13 +1847,19 @@ App::post('/v1/account/tokens/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMagicURLToken') - ->label('sdk.description', '/docs/references/account/create-token-magic-url.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMagicURLToken', + description: '/docs/references/account/create-token-magic-url.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 60) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -1801,7 +1889,7 @@ App::post('/v1/account/tokens/magic-url') $isAppUser = Auth::isAppUser($roles); $result = $dbForProject->findOne('users', [Query::equal('email', [$email])]); - if ($result !== false && !$result->isEmpty()) { + if (!$result->isEmpty()) { $user->setAttributes($result->getArrayCopy()); } else { $limit = $project->getAttribute('auths', [])['limit'] ?? 0; @@ -1818,7 +1906,7 @@ App::post('/v1/account/tokens/magic-url') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); } @@ -2008,13 +2096,19 @@ App::post('/v1/account/tokens/email') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createEmailToken') - ->label('sdk.description', '/docs/references/account/create-token-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createEmailToken', + description: '/docs/references/account/create-token-email.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2042,7 +2136,7 @@ App::post('/v1/account/tokens/email') $isAppUser = Auth::isAppUser($roles); $result = $dbForProject->findOne('users', [Query::equal('email', [$email])]); - if ($result !== false && !$result->isEmpty()) { + if (!$result->isEmpty()) { $user->setAttributes($result->getArrayCopy()); } else { $limit = $project->getAttribute('auths', [])['limit'] ?? 0; @@ -2059,7 +2153,7 @@ App::post('/v1/account/tokens/email') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ } @@ -2237,14 +2331,20 @@ App::put('/v1/account/sessions/magic-url') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMagicURLSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMagicURLSession', + description: '/docs/references/account/create-session.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2268,14 +2368,20 @@ App::put('/v1/account/sessions/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.deprecated', true) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneSession') - ->label('sdk.description', '/docs/references/account/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneSession', + description: '/docs/references/account/create-session.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON, + deprecated: true, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'ip:{ip},userId:{param-userId}') ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2300,13 +2406,19 @@ App::post('/v1/account/tokens/phone') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneToken') - ->label('sdk.description', '/docs/references/account/create-token-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneToken', + description: '/docs/references/account/create-token-phone.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},phone:{param-phone}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') @@ -2319,7 +2431,10 @@ App::post('/v1/account/tokens/phone') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('locale') - ->action(function (string $userId, string $phone, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Locale $locale) { + ->inject('timelimit') + ->inject('queueForUsage') + ->inject('plan') + ->action(function (string $userId, string $phone, Request $request, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Locale $locale, callable $timelimit, Usage $queueForUsage, array $plan) { if (empty(System::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured'); } @@ -2329,7 +2444,7 @@ App::post('/v1/account/tokens/phone') $isAppUser = Auth::isAppUser($roles); $result = $dbForProject->findOne('users', [Query::equal('phone', [$phone])]); - if ($result !== false && !$result->isEmpty()) { + if (!$result->isEmpty()) { $user->setAttributes($result->getArrayCopy()); } else { $limit = $project->getAttribute('auths', [])['limit'] ?? 0; @@ -2386,7 +2501,7 @@ App::post('/v1/account/tokens/phone') $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$phone]), ]); - $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget]); + $user->setAttribute('targets', [...$user->getAttribute('targets', []), $existingTarget->isEmpty() ? false : $existingTarget]); } $dbForProject->purgeCachedDocument('users', $user->getId()); } @@ -2456,6 +2571,27 @@ App::post('/v1/account/tokens/phone') ->setMessage($messageDoc) ->setRecipients([$phone]) ->setProviderType(MESSAGE_TYPE_SMS); + + if (isset($plan['authPhone'])) { + $timelimit = $timelimit('organization:{organizationId}', $plan['authPhone'], 30 * 24 * 60 * 60); // 30 days + $timelimit + ->setParam('{organizationId}', $project->getAttribute('teamId')); + + $abuse = new Abuse($timelimit); + if ($abuse->check() && System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') === 'enabled') { + $helper = PhoneNumberUtil::getInstance(); + $countryCode = $helper->parse($phone)->getCountryCode(); + + if (!empty($countryCode)) { + $queueForUsage + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); + } + } + $queueForUsage + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) + ->setProject($project) + ->trigger(); + } } // Set to unhashed secret for events and server responses @@ -2478,13 +2614,19 @@ App::post('/v1/account/jwts') ->groups(['api', 'account', 'auth']) ->label('scope', 'account') ->label('auth.type', 'jwt') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/account/create-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'account', + name: 'createJWT', + description: '/docs/references/account/create-jwt.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 100) ->label('abuse-key', 'url:{url},userId:{userId}') ->inject('response') @@ -2520,15 +2662,19 @@ App::get('/v1/account/prefs') ->desc('Get account preferences') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/account/get-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getPrefs', + description: '/docs/references/account/get-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -2542,13 +2688,19 @@ App::get('/v1/account/logs') ->desc('List logs') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/account/list-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'account', + name: 'listLogs', + description: '/docs/references/account/list-logs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON, + )) ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') ->inject('user') @@ -2610,15 +2762,19 @@ App::patch('/v1/account/name') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/account/update-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateName', + description: '/docs/references/account/update-name.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.') ->inject('requestTimestamp') ->inject('response') @@ -2644,15 +2800,19 @@ App::patch('/v1/account/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/account/update-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePassword', + description: '/docs/references/account/update-password.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, $project->getAttribute('auths', [])['passwordDictionary'] ?? false), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->param('oldPassword', '', new Password(), 'Current user password. Must be at least 8 chars.', true) @@ -2713,15 +2873,19 @@ App::patch('/v1/account/email') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/account/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateEmail', + description: '/docs/references/account/update-email.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2753,7 +2917,7 @@ App::patch('/v1/account/email') Query::equal('providerEmail', [$email]), Query::notEqual('userInternalId', $user->getInternalId()), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ } @@ -2774,7 +2938,7 @@ App::patch('/v1/account/email') Query::equal('identifier', [$email]), ])); - if ($target instanceof Document && !$target->isEmpty()) { + if (!$target->isEmpty()) { throw new Exception(Exception::USER_TARGET_ALREADY_EXISTS); } @@ -2805,15 +2969,19 @@ App::patch('/v1/account/phone') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/account/update-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhone', + description: '/docs/references/account/update-phone.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.') ->param('password', '', new Password(), 'User password. Must be at least 8 chars.') ->inject('requestTimestamp') @@ -2840,7 +3008,7 @@ App::patch('/v1/account/phone') Query::equal('identifier', [$phone]), ])); - if ($target instanceof Document && !$target->isEmpty()) { + if (!$target->isEmpty()) { throw new Exception(Exception::USER_TARGET_ALREADY_EXISTS); } @@ -2886,15 +3054,19 @@ App::patch('/v1/account/prefs') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/account/update-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account/prefs') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePrefs', + description: '/docs/references/account/update-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('prefs', [], new Assoc(), 'Prefs key-value JSON object.') ->inject('requestTimestamp') ->inject('response') @@ -2919,13 +3091,19 @@ App::patch('/v1/account/status') ->label('scope', 'account') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/account/update-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateStatus', + description: '/docs/references/account/update-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON, + )) ->inject('requestTimestamp') ->inject('request') ->inject('response') @@ -2963,13 +3141,19 @@ App::post('/v1/account/recovery') ->label('audits.event', 'recovery.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createRecovery') - ->label('sdk.description', '/docs/references/account/create-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createRecovery', + description: '/docs/references/account/create-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') @@ -2999,7 +3183,7 @@ App::post('/v1/account/recovery') Query::equal('email', [$email]), ]); - if (!$profile) { + if ($profile->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); } @@ -3143,13 +3327,19 @@ App::put('/v1/account/recovery') ->label('audits.event', 'recovery.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateRecovery') - ->label('sdk.description', '/docs/references/account/update-recovery.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateRecovery', + description: '/docs/references/account/update-recovery.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3227,13 +3417,19 @@ App::post('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createVerification') - ->label('sdk.description', '/docs/references/account/create-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createVerification', + description: '/docs/references/account/create-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('url', '', fn ($clients) => new Host($clients), 'URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add built-in confirm page @@ -3392,13 +3588,19 @@ App::put('/v1/account/verification') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateVerification') - ->label('sdk.description', '/docs/references/account/update-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateVerification', + description: '/docs/references/account/update-email-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3452,13 +3654,19 @@ App::post('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].create') ->label('audits.event', 'verification.create') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPhoneVerification') - ->label('sdk.description', '/docs/references/account/create-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPhoneVerification', + description: '/docs/references/account/create-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},userId:{userId}', 'url:{url},ip:{ip}']) ->inject('request') @@ -3469,7 +3677,10 @@ App::post('/v1/account/verification/phone') ->inject('queueForMessaging') ->inject('project') ->inject('locale') - ->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Document $project, Locale $locale) { + ->inject('timelimit') + ->inject('queueForUsage') + ->inject('plan') + ->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Event $queueForEvents, Messaging $queueForMessaging, Document $project, Locale $locale, callable $timelimit, Usage $queueForUsage, array $plan) { if (empty(System::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured'); } @@ -3552,6 +3763,27 @@ App::post('/v1/account/verification/phone') ->setMessage($messageDoc) ->setRecipients([$user->getAttribute('phone')]) ->setProviderType(MESSAGE_TYPE_SMS); + + if (isset($plan['authPhone'])) { + $timelimit = $timelimit('organization:{organizationId}', $plan['authPhone'], 30 * 24 * 60 * 60); // 30 days + $timelimit + ->setParam('{organizationId}', $project->getAttribute('teamId')); + + $abuse = new Abuse($timelimit); + if ($abuse->check() && System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') === 'enabled') { + $helper = PhoneNumberUtil::getInstance(); + $countryCode = $helper->parse($phone)->getCountryCode(); + + if (!empty($countryCode)) { + $queueForUsage + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); + } + } + $queueForUsage + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) + ->setProject($project) + ->trigger(); + } } // Set to unhashed secret for events and server responses @@ -3579,13 +3811,19 @@ App::put('/v1/account/verification/phone') ->label('event', 'users.[userId].verification.[tokenId].update') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/account/update-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePhoneVerification', + description: '/docs/references/account/update-phone-verification.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'userId:{param-userId}') ->param('userId', '', new UID(), 'User ID.') @@ -3638,15 +3876,19 @@ App::patch('/v1/account/mfa') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMFA') - ->label('sdk.description', '/docs/references/account/update-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMFA', + description: '/docs/references/account/update-mfa.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('requestTimestamp') ->inject('response') @@ -3687,15 +3929,19 @@ App::get('/v1/account/mfa/factors') ->desc('List factors') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/account/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'listMfaFactors', + description: '/docs/references/account/list-mfa-factors.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3723,15 +3969,19 @@ App::post('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/create-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_TYPE) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaAuthenticator', + description: '/docs/references/account/create-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_TYPE, + ) + ], + contentType: ContentType::JSON + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') @@ -3795,15 +4045,19 @@ App::put('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/update-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaAuthenticator', + description: '/docs/references/account/update-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ], + contentType: ContentType::JSON + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->param('otp', '', new Text(256), 'Valid verification token.') ->inject('response') @@ -3860,15 +4114,19 @@ App::post('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaRecoveryCodes', + description: '/docs/references/account/create-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('user') ->inject('dbForProject') @@ -3902,15 +4160,19 @@ App::patch('/v1/account/mfa/recovery-codes') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/account/update-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + )) ->inject('dbForProject') ->inject('response') ->inject('user') @@ -3939,15 +4201,19 @@ App::get('/v1/account/mfa/recovery-codes') ->desc('Get MFA recovery codes') ->groups(['api', 'account', 'mfaProtected']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/account/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) - ->label('sdk.offline.model', '/account') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'account', + name: 'getMfaRecoveryCodes', + description: '/docs/references/account/get-mfa-recovery-codes.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('user') ->action(function (Response $response, Document $user) { @@ -3973,12 +4239,19 @@ App::delete('/v1/account/mfa/authenticators/:type') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/account/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteMfaAuthenticator', + description: '/docs/references/account/delete-mfa-authenticator.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') ->inject('user') @@ -4011,13 +4284,19 @@ App::post('/v1/account/mfa/challenge') ->label('audits.event', 'challenge.create') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', []) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createMfaChallenge') - ->label('sdk.description', '/docs/references/account/create-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_CHALLENGE) + ->label('sdk', new Method( + namespace: 'account', + name: 'createMfaChallenge', + description: '/docs/references/account/create-mfa-challenge.md', + auth: [], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_CHALLENGE, + ) + ], + contentType: ContentType::JSON, + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP, Type::RECOVERY_CODE]), 'Factor used for verification. Must be one of following: `' . Type::EMAIL . '`, `' . Type::PHONE . '`, `' . Type::TOTP . '`, `' . Type::RECOVERY_CODE . '`.') @@ -4030,7 +4309,10 @@ App::post('/v1/account/mfa/challenge') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('queueForMails') - ->action(function (string $factor, Response $response, Database $dbForProject, Document $user, Locale $locale, Document $project, Request $request, Event $queueForEvents, Messaging $queueForMessaging, Mail $queueForMails) { + ->inject('timelimit') + ->inject('queueForUsage') + ->inject('plan') + ->action(function (string $factor, Response $response, Database $dbForProject, Document $user, Locale $locale, Document $project, Request $request, Event $queueForEvents, Messaging $queueForMessaging, Mail $queueForMails, callable $timelimit, Usage $queueForUsage, array $plan) { $expire = DateTime::addSeconds(new \DateTime(), Auth::TOKEN_EXPIRATION_CONFIRM); $code = Auth::codeGenerator(); @@ -4078,6 +4360,7 @@ App::post('/v1/account/mfa/challenge') $message = $message->render(); + $phone = $user->getAttribute('phone'); $queueForMessaging ->setType(MESSAGE_SEND_TYPE_INTERNAL) ->setMessage(new Document([ @@ -4086,8 +4369,29 @@ App::post('/v1/account/mfa/challenge') 'content' => $code, ], ])) - ->setRecipients([$user->getAttribute('phone')]) + ->setRecipients([$phone]) ->setProviderType(MESSAGE_TYPE_SMS); + + if (isset($plan['authPhone'])) { + $timelimit = $timelimit('organization:{organizationId}', $plan['authPhone'], 30 * 24 * 60 * 60); // 30 days + $timelimit + ->setParam('{organizationId}', $project->getAttribute('teamId')); + + $abuse = new Abuse($timelimit); + if ($abuse->check() && System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') === 'enabled') { + $helper = PhoneNumberUtil::getInstance(); + $countryCode = $helper->parse($phone)->getCountryCode(); + + if (!empty($countryCode)) { + $queueForUsage + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); + } + } + $queueForUsage + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) + ->setProject($project) + ->trigger(); + } break; case Type::EMAIL: if (empty(System::getEnv('_APP_SMTP_HOST'))) { @@ -4199,12 +4503,19 @@ App::put('/v1/account/mfa/challenge') ->label('audits.event', 'challenges.update') ->label('audits.resource', 'user/{response.userId}') ->label('audits.userId', '{response.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateMfaChallenge') - ->label('sdk.description', '/docs/references/account/update-mfa-challenge.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'account', + name: 'updateMfaChallenge', + description: '/docs/references/account/update-mfa-challenge.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION, + ) + ], + contentType: ContentType::JSON + )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},challengeId:{param-challengeId}') ->param('challengeId', '', new Text(256), 'ID of the challenge.') @@ -4285,12 +4596,19 @@ App::post('/v1/account/targets/push') ->label('audits.event', 'target.create') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'createPushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'createPushTarget', + description: '/docs/references/account/create-push-target.md', + auth: [AuthType::SESSION], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ], + contentType: ContentType::JSON + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->param('providerId', '', new UID(), 'Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.', true) @@ -4315,7 +4633,7 @@ App::post('/v1/account/targets/push') $device = $detector->getDevice(); - $sessionId = Auth::sessionVerify($user->getAttribute('sessions'), Auth::$secret); + $sessionId = Auth::sessionVerify($user->getAttribute('sessions', []), Auth::$secret); $session = $dbForProject->getDocument('sessions', $sessionId); try { @@ -4358,12 +4676,19 @@ App::put('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.update') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].update') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'updatePushTarget', + description: '/docs/references/account/update-push-target.md', + auth: [AuthType::SESSION], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ], + contentType: ContentType::JSON + )) ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)') ->inject('queueForEvents') @@ -4384,7 +4709,9 @@ App::put('/v1/account/targets/:targetId/push') } if ($identifier) { - $target->setAttribute('identifier', $identifier); + $target + ->setAttribute('identifier', $identifier) + ->setAttribute('expired', false); } $detector = new Detector($request->getUserAgent()); @@ -4413,12 +4740,19 @@ App::delete('/v1/account/targets/:targetId/push') ->label('audits.event', 'target.delete') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].delete') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deletePushTarget') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'account', + name: 'deletePushTarget', + description: '/docs/references/account/delete-push-target.md', + auth: [AuthType::SESSION], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') ->inject('queueForDeletes') @@ -4456,14 +4790,19 @@ App::get('/v1/account/identities') ->desc('List identities') ->groups(['api', 'account']) ->label('scope', 'account') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/account/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) - ->label('sdk.offline.model', '/account/identities') + ->label('sdk', new Method( + namespace: 'account', + name: 'listIdentities', + description: '/docs/references/account/list-identities.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('user') @@ -4522,12 +4861,19 @@ App::delete('/v1/account/identities/:identityId') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') ->label('audits.userId', '{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'account') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/account/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'account', + name: 'deleteIdentity', + description: '/docs/references/account/delete-identity.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index fcff3e4179..94a3fb374d 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -1,6 +1,11 @@ <?php use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\URL\URL as URLParse; use Appwrite\Utopia\Response; use chillerlan\QRCode\QRCode; @@ -55,15 +60,15 @@ $avatarCallback = function (string $type, string $code, int $width, int $height, $output = (empty($output)) ? $type : $output; $data = $image->output($output, $quality); $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/png') ->file($data); unset($image); }; -$getUserGitHub = function (string $userId, Document $project, Database $dbForProject, Database $dbForConsole, ?Logger $logger) { +$getUserGitHub = function (string $userId, Document $project, Database $dbForProject, Database $dbForPlatform, ?Logger $logger) { try { - $user = Authorization::skip(fn () => $dbForConsole->getDocument('users', $userId)); + $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); $sessions = $user->getAttribute('sessions', []); @@ -122,7 +127,7 @@ $getUserGitHub = function (string $userId, Document $project, Database $dbForPro do { $previousAccessToken = $gitHubSession->getAttribute('providerAccessToken'); - $user = Authorization::skip(fn () => $dbForConsole->getDocument('users', $userId)); + $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); $sessions = $user->getAttribute('sessions', []); $gitHubSession = new Document(); @@ -164,13 +169,20 @@ App::get('/v1/avatars/credit-cards/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/credit-card') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getCreditCard') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-credit-card.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getCreditCard', + description: '/docs/references/avatars/get-credit-card.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE_PNG + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-credit-cards'))), 'Credit Card Code. Possible values: ' . \implode(', ', \array_keys(Config::getParam('avatar-credit-cards'))) . '.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -184,13 +196,20 @@ App::get('/v1/avatars/browsers/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/browser') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getBrowser') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-browser.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getBrowser', + description: '/docs/references/avatars/get-browser.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE_PNG + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-browsers'))), 'Browser Code.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -204,13 +223,20 @@ App::get('/v1/avatars/flags/:code') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/flag') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFlag') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-flag.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFlag', + description: '/docs/references/avatars/get-flag.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE_PNG + )) ->param('code', '', new WhiteList(\array_keys(Config::getParam('avatar-flags'))), 'Country Code. ISO Alpha-2 country code format.') ->param('width', 100, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 100, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -224,13 +250,20 @@ App::get('/v1/avatars/image') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/image') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getImage') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-image.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getImage', + description: '/docs/references/avatars/get-image.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE + )) ->param('url', '', new URL(['http', 'https']), 'Image URL which you want to crop.') ->param('width', 400, new Range(0, 2000), 'Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.', true) ->param('height', 400, new Range(0, 2000), 'Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.', true) @@ -275,7 +308,7 @@ App::get('/v1/avatars/image') $data = $image->output($output, $quality); $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/png') ->file($data); unset($image); @@ -287,13 +320,20 @@ App::get('/v1/avatars/favicon') ->label('scope', 'avatars.read') ->label('cache', true) ->label('cache.resource', 'avatar/favicon') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getFavicon') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-favicon.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getFavicon', + description: '/docs/references/avatars/get-favicon.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE + )) ->param('url', '', new URL(['http', 'https']), 'Website URL which you want to fetch the favicon from.') ->inject('response') ->action(function (string $url, Response $response) { @@ -409,7 +449,7 @@ App::get('/v1/avatars/favicon') throw new Exception(Exception::AVATAR_ICON_NOT_FOUND, 'Favicon not found'); } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/x-icon') ->file($data); } @@ -420,7 +460,7 @@ App::get('/v1/avatars/favicon') $data = $image->output($output, $quality); $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType('image/png') ->file($data); unset($image); @@ -430,13 +470,20 @@ App::get('/v1/avatars/qr') ->desc('Get QR code') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getQR') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-qr.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getQR', + description: '/docs/references/avatars/get-qr.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE_PNG + )) ->param('text', '', new Text(512), 'Plain text to be converted to QR code image.') ->param('size', 400, new Range(1, 1000), 'QR code size. Pass an integer between 1 to 1000. Defaults to 400.', true) ->param('margin', 1, new Range(0, 10), 'Margin from edge. Pass an integer between 0 to 10. Defaults to 1.', true) @@ -461,7 +508,7 @@ App::get('/v1/avatars/qr') $image->crop((int) $size, (int) $size); $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->setContentType('image/png') ->send($image->output('png', 9)); }); @@ -471,13 +518,20 @@ App::get('/v1/avatars/initials') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache.resource', 'avatar/initials') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'avatars') - ->label('sdk.method', 'getInitials') - ->label('sdk.methodType', 'location') - ->label('sdk.description', '/docs/references/avatars/get-initials.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE_PNG) + ->label('sdk', new Method( + namespace: 'avatars', + name: 'getInitials', + description: '/docs/references/avatars/get-initials.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + type: MethodType::LOCATION, + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::IMAGE_PNG + )) ->param('name', '', new Text(128), 'Full Name. When empty, current user name or email will be used. Max length: 128 chars.', true) ->param('width', 500, new Range(0, 2000), 'Image width. Pass an integer between 0 to 2000. Defaults to 100.', true) ->param('height', 500, new Range(0, 2000), 'Image height. Pass an integer between 0 to 2000. Defaults to 100.', true) @@ -544,7 +598,7 @@ App::get('/v1/avatars/initials') $image->compositeImage($punch, Imagick::COMPOSITE_COPYOPACITY, 0, 0); $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->setContentType('image/png') ->file($image->getImageBlob()); }); @@ -565,14 +619,14 @@ App::get('/v1/cards/cloud') ->inject('user') ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('response') ->inject('heroes') ->inject('contributors') ->inject('employees') ->inject('logger') - ->action(function (string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForConsole, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) use ($getUserGitHub) { - $user = Authorization::skip(fn () => $dbForConsole->getDocument('users', $userId)); + ->action(function (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) use ($getUserGitHub) { + $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -583,7 +637,7 @@ App::get('/v1/cards/cloud') $email = $user->getAttribute('email', ''); $createdAt = new \DateTime($user->getCreatedAt()); - $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForConsole, $logger); + $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); $githubName = $gitHub['name'] ?? ''; $githubId = $gitHub['id'] ?? ''; @@ -751,7 +805,7 @@ App::get('/v1/cards/cloud') } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->setContentType('image/png') ->file($baseImage->getImageBlob()); }); @@ -772,14 +826,14 @@ App::get('/v1/cards/cloud-back') ->inject('user') ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('response') ->inject('heroes') ->inject('contributors') ->inject('employees') ->inject('logger') - ->action(function (string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForConsole, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) use ($getUserGitHub) { - $user = Authorization::skip(fn () => $dbForConsole->getDocument('users', $userId)); + ->action(function (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) use ($getUserGitHub) { + $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -789,7 +843,7 @@ App::get('/v1/cards/cloud-back') $userId = $user->getId(); $email = $user->getAttribute('email', ''); - $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForConsole, $logger); + $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); $githubId = $gitHub['id'] ?? ''; $isHero = \array_key_exists($email, $heroes); @@ -829,7 +883,7 @@ App::get('/v1/cards/cloud-back') } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->setContentType('image/png') ->file($baseImage->getImageBlob()); }); @@ -850,14 +904,14 @@ App::get('/v1/cards/cloud-og') ->inject('user') ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('response') ->inject('heroes') ->inject('contributors') ->inject('employees') ->inject('logger') - ->action(function (string $userId, string $mock, int $width, int $height, Document $user, Document $project, Database $dbForProject, Database $dbForConsole, Response $response, array $heroes, array $contributors, array $employees, ?Logger $logger) use ($getUserGitHub) { - $user = Authorization::skip(fn () => $dbForConsole->getDocument('users', $userId)); + ->action(function (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) use ($getUserGitHub) { + $user = Authorization::skip(fn () => $dbForPlatform->getDocument('users', $userId)); if ($user->isEmpty() && empty($mock)) { throw new Exception(Exception::USER_NOT_FOUND); @@ -872,7 +926,7 @@ App::get('/v1/cards/cloud-og') $email = $user->getAttribute('email', ''); $createdAt = new \DateTime($user->getCreatedAt()); - $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForConsole, $logger); + $gitHub = $getUserGitHub($user->getId(), $project, $dbForProject, $dbForPlatform, $logger); $githubName = $gitHub['name'] ?? ''; $githubId = $gitHub['id'] ?? ''; @@ -1219,7 +1273,7 @@ App::get('/v1/cards/cloud-og') } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->setContentType('image/png') ->file($baseImage->getImageBlob()); }); diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index eeb823a3d3..9a41f67724 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -1,6 +1,10 @@ <?php use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Document; @@ -21,13 +25,19 @@ App::get('/v1/console/variables') ->desc('Get variables') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'console') - ->label('sdk.method', 'variables') - ->label('sdk.description', '/docs/references/console/variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONSOLE_VARIABLES) + ->label('sdk', new Method( + namespace: 'console', + name: 'variables', + description: '/docs/references/console/variables.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONSOLE_VARIABLES, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->action(function (Response $response) { $isDomainEnabled = !empty(System::getEnv('_APP_DOMAIN', '')) @@ -60,18 +70,25 @@ App::post('/v1/console/assistant') ->desc('Ask query') ->groups(['api', 'assistant']) ->label('scope', 'assistant.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'assistant') - ->label('sdk.method', 'chat') - ->label('sdk.description', '/docs/references/assistant/chat.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_TEXT) + ->label('sdk', new Method( + namespace: 'assistant', + name: 'chat', + description: '/docs/references/assistant/chat.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::TEXT + )) ->label('abuse-limit', 15) ->label('abuse-key', 'userId:{userId}') ->param('prompt', '', new Text(2000), 'Prompt. A string containing questions asked to the AI assistant.') ->inject('response') ->action(function (string $prompt, Response $response) { - $ch = curl_init('http://appwrite-assistant:3003/'); + $ch = curl_init('http://appwrite-assistant:3003/v1/models/assistant/prompt'); $responseHeaders = []; $query = json_encode(['prompt' => $prompt]); $headers = ['accept: text/event-stream']; diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 473f09cb7c..df46c1890b 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -3,11 +3,14 @@ use Appwrite\Auth\Auth; use Appwrite\Detector\Detector; use Appwrite\Event\Database as EventDatabase; -use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Attributes; use Appwrite\Utopia\Database\Validator\Queries\Collections; @@ -21,11 +24,11 @@ use Utopia\Audit\Audit; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\Exception as DatabaseException; use Utopia\Database\Exception\Authorization as AuthorizationException; use Utopia\Database\Exception\Conflict as ConflictException; use Utopia\Database\Exception\Duplicate as DuplicateException; use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Exception\NotFound as NotFoundException; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Exception\Restricted as RestrictedException; use Utopia\Database\Exception\Structure as StructureException; @@ -37,6 +40,7 @@ use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\Index as IndexValidator; +use Utopia\Database\Validator\IndexDependency as IndexDependencyValidator; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\Queries; @@ -153,7 +157,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att } catch (DuplicateException) { throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS); } catch (LimitException) { - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute limit exceeded'); + throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); } catch (\Throwable $e) { $dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $collectionId); $dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $collection->getInternalId()); @@ -197,7 +201,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att throw new Exception(Exception::ATTRIBUTE_ALREADY_EXISTS); } catch (LimitException) { $dbForProject->deleteDocument('attributes', $attribute->getId()); - throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute limit exceeded'); + throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); } catch (\Throwable $e) { $dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $relatedCollection->getId()); $dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $relatedCollection->getInternalId()); @@ -291,15 +295,9 @@ function updateAttribute( $attribute->setAttribute('size', $size); } - $formatOptions = $attribute->getAttribute('formatOptions'); - switch ($attribute->getAttribute('format')) { case APP_DATABASE_ATTRIBUTE_INT_RANGE: case APP_DATABASE_ATTRIBUTE_FLOAT_RANGE: - if ($min === $formatOptions['min'] && $max === $formatOptions['max']) { - break; - } - if ($min > $max) { throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); } @@ -352,13 +350,16 @@ function updateAttribute( if ($type === Database::VAR_RELATIONSHIP) { $primaryDocumentOptions = \array_merge($attribute->getAttribute('options', []), $options); $attribute->setAttribute('options', $primaryDocumentOptions); - - $dbForProject->updateRelationship( - collection: $collectionId, - id: $key, - newKey: $newKey, - onDelete: $primaryDocumentOptions['onDelete'], - ); + try { + $dbForProject->updateRelationship( + collection: $collectionId, + id: $key, + newKey: $newKey, + onDelete: $primaryDocumentOptions['onDelete'], + ); + } catch (NotFoundException) { + throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); + } if ($primaryDocumentOptions['twoWay']) { $relatedCollection = $dbForProject->getDocument('database_' . $db->getInternalId(), $primaryDocumentOptions['relatedCollection']); @@ -383,28 +384,42 @@ function updateAttribute( size: $size, required: $required, default: $default, - formatOptions: $options ?? null, + formatOptions: $options, newKey: $newKey ?? null ); } catch (TruncateException) { throw new Exception(Exception::ATTRIBUTE_INVALID_RESIZE); + } catch (NotFoundException) { + throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); + } catch (LimitException) { + throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); } } if (!empty($newKey) && $key !== $newKey) { - // Delete attribute and recreate since we can't modify IDs - $original = clone $attribute; - - $dbForProject->deleteDocument('attributes', $attribute->getId()); + $originalUid = $attribute->getId(); $attribute ->setAttribute('$id', ID::custom($db->getInternalId() . '_' . $collection->getInternalId() . '_' . $newKey)) ->setAttribute('key', $newKey); - try { - $attribute = $dbForProject->createDocument('attributes', $attribute); - } catch (DatabaseException|PDOException) { - $attribute = $dbForProject->createDocument('attributes', $original); + $dbForProject->updateDocument('attributes', $originalUid, $attribute); + + /** + * @var Document $index + */ + foreach ($collection->getAttribute('indexes') as $index) { + /** + * @var string[] $attributes + */ + $attributes = $index->getAttribute('attributes', []); + $found = \array_search($key, $attributes); + + if ($found !== false) { + $attributes[$found] = $newKey; + $index->setAttribute('attributes', $attributes); + $dbForProject->updateDocument('indexes', $index->getId(), $index); + } } } else { $attribute = $dbForProject->updateDocument('attributes', $db->getInternalId() . '_' . $collection->getInternalId() . '_' . $key, $attribute); @@ -439,15 +454,22 @@ App::post('/v1/databases') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].create') ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'database.create') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/databases/create.md') // create this file later - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) // Model for database needs to be created + ->label('sdk', new Method( + namespace: 'databases', + name: 'create', + description: '/docs/references/databases/create.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is the database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -516,24 +538,26 @@ App::get('/v1/databases') ->desc('List databases') ->groups(['api', 'database']) ->label('scope', 'databases.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/databases/list.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'list', + description: '/docs/references/databases/list.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') ->action(function (array $queries, string $search, Response $response, Database $dbForProject) { - - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); if (!empty($search)) { $queries[] = Query::search('search', $search); @@ -576,13 +600,20 @@ App::get('/v1/databases/:databaseId') ->desc('Get database') ->groups(['api', 'database']) ->label('scope', 'databases.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/databases/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'get', + description: '/docs/references/databases/get.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -601,13 +632,20 @@ App::get('/v1/databases/:databaseId/logs') ->desc('List database logs') ->groups(['api', 'database']) ->label('scope', 'databases.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/databases/get-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listLogs', + description: '/docs/references/databases/get-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -692,16 +730,23 @@ App::put('/v1/databases/:databaseId') ->desc('Update database') ->groups(['api', 'database', 'schema']) ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].update') ->label('audits.event', 'database.update') ->label('audits.resource', 'database/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/databases/update.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DATABASE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'update', + description: '/docs/references/databases/update.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DATABASE, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('name', null, new Text(128), 'Database name. Max length: 128 chars.') ->param('enabled', true, new Boolean(), 'Is database enabled? When set to \'disabled\', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.', true) @@ -730,15 +775,23 @@ App::delete('/v1/databases/:databaseId') ->desc('Delete database') ->groups(['api', 'database', 'schema']) ->label('scope', 'databases.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].delete') ->label('audits.event', 'database.delete') ->label('audits.resource', 'database/{request.databaseId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/databases/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'delete', + description: '/docs/references/databases/delete.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->inject('response') ->inject('dbForProject') @@ -779,15 +832,22 @@ App::post('/v1/databases/:databaseId/collections') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'collection.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createCollection') - ->label('sdk.description', '/docs/references/databases/create-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createCollection', + description: '/docs/references/databases/create-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_COLLECTION, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.') @@ -809,22 +869,21 @@ App::post('/v1/databases/:databaseId/collections') $collectionId = $collectionId == 'unique()' ? ID::unique() : $collectionId; // Map aggregate permissions into the multiple permissions they represent. - $permissions = Permission::aggregate($permissions); + $permissions = Permission::aggregate($permissions) ?? []; try { - $dbForProject->createDocument('database_' . $database->getInternalId(), new Document([ + $collection = $dbForProject->createDocument('database_' . $database->getInternalId(), new Document([ '$id' => $collectionId, 'databaseInternalId' => $database->getInternalId(), 'databaseId' => $databaseId, - '$permissions' => $permissions ?? [], + '$permissions' => $permissions, 'documentSecurity' => $documentSecurity, 'enabled' => $enabled, 'name' => $name, 'search' => implode(' ', [$collectionId, $name]), ])); - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->createCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), permissions: $permissions ?? [], documentSecurity: $documentSecurity); + $dbForProject->createCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), permissions: $permissions, documentSecurity: $documentSecurity); } catch (DuplicateException) { throw new Exception(Exception::COLLECTION_ALREADY_EXISTS); } catch (LimitException) { @@ -842,17 +901,24 @@ App::post('/v1/databases/:databaseId/collections') }); App::get('/v1/databases/:databaseId/collections') - ->alias('/v1/database/collections', ['databaseId' => 'default']) + ->alias('/v1/database/collections') ->desc('List collections') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollections') - ->label('sdk.description', '/docs/references/databases/list-collections.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollections', + description: '/docs/references/databases/list-collections.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('queries', [], new Collections(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Collections::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -867,11 +933,7 @@ App::get('/v1/databases/:databaseId/collections') throw new Exception(Exception::DATABASE_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); if (!empty($search)) { $queries[] = Query::search('search', $search); @@ -911,17 +973,24 @@ App::get('/v1/databases/:databaseId/collections') }); App::get('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId') ->desc('Get collection') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollection') - ->label('sdk.description', '/docs/references/databases/get-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollection', + description: '/docs/references/databases/get-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -945,17 +1014,24 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') }); App::get('/v1/databases/:databaseId/collections/:collectionId/logs') - ->alias('/v1/database/collections/:collectionId/logs', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/logs') ->desc('List collection logs') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listCollectionLogs') - ->label('sdk.description', '/docs/references/databases/get-collection-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listCollectionLogs', + description: '/docs/references/databases/get-collection-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) @@ -978,12 +1054,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } - + $queries = Query::parseQueries($queries); $grouped = Query::groupByType($queries); $limit = $grouped['limit'] ?? APP_LIMIT_COUNT; $offset = $grouped['offset'] ?? 0; @@ -1045,20 +1116,27 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') App::put('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId') ->desc('Update collection') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].update') ->label('audits.event', 'collection.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateCollection') - ->label('sdk.description', '/docs/references/databases/update-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COLLECTION) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateCollection', + description: '/docs/references/databases/update-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COLLECTION, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.') @@ -1090,12 +1168,16 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') $enabled ??= $collection->getAttribute('enabled', true); - $collection = $dbForProject->updateDocument('database_' . $database->getInternalId(), $collectionId, $collection + $collection = $dbForProject->updateDocument( + 'database_' . $database->getInternalId(), + $collectionId, + $collection ->setAttribute('name', $name) ->setAttribute('$permissions', $permissions) ->setAttribute('documentSecurity', $documentSecurity) ->setAttribute('enabled', $enabled) - ->setAttribute('search', implode(' ', [$collectionId, $name]))); + ->setAttribute('search', \implode(' ', [$collectionId, $name])) + ); $dbForProject->updateCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $permissions, $documentSecurity); @@ -1108,19 +1190,27 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') }); App::delete('/v1/databases/:databaseId/collections/:collectionId') - ->alias('/v1/database/collections/:collectionId', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId') ->desc('Delete collection') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].delete') ->label('audits.event', 'collection.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteCollection') - ->label('sdk.description', '/docs/references/databases/delete-collection.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteCollection', + description: '/docs/references/databases/delete-collection.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->inject('response') @@ -1163,20 +1253,26 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string') - ->alias('/v1/database/collections/:collectionId/attributes/string', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/string') ->desc('Create string attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createStringAttribute') - ->label('sdk.description', '/docs/references/databases/create-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createStringAttribute', + description: '/docs/references/databases/create-string-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_STRING + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1213,27 +1309,32 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string 'filters' => $filters, ]), $response, $dbForProject, $queueForDatabase, $queueForEvents); - $response ->setStatusCode(Response::STATUS_CODE_ACCEPTED) ->dynamic($attribute, Response::MODEL_ATTRIBUTE_STRING); }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email') - ->alias('/v1/database/collections/:collectionId/attributes/email', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/email') ->desc('Create email attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEmailAttribute') - ->label('sdk.description', '/docs/references/databases/create-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEmailAttribute', + description: '/docs/references/databases/create-email-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1262,20 +1363,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/email' }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') - ->alias('/v1/database/collections/:collectionId/attributes/enum', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/enum') ->desc('Create enum attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createEnumAttribute') - ->label('sdk.description', '/docs/references/databases/create-attribute-enum.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createEnumAttribute', + description: '/docs/references/databases/create-attribute-enum.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1309,20 +1416,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/enum') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') - ->alias('/v1/database/collections/:collectionId/attributes/ip', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/ip') ->desc('Create IP address attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIpAttribute') - ->label('sdk.description', '/docs/references/databases/create-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIpAttribute', + description: '/docs/references/databases/create-ip-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1351,20 +1464,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/ip') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') - ->alias('/v1/database/collections/:collectionId/attributes/url', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/url') ->desc('Create URL attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createUrlAttribute') - ->label('sdk.description', '/docs/references/databases/create-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createUrlAttribute', + description: '/docs/references/databases/create-url-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1393,20 +1512,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/url') }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/integer') - ->alias('/v1/database/collections/:collectionId/attributes/integer', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/integer') ->desc('Create integer attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/create-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIntegerAttribute', + description: '/docs/references/databases/create-integer-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1422,8 +1547,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?int $min, ?int $max, ?int $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { // Ensure attribute default is within range - $min = (is_null($min)) ? PHP_INT_MIN : \intval($min); - $max = (is_null($max)) ? PHP_INT_MAX : \intval($max); + $min = \is_null($min) ? PHP_INT_MIN : $min; + $max = \is_null($max) ? PHP_INT_MAX : $max; if ($min > $max) { throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); @@ -1464,20 +1589,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/intege }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float') - ->alias('/v1/database/collections/:collectionId/attributes/float', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/float') ->desc('Create float attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createFloatAttribute') - ->label('sdk.description', '/docs/references/databases/create-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createFloatAttribute', + description: '/docs/references/databases/create-float-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1493,21 +1624,16 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' ->action(function (string $databaseId, string $collectionId, string $key, ?bool $required, ?float $min, ?float $max, ?float $default, bool $array, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents) { // Ensure attribute default is within range - $min = (is_null($min)) ? -PHP_FLOAT_MAX : \floatval($min); - $max = (is_null($max)) ? PHP_FLOAT_MAX : \floatval($max); + $min = \is_null($min) ? -PHP_FLOAT_MAX : $min; + $max = \is_null($max) ? PHP_FLOAT_MAX : $max; if ($min > $max) { throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, 'Minimum value must be lesser than maximum value'); } - // Ensure default value is a float - if (!is_null($default)) { - $default = \floatval($default); - } - $validator = new Range($min, $max, Database::VAR_FLOAT); - if (!is_null($default) && !$validator->isValid($default)) { + if (!\is_null($default) && !$validator->isValid($default)) { throw new Exception(Exception::ATTRIBUTE_VALUE_INVALID, $validator->getDescription()); } @@ -1538,20 +1664,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/float' }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolean') - ->alias('/v1/database/collections/:collectionId/attributes/boolean', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/boolean') ->desc('Create boolean attribute') ->groups(['api', 'database', 'schema']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/create-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createBooleanAttribute', + description: '/docs/references/databases/create-boolean-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1579,25 +1711,31 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/boolea }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/datetime') - ->alias('/v1/database/collections/:collectionId/attributes/datetime', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/datetime') ->desc('Create datetime attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/create-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createDatetimeAttribute', + description: '/docs/references/databases/create-datetime-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new DatetimeValidator(), 'Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.', true) + ->param('default', null, fn (Database $dbForProject) => new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime()), 'Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.', true, ['dbForProject']) ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') @@ -1623,20 +1761,26 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/dateti }); App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relationship') - ->alias('/v1/database/collections/:collectionId/attributes/relationship', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/relationship') ->desc('Create relationship attribute') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'attribute.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.namespace', 'databases') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.method', 'createRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/create-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createRelationshipAttribute', + description: '/docs/references/databases/create-relationship-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('relatedCollectionId', '', new UID(), 'Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') @@ -1751,17 +1895,23 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati }); App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') - ->alias('/v1/database/collections/:collectionId/attributes', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes') ->desc('List attributes') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listAttributes') - ->label('sdk.description', '/docs/references/databases/list-attributes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listAttributes', + description: '/docs/references/databases/list-attributes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_LIST + ) + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Attributes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Attributes::ALLOWED_ATTRIBUTES), true) @@ -1781,16 +1931,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); \array_push( $queries, + Query::equal('databaseInternalId', [$database->getInternalId()]), Query::equal('collectionInternalId', [$collection->getInternalId()]), - Query::equal('databaseInternalId', [$database->getInternalId()]) ); /** @@ -1799,6 +1945,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') $cursor = \array_filter($queries, function ($query) { return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); }); + $cursor = \reset($cursor); if ($cursor) { @@ -1809,8 +1956,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') $attributeId = $cursor->getValue(); $cursorDocument = Authorization::skip(fn () => $dbForProject->find('attributes', [ - Query::equal('collectionInternalId', [$collection->getInternalId()]), Query::equal('databaseInternalId', [$database->getInternalId()]), + Query::equal('collectionInternalId', [$collection->getInternalId()]), Query::equal('key', [$attributeId]), Query::limit(1), ])); @@ -1834,27 +1981,34 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') }); App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') - ->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/:key') ->desc('Get attribute') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getAttribute') - ->label('sdk.description', '/docs/references/databases/get-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', [ - Response::MODEL_ATTRIBUTE_BOOLEAN, - Response::MODEL_ATTRIBUTE_INTEGER, - Response::MODEL_ATTRIBUTE_FLOAT, - Response::MODEL_ATTRIBUTE_EMAIL, - Response::MODEL_ATTRIBUTE_ENUM, - Response::MODEL_ATTRIBUTE_URL, - Response::MODEL_ATTRIBUTE_IP, - Response::MODEL_ATTRIBUTE_DATETIME, - Response::MODEL_ATTRIBUTE_RELATIONSHIP, - Response::MODEL_ATTRIBUTE_STRING])// needs to be last, since its condition would dominate any other string attribute + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getAttribute', + description: '/docs/references/databases/get-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: [ + Response::MODEL_ATTRIBUTE_BOOLEAN, + Response::MODEL_ATTRIBUTE_INTEGER, + Response::MODEL_ATTRIBUTE_FLOAT, + Response::MODEL_ATTRIBUTE_EMAIL, + Response::MODEL_ATTRIBUTE_ENUM, + Response::MODEL_ATTRIBUTE_URL, + Response::MODEL_ATTRIBUTE_IP, + Response::MODEL_ATTRIBUTE_DATETIME, + Response::MODEL_ATTRIBUTE_RELATIONSHIP, + Response::MODEL_ATTRIBUTE_STRING + ] + ), + ] + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1912,21 +2066,29 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/strin ->desc('Update string attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateStringAttribute') - ->label('sdk.description', '/docs/references/databases/update-string-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_STRING) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateStringAttribute', + description: '/docs/references/databases/update-string-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_STRING, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') ->param('default', null, new Nullable(new Text(0, 0)), 'Default value for attribute when not provided. Cannot be set when attribute is required.') - ->param('size', null, new Integer(), 'Maximum size of the string attribute.', true) + ->param('size', null, new Range(1, APP_DATABASE_ATTRIBUTE_STRING_MAX_LENGTH, Range::TYPE_INTEGER), 'Maximum size of the string attribute.', true) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') @@ -1955,15 +2117,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/email ->desc('Update email attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEmailAttribute') - ->label('sdk.description', '/docs/references/databases/update-email-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_EMAIL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEmailAttribute', + description: '/docs/references/databases/update-email-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_EMAIL, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -1996,15 +2166,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/enum/ ->desc('Update enum attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateEnumAttribute') - ->label('sdk.description', '/docs/references/databases/update-enum-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_ENUM) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateEnumAttribute', + description: '/docs/references/databases/update-enum-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_ENUM, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2039,15 +2217,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/ip/:k ->desc('Update IP address attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIpAttribute') - ->label('sdk.description', '/docs/references/databases/update-ip-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_IP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIpAttribute', + description: '/docs/references/databases/update-ip-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_IP, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2080,15 +2266,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/url/: ->desc('Update URL attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateUrlAttribute') - ->label('sdk.description', '/docs/references/databases/update-url-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_URL) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateUrlAttribute', + description: '/docs/references/databases/update-url-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_URL, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2121,15 +2315,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/integ ->desc('Update integer attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateIntegerAttribute') - ->label('sdk.description', '/docs/references/databases/update-integer-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_INTEGER) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateIntegerAttribute', + description: '/docs/references/databases/update-integer-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_INTEGER, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2172,15 +2374,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/float ->desc('Update float attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateFloatAttribute') - ->label('sdk.description', '/docs/references/databases/update-float-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_FLOAT) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateFloatAttribute', + description: '/docs/references/databases/update-float-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_FLOAT, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2223,15 +2433,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/boole ->desc('Update boolean attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateBooleanAttribute') - ->label('sdk.description', '/docs/references/databases/update-boolean-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_BOOLEAN) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateBooleanAttribute', + description: '/docs/references/databases/update-boolean-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_BOOLEAN, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2263,20 +2481,28 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/datet ->desc('Update dateTime attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDatetimeAttribute') - ->label('sdk.description', '/docs/references/databases/update-datetime-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_DATETIME) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDatetimeAttribute', + description: '/docs/references/databases/update-datetime-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_DATETIME, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('default', null, new Nullable(new DatetimeValidator()), 'Default value for attribute when not provided. Cannot be set when attribute is required.') + ->param('default', null, fn (Database $dbForProject) => new Nullable(new DatetimeValidator($dbForProject->getAdapter()->getMinDateTime(), $dbForProject->getAdapter()->getMaxDateTime())), 'Default value for attribute when not provided. Cannot be set when attribute is required.', injections: ['dbForProject']) ->param('newKey', null, new Key(), 'New attribute key.', true) ->inject('response') ->inject('dbForProject') @@ -2303,15 +2529,23 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ ->desc('Update relationship attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateRelationshipAttribute') - ->label('sdk.description', '/docs/references/databases/update-relationship-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.model', Response::MODEL_ATTRIBUTE_RELATIONSHIP) + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateRelationshipAttribute', + description: '/docs/references/databases/update-relationship-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ATTRIBUTE_RELATIONSHIP, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2356,19 +2590,27 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/attributes/:key/ }); App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') - ->alias('/v1/database/collections/:collectionId/attributes/:key', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/attributes/:key') ->desc('Delete attribute') ->groups(['api', 'database', 'schema']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].attributes.[attributeId].update') ->label('audits.event', 'attribute.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteAttribute') - ->label('sdk.description', '/docs/references/databases/delete-attribute.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteAttribute', + description: '/docs/references/databases/delete-attribute.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Attribute Key.') @@ -2396,6 +2638,18 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); } + /** + * Check index dependency + */ + $validator = new IndexDependencyValidator( + $collection->getAttribute('indexes'), + $dbForProject->getAdapter()->getSupportForCastIndexArray(), + ); + + if (! $validator->isValid($attribute)) { + throw new Exception(Exception::INDEX_DEPENDENCY); + } + // Only update status if removing available attribute if ($attribute->getAttribute('status') === 'available') { $attribute = $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'deleting')); @@ -2469,20 +2723,27 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key }); App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') - ->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/indexes') ->desc('Create index') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].create') ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'index.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createIndex') - ->label('sdk.description', '/docs/references/databases/create-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('sdk', new Method( + namespace: 'databases', + name: 'createIndex', + description: '/docs/references/databases/create-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_INDEX, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2566,7 +2827,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') $attributeStatus = $oldAttributes[$attributeIndex]['status']; $attributeType = $oldAttributes[$attributeIndex]['type']; - $attributeSize = $oldAttributes[$attributeIndex]['size']; $attributeArray = $oldAttributes[$attributeIndex]['array'] ?? false; if ($attributeType === Database::VAR_RELATIONSHIP) { @@ -2580,10 +2840,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') $lengths[$i] = null; - if ($attributeType === Database::VAR_STRING) { - $lengths[$i] = $attributeSize; // set attribute size as index length only for strings - } - if ($attributeArray === true) { $lengths[$i] = Database::ARRAY_INDEX_LENGTH; $orders[$i] = null; @@ -2606,7 +2862,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') $validator = new IndexValidator( $collection->getAttribute('attributes'), - $dbForProject->getAdapter()->getMaxIndexLength() + $dbForProject->getAdapter()->getMaxIndexLength(), + $dbForProject->getAdapter()->getInternalIndexesKeys(), ); if (!$validator->isValid($index)) { throw new Exception(Exception::INDEX_INVALID, $validator->getDescription()); @@ -2639,17 +2896,24 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') }); App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') - ->alias('/v1/database/collections/:collectionId/indexes', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/indexes') ->desc('List indexes') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listIndexes') - ->label('sdk.description', '/docs/references/databases/list-indexes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listIndexes', + description: '/docs/references/databases/list-indexes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new Indexes(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Indexes::ALLOWED_ATTRIBUTES), true) @@ -2669,13 +2933,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') throw new Exception(Exception::COLLECTION_NOT_FOUND); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); - \array_push($queries, Query::equal('collectionId', [$collectionId]), Query::equal('databaseId', [$databaseId])); + \array_push( + $queries, + Query::equal('databaseId', [$databaseId]), + Query::equal('collectionId', [$collectionId]), + ); /** * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries @@ -2718,13 +2982,20 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->desc('Get index') ->groups(['api', 'database']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getIndex') - ->label('sdk.description', '/docs/references/databases/get-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INDEX) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getIndex', + description: '/docs/references/databases/get-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INDEX, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') @@ -2757,15 +3028,23 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->desc('Delete index') ->groups(['api', 'database']) ->label('scope', 'collections.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].indexes.[indexId].update') ->label('audits.event', 'index.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteIndex') - ->label('sdk.description', '/docs/references/databases/delete-index.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteIndex', + description: '/docs/references/databases/delete-index.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', '', new Key(), 'Index Key.') @@ -2822,20 +3101,30 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].create') ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'document.create') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'createDocument') - ->label('sdk.description', '/docs/references/databases/create-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label( + 'sdk', + [ + new Method( + namespace: 'databases', + name: 'createDocument', + description: '/docs/references/databases/create-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_DOCUMENT, + ) + ], + contentType: ContentType::JSON + ) + ] + ) ->param('databaseId', '', new UID(), 'Database ID.') ->param('documentId', '', new CustomId(), 'Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.') @@ -2918,7 +3207,11 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $data['$permissions'] = $permissions; $document = new Document($data); - $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database) { + $operations = 0; + + $checkPermissions = function (Document $collection, Document $document, string $permission) use (&$checkPermissions, $dbForProject, $database, &$operations) { + $operations++; + $documentSecurity = $collection->getAttribute('documentSecurity', false); $validator = new Authorization($permission); @@ -3002,12 +3295,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') try { $document = $dbForProject->createDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $document); - } catch (StructureException $exception) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $exception->getMessage()); - } catch (DuplicateException $exception) { + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } catch (DuplicateException $e) { throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); + } catch (NotFoundException $e) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); } + // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { $document->setAttribute('$databaseId', $database->getId()); @@ -3043,6 +3339,13 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $processDocument($collection, $document); + $queueForUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations) + ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection + + $response->addHeader('X-Debug-Operations', $operations); + $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($document, Response::MODEL_DOCUMENT); @@ -3062,10 +3365,6 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') ->setContext('collection', $collection) ->setContext('database', $database) ->setPayload($response->getPayload(), sensitive: $relationships); - - - $queueForUsage - ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection }); App::get('/v1/databases/:databaseId/collections/:collectionId/documents') @@ -3073,21 +3372,28 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') ->desc('List documents') ->groups(['api', 'database']) ->label('scope', 'documents.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocuments') - ->label('sdk.description', '/docs/references/databases/list-documents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocuments', + description: '/docs/references/databases/list-documents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('response') ->inject('dbForProject') ->inject('mode') - ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject, string $mode) { + ->inject('queueForUsage') + ->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject, string $mode, Usage $queueForUsage) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -3123,7 +3429,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); } - $documentId = $cursor->getValue(); $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId)); @@ -3135,21 +3440,19 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $cursor->setValue($cursorDocument); } - try { - $documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries); - $total = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT); - } catch (AuthorizationException) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries); + $total = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT); + + $operations = 0; // Add $collectionId and $databaseId for all documents - $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database): bool { + $processDocument = (function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations): bool { if ($document->isEmpty()) { return false; } + $operations++; + $document->removeAttribute('$collection'); $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -3163,8 +3466,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $related = $document->getAttribute($relationship->getAttribute('key')); if (empty($related)) { + if (\in_array(\gettype($related), ['array', 'object'])) { + $operations++; + } + continue; } + if (!\is_array($related)) { $relations = [$related]; } else { @@ -3172,6 +3480,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') } $relatedCollectionId = $relationship->getAttribute('relatedCollection'); + // todo: Use local cache for this getDocument $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId)); foreach ($relations as $index => $doc) { @@ -3196,6 +3505,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $processDocument($collection, $document); } + $queueForUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations) + ; + + $response->addHeader('X-Debug-Operations', $operations); + $select = \array_reduce($queries, function ($result, $query) { return $result || ($query->getMethod() === Query::TYPE_SELECT); }, false); @@ -3234,15 +3550,20 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->desc('Get document') ->groups(['api', 'database']) ->label('scope', 'documents.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDocument') - ->label('sdk.description', '/docs/references/databases/get-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDocument', + description: '/docs/references/databases/get-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -3250,9 +3571,9 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->inject('response') ->inject('dbForProject') ->inject('mode') - ->action(function (string $databaseId, string $collectionId, string $documentId, array $queries, Response $response, Database $dbForProject, string $mode) { + ->inject('queueForUsage') + ->action(function (string $databaseId, string $collectionId, string $documentId, array $queries, Response $response, Database $dbForProject, string $mode, Usage $queueForUsage) { $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -3279,12 +3600,16 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DOCUMENT_NOT_FOUND); } + $operations = 0; + // Add $collectionId and $databaseId for all documents - $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { + $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database, &$operations) { if ($document->isEmpty()) { return; } + $operations++; + $document->setAttribute('$databaseId', $database->getId()); $document->setAttribute('$collectionId', $collection->getId()); @@ -3297,8 +3622,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $related = $document->getAttribute($relationship->getAttribute('key')); if (empty($related)) { + if (\in_array(\gettype($related), ['array', 'object'])) { + $operations++; + } + continue; } + if (!\is_array($related)) { $related = [$related]; } @@ -3318,6 +3648,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $processDocument($collection, $document); + $queueForUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_READS, $operations) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), $operations) + ; + + $response->addHeader('X-Debug-Operations', $operations); + $response->dynamic($document, Response::MODEL_DOCUMENT); }); @@ -3326,13 +3663,20 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen ->desc('List document logs') ->groups(['api', 'database']) ->label('scope', 'documents.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'listDocumentLogs') - ->label('sdk.description', '/docs/references/databases/get-document-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'listDocumentLogs', + description: '/docs/references/databases/get-document-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], + contentType: ContentType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3419,6 +3763,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $output[$i]['countryName'] = $locale->getText('locale.country.unknown'); } } + $response->dynamic(new Document([ 'total' => $audit->countLogsByResource($resource), 'logs' => $output, @@ -3426,25 +3771,30 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen }); App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId') - ->alias('/v1/database/collections/:collectionId/documents/:documentId', ['databaseId' => 'default']) + ->alias('/v1/database/collections/:collectionId/documents/:documentId') ->desc('Update document') ->groups(['api', 'database']) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update') ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('audits.event', 'document.update') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{response.$id}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'updateDocument') - ->label('sdk.description', '/docs/references/databases/update-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DOCUMENT) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'updateDocument', + description: '/docs/references/databases/update-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], + contentType: ContentType::JSON + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') ->param('documentId', '', new UID(), 'Document ID.') @@ -3455,7 +3805,8 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum ->inject('dbForProject') ->inject('queueForEvents') ->inject('mode') - ->action(function (string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, string $mode) { + ->inject('queueForUsage') + ->action(function (string $databaseId, string $collectionId, string $documentId, string|array $data, ?array $permissions, ?\DateTime $requestTimestamp, Response $response, Database $dbForProject, Event $queueForEvents, string $mode, Usage $queueForUsage) { $data = (\is_string($data)) ? \json_decode($data, true) : $data; // Cast to JSON array @@ -3522,7 +3873,12 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $data['$permissions'] = $permissions; $newDocument = new Document($data); - $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database) { + $operations = 0; + + $setCollection = (function (Document $collection, Document $document) use (&$setCollection, $dbForProject, $database, &$operations) { + + $operations++; + $relationships = \array_filter( $collection->getAttribute('attributes', []), fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP @@ -3590,6 +3946,13 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $setCollection($collection, $newDocument); + $queueForUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, $operations) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), $operations) + ; + + $response->addHeader('X-Debug-Operations', $operations); + try { $document = $dbForProject->withRequestTimestamp( $requestTimestamp, @@ -3603,8 +3966,10 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum throw new Exception(Exception::USER_UNAUTHORIZED); } catch (DuplicateException) { throw new Exception(Exception::DOCUMENT_ALREADY_EXISTS); - } catch (StructureException $exception) { - throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $exception->getMessage()); + } catch (StructureException $e) { + throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage()); + } catch (NotFoundException $e) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); } // Add $collectionId and $databaseId for all documents @@ -3666,20 +4031,26 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->desc('Delete document') ->groups(['api', 'database']) ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].delete') ->label('audits.event', 'document.delete') ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}/document/{request.documentId}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'deleteDocument') - ->label('sdk.description', '/docs/references/databases/delete-document.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) - ->label('sdk.offline.model', '/databases/{databaseId}/collections/{collectionId}/documents') - ->label('sdk.offline.key', '{documentId}') + ->label('sdk', new Method( + namespace: 'databases', + name: 'deleteDocument', + description: '/docs/references/databases/delete-document.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('documentId', '', new UID(), 'Document ID.') @@ -3712,12 +4083,16 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu throw new Exception(Exception::DOCUMENT_NOT_FOUND); } - $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $documentId) { - $dbForProject->deleteDocument( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - $documentId - ); - }); + try { + $dbForProject->withRequestTimestamp($requestTimestamp, function () use ($dbForProject, $database, $collection, $documentId) { + $dbForProject->deleteDocument( + 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + $documentId + ); + }); + } catch (NotFoundException $e) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } // Add $collectionId and $databaseId for all documents $processDocument = function (Document $collection, Document $document) use (&$processDocument, $dbForProject, $database) { @@ -3754,6 +4129,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $processDocument($collection, $document); + $queueForUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1) + ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection + + $response->addHeader('X-Debug-Operations', 1); + $relationships = \array_map( fn ($document) => $document->getAttribute('key'), \array_filter( @@ -3770,9 +4152,6 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu ->setContext('database', $database) ->setPayload($response->output($document, Response::MODEL_DOCUMENT), sensitive: $relationships); - $queueForUsage - ->addMetric(str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE), 1); // per collection - $response->noContent(); }); @@ -3780,12 +4159,20 @@ App::get('/v1/databases/usage') ->desc('Get databases usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASES) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getUsage', + description: '/docs/references/databases/get-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASES, + ) + ], + contentType: ContentType::JSON + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') ->inject('dbForProject') @@ -3798,7 +4185,9 @@ App::get('/v1/databases/usage') METRIC_DATABASES, METRIC_COLLECTIONS, METRIC_DOCUMENTS, - METRIC_DATABASES_STORAGE + METRIC_DATABASES_STORAGE, + METRIC_DATABASES_OPERATIONS_READS, + METRIC_DATABASES_OPERATIONS_WRITES, ]; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { @@ -3850,10 +4239,14 @@ App::get('/v1/databases/usage') 'collectionsTotal' => $usage[$metrics[1]]['total'], 'documentsTotal' => $usage[$metrics[2]]['total'], 'storageTotal' => $usage[$metrics[3]]['total'], + 'databasesReadsTotal' => $usage[$metrics[4]]['total'], + 'databasesWritesTotal' => $usage[$metrics[5]]['total'], 'databases' => $usage[$metrics[0]]['data'], 'collections' => $usage[$metrics[1]]['data'], 'documents' => $usage[$metrics[2]]['data'], 'storage' => $usage[$metrics[3]]['data'], + 'databasesReads' => $usage[$metrics[4]]['data'], + 'databasesWrites' => $usage[$metrics[5]]['data'], ]), Response::MODEL_USAGE_DATABASES); }); @@ -3861,12 +4254,20 @@ App::get('/v1/databases/:databaseId/usage') ->desc('Get database usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getDatabaseUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_DATABASE) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getDatabaseUsage', + description: '/docs/references/databases/get-database-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_DATABASE, + ) + ], + contentType: ContentType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), '`Date range.', true) ->inject('response') @@ -3885,7 +4286,9 @@ App::get('/v1/databases/:databaseId/usage') $metrics = [ str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_COLLECTIONS), str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_DOCUMENTS), - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_STORAGE) + str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_STORAGE), + str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASES_OPERATIONS_READS), + str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASES_OPERATIONS_WRITES) ]; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { @@ -3937,9 +4340,13 @@ App::get('/v1/databases/:databaseId/usage') 'collectionsTotal' => $usage[$metrics[0]]['total'], 'documentsTotal' => $usage[$metrics[1]]['total'], 'storageTotal' => $usage[$metrics[2]]['total'], + 'databaseReadsTotal' => $usage[$metrics[3]]['total'], + 'databaseWritesTotal' => $usage[$metrics[4]]['total'], 'collections' => $usage[$metrics[0]]['data'], 'documents' => $usage[$metrics[1]]['data'], 'storage' => $usage[$metrics[2]]['data'], + 'databaseReads' => $usage[$metrics[3]]['data'], + 'databaseWrites' => $usage[$metrics[4]]['data'], ]), Response::MODEL_USAGE_DATABASE); }); @@ -3948,12 +4355,20 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') ->desc('Get collection usage stats') ->groups(['api', 'database', 'usage']) ->label('scope', 'collections.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'databases') - ->label('sdk.method', 'getCollectionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_COLLECTION) + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('sdk', new Method( + namespace: 'databases', + name: 'getCollectionUsage', + description: '/docs/references/databases/get-collection-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_COLLECTION, + ) + ], + contentType: ContentType::JSON, + )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->param('collectionId', '', new UID(), 'Collection ID.') diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 6823f0c802..336b70769c 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -14,6 +14,11 @@ use Appwrite\Functions\Validator\Headers; use Appwrite\Functions\Validator\RuntimeSpecification; use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Platform\Tasks\ScheduleExecutions; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Task\Validator\Cron; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Deployments; @@ -23,6 +28,7 @@ use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model\Rule; use Executor\Executor; use MaxMind\Db\Reader; +use Utopia\Abuse\Abuse; use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; @@ -138,15 +144,21 @@ App::post('/v1/functions') ->desc('Create function') ->label('scope', 'functions.write') ->label('event', 'functions.[functionId].create') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'function.create') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/functions/create-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'create', + description: '/docs/references/functions/create-function.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FUNCTION, + ) + ], + )) ->param('functionId', '', new CustomId(), 'Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.') @@ -177,15 +189,45 @@ App::post('/v1/functions') ->inject('request') ->inject('response') ->inject('dbForProject') + ->inject('timelimit') ->inject('project') ->inject('user') ->inject('queueForEvents') ->inject('queueForBuilds') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('gitHub') - ->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) use ($redeployVcs) { + ->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, callable $timelimit, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github) use ($redeployVcs) { $functionId = ($functionId == 'unique()') ? ID::unique() : $functionId; + // Temporary abuse check + $abuseCheck = function () use ($project, $timelimit, $response) { + $abuseKey = "projectId:{projectId},url:{url}"; + $abuseLimit = App::getEnv('_APP_FUNCTIONS_CREATION_ABUSE_LIMIT', 50); + $abuseTime = 86400; // 1 day + + $timeLimit = $timelimit($abuseKey, $abuseLimit, $abuseTime); + $timeLimit + ->setParam('{projectId}', $project->getId()) + ->setParam('{url}', '/v1/functions'); + + $abuse = new Abuse($timeLimit); + $remaining = $timeLimit->remaining(); + $limit = $timeLimit->limit(); + $time = $timeLimit->time() + $abuseTime; + + $response + ->addHeader('X-RateLimit-Limit', $limit) + ->addHeader('X-RateLimit-Remaining', $remaining) + ->addHeader('X-RateLimit-Reset', $time); + + $enabled = System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') !== 'disabled'; + if ($enabled && $abuse->check()) { + throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED); + } + }; + + $abuseCheck(); + $allowList = \array_filter(\explode(',', System::getEnv('_APP_FUNCTIONS_RUNTIMES', ''))); if (!empty($allowList) && !\in_array($runtime, $allowList)) { @@ -206,7 +248,7 @@ App::post('/v1/functions') ->setAttribute('version', $templateVersion); } - $installation = $dbForConsole->getDocument('installations', $installationId); + $installation = $dbForPlatform->getDocument('installations', $installationId); if (!empty($installationId) && $installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -248,7 +290,7 @@ App::post('/v1/functions') ])); $schedule = Authorization::skip( - fn () => $dbForConsole->createDocument('schedules', new Document([ + fn () => $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), // Todo replace with projects region 'resourceType' => 'function', 'resourceId' => $function->getId(), @@ -267,7 +309,7 @@ App::post('/v1/functions') if (!empty($providerRepositoryId)) { $teamId = $project->getAttribute('teamId', ''); - $repository = $dbForConsole->createDocument('repositories', new Document([ + $repository = $dbForPlatform->createDocument('repositories', new Document([ '$id' => ID::unique(), '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -325,12 +367,13 @@ App::post('/v1/functions') $functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); if (!empty($functionsDomain)) { - $ruleId = ID::unique(); $routeSubdomain = ID::unique(); $domain = "{$routeSubdomain}.{$functionsDomain}"; + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + $ruleId = System::getEnv('_APP_RULES_FORMAT') === 'md5' ? md5($domain) : ID::unique(); $rule = Authorization::skip( - fn () => $dbForConsole->createDocument('rules', new Document([ + fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), 'projectInternalId' => $project->getInternalId(), @@ -367,6 +410,7 @@ App::post('/v1/functions') $allEvents = Event::generateEvents('rules.[ruleId].create', [ 'ruleId' => $rule->getId(), ]); + $target = Realtime::fromPayload( // Pass first, most verbose event pattern event: $allEvents[0], @@ -400,13 +444,19 @@ App::get('/v1/functions') ->groups(['api', 'functions']) ->desc('List functions') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/functions/list-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'list', + description: '/docs/references/functions/list-functions.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION_LIST, + ) + ] + )) ->param('queries', [], new Functions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Functions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -460,13 +510,19 @@ App::get('/v1/functions/runtimes') ->groups(['api', 'functions']) ->desc('List runtimes') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listRuntimes') - ->label('sdk.description', '/docs/references/functions/list-runtimes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RUNTIME_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listRuntimes', + description: '/docs/references/functions/list-runtimes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RUNTIME_LIST, + ) + ] + )) ->inject('response') ->action(function (Response $response) { $runtimes = Config::getParam('runtimes'); @@ -493,13 +549,19 @@ App::get('/v1/functions/specifications') ->groups(['api', 'functions']) ->desc('List available function runtime specifications') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listSpecifications') - ->label('sdk.description', '/docs/references/functions/list-specifications.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SPECIFICATION_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listSpecifications', + description: '/docs/references/functions/list-specifications.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SPECIFICATION_LIST, + ) + ] + )) ->inject('response') ->inject('plan') ->action(function (Response $response, array $plan) { @@ -529,13 +591,19 @@ App::get('/v1/functions/:functionId') ->groups(['api', 'functions']) ->desc('Get function') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/functions/get-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'get', + description: '/docs/references/functions/get-function.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') @@ -553,12 +621,19 @@ App::get('/v1/functions/:functionId/usage') ->desc('Get function usage') ->groups(['api', 'functions', 'usage']) ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getFunctionUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTION) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getFunctionUsage', + description: '/docs/references/functions/get-function-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTION, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') @@ -657,12 +732,19 @@ App::get('/v1/functions/usage') ->desc('Get functions usage') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_FUNCTIONS) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getUsage', + description: '/docs/references/functions/get-functions-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_FUNCTIONS, + ) + ] + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -756,16 +838,22 @@ App::put('/v1/functions/:functionId') ->groups(['api', 'functions']) ->desc('Update function') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].update') ->label('audits.event', 'function.update') ->label('audits.resource', 'function/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/functions/update-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'update', + description: '/docs/references/functions/update-function.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('name', '', new Text(128), 'Function name. Max length: 128 chars.') ->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.', true) @@ -795,9 +883,9 @@ App::put('/v1/functions/:functionId') ->inject('project') ->inject('queueForEvents') ->inject('queueForBuilds') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('gitHub') - ->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) use ($redeployVcs) { + ->action(function (string $functionId, string $name, string $runtime, array $execute, array $events, string $schedule, int $timeout, bool $enabled, bool $logging, string $entrypoint, string $commands, array $scopes, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForPlatform, GitHub $github) use ($redeployVcs) { // TODO: If only branch changes, re-deploy $function = $dbForProject->getDocument('functions', $functionId); @@ -805,7 +893,7 @@ App::put('/v1/functions/:functionId') throw new Exception(Exception::FUNCTION_NOT_FOUND); } - $installation = $dbForConsole->getDocument('installations', $installationId); + $installation = $dbForPlatform->getDocument('installations', $installationId); if (!empty($installationId) && $installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -836,7 +924,7 @@ App::put('/v1/functions/:functionId') // Git disconnect logic. Disconnecting only when providerRepositoryId is empty, allowing for continue updates without disconnecting git if ($isConnected && ($providerRepositoryId !== null && empty($providerRepositoryId))) { - $repositories = $dbForConsole->find('repositories', [ + $repositories = $dbForPlatform->find('repositories', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::equal('resourceInternalId', [$function->getInternalId()]), Query::equal('resourceType', ['function']), @@ -844,7 +932,7 @@ App::put('/v1/functions/:functionId') ]); foreach ($repositories as $repository) { - $dbForConsole->deleteDocument('repositories', $repository->getId()); + $dbForPlatform->deleteDocument('repositories', $repository->getId()); } $providerRepositoryId = ''; @@ -860,7 +948,7 @@ App::put('/v1/functions/:functionId') if (!$isConnected && !empty($providerRepositoryId)) { $teamId = $project->getAttribute('teamId', ''); - $repository = $dbForConsole->createDocument('repositories', new Document([ + $repository = $dbForPlatform->createDocument('repositories', new Document([ '$id' => ID::unique(), '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -942,12 +1030,12 @@ App::put('/v1/functions/:functionId') } // Inform scheduler if function is still active - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queueForEvents->setParam('functionId', $function->getId()); @@ -958,13 +1046,21 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') ->groups(['api', 'functions']) ->desc('Download deployment') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeploymentDownload') - ->label('sdk.description', '/docs/references/functions/get-deployment-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeploymentDownload', + description: '/docs/references/functions/get-deployment-download.md', + auth: [AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::ANY, + type: MethodType::LOCATION + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -994,7 +1090,7 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId/download') $response ->setContentType('application/gzip') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->addHeader('X-Peak', \memory_get_peak_usage()) ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '.tar.gz"'); @@ -1043,23 +1139,29 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') ->groups(['api', 'functions']) ->desc('Update deployment') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeployment') - ->label('sdk.description', '/docs/references/functions/update-function-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FUNCTION) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeployment', + description: '/docs/references/functions/update-function-deployment.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FUNCTION, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->inject('dbForConsole') - ->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $functionId, string $deploymentId, Response $response, Database $dbForProject, Event $queueForEvents, Database $dbForPlatform) { $function = $dbForProject->getDocument('functions', $functionId); $deployment = $dbForProject->getDocument('deployments', $deploymentId); @@ -1087,12 +1189,12 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId') ]))); // Inform scheduler if function is still active - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queueForEvents ->setParam('functionId', $function->getId()) @@ -1105,22 +1207,30 @@ App::delete('/v1/functions/:functionId') ->groups(['api', 'functions']) ->desc('Delete function') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].delete') ->label('audits.event', 'function.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/functions/delete-function.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'delete', + description: '/docs/references/functions/delete-function.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') ->inject('queueForDeletes') ->inject('queueForEvents') - ->inject('dbForConsole') - ->action(function (string $functionId, Response $response, Database $dbForProject, Delete $queueForDeletes, Event $queueForEvents, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $functionId, Response $response, Database $dbForProject, Delete $queueForDeletes, Event $queueForEvents, Database $dbForPlatform) { $function = $dbForProject->getDocument('functions', $functionId); @@ -1133,11 +1243,11 @@ App::delete('/v1/functions/:functionId') } // Inform scheduler to no longer run function - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('active', false); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) @@ -1152,19 +1262,25 @@ App::post('/v1/functions/:functionId/deployments') ->groups(['api', 'functions']) ->desc('Create deployment') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].deployments.[deploymentId].create') ->label('audits.event', 'deployment.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createDeployment') - ->label('sdk.methodType', 'upload') - ->label('sdk.description', '/docs/references/functions/create-deployment.md') - ->label('sdk.packaging', true) - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createDeployment', + description: '/docs/references/functions/create-deployment.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_DEPLOYMENT, + ) + ], + requestType: 'multipart/form-data', + type: MethodType::UPLOAD, + packaging: true, + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('entrypoint', null, new Text(1028), 'Entrypoint File.', true) ->param('commands', null, new Text(8192, 0), 'Build Commands.', true) @@ -1371,13 +1487,19 @@ App::get('/v1/functions/:functionId/deployments') ->groups(['api', 'functions']) ->desc('List deployments') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listDeployments') - ->label('sdk.description', '/docs/references/functions/list-deployments.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listDeployments', + description: '/docs/references/functions/list-deployments.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT_LIST, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Deployments(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Deployments::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -1454,13 +1576,19 @@ App::get('/v1/functions/:functionId/deployments/:deploymentId') ->groups(['api', 'functions']) ->desc('Get deployment') ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getDeployment') - ->label('sdk.description', '/docs/references/functions/get-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DEPLOYMENT) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getDeployment', + description: '/docs/references/functions/get-deployment.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DEPLOYMENT, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1497,15 +1625,23 @@ App::delete('/v1/functions/:functionId/deployments/:deploymentId') ->groups(['api', 'functions']) ->desc('Delete deployment') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].deployments.[deploymentId].delete') ->label('audits.event', 'deployment.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteDeployment') - ->label('sdk.description', '/docs/references/functions/delete-deployment.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteDeployment', + description: '/docs/references/functions/delete-deployment.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1562,14 +1698,22 @@ App::post('/v1/functions/:functionId/deployments/:deploymentId/build') ->groups(['api', 'functions']) ->desc('Rebuild deployment') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].deployments.[deploymentId].update') ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createBuild') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createBuild', + description: '/docs/references/functions/create-build.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->param('buildId', '', new UID(), 'Build unique ID.', true) // added as optional param for backward compatibility @@ -1630,14 +1774,21 @@ App::patch('/v1/functions/:functionId/deployments/:deploymentId/build') ->groups(['api', 'functions']) ->desc('Cancel deployment') ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'deployment.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateDeploymentBuild') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUILD) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateDeploymentBuild', + description: '/docs/references/functions/update-deployment-build.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUILD, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') @@ -1719,33 +1870,40 @@ App::post('/v1/functions/:functionId/executions') ->groups(['api', 'functions']) ->desc('Create execution') ->label('scope', 'execution.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].executions.[executionId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createExecution') - ->label('sdk.description', '/docs/references/functions/create-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_MULTIPART) - ->label('sdk.response.model', Response::MODEL_EXECUTION) - ->label('sdk.request.type', Response::CONTENT_TYPE_JSON) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], + contentType: ContentType::MULTIPART, + requestType: 'application/json', + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('body', '', new Text(10485760, 0), 'HTTP body of execution. Default value is empty string.', true) ->param('async', false, new Boolean(true), 'Execute code in the background. Default value is false.', true) ->param('path', '/', new Text(2048), 'HTTP path of execution. Path can include query params. Default value is /', true) ->param('method', 'POST', new Whitelist(['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], true), 'HTTP method of execution. Default value is GET.', true) ->param('headers', [], new AnyOf([new Assoc(), new Text(65535)], AnyOf::TYPE_MIXED), 'HTTP headers of execution. Defaults to empty.', true) - ->param('scheduledAt', null, new DatetimeValidator(true, DateTimeValidator::PRECISION_MINUTES, 60), 'Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.', true) + ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true, precision: DateTimeValidator::PRECISION_MINUTES, offset: 60), 'Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.', true) ->inject('response') ->inject('request') ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('user') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('queueForFunctions') ->inject('geodb') - ->action(function (string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForConsole, Document $user, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { + ->action(function (string $functionId, string $body, mixed $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForPlatform, Document $user, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { $async = \strval($async) === 'true' || \strval($async) === '1'; if (!$async && !is_null($scheduledAt)) { @@ -1936,7 +2094,7 @@ App::post('/v1/functions/:functionId/executions') 'userId' => $user->getId() ]; - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => ScheduleExecutions::getSupportedResource(), 'resourceId' => $execution->getId(), @@ -2121,13 +2279,19 @@ App::get('/v1/functions/:functionId/executions') ->groups(['api', 'functions']) ->desc('List executions') ->label('scope', 'execution.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listExecutions') - ->label('sdk.description', '/docs/references/functions/list-executions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listExecutions', + description: '/docs/references/functions/list-executions.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION_LIST, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2208,13 +2372,19 @@ App::get('/v1/functions/:functionId/executions/:executionId') ->groups(['api', 'functions']) ->desc('Get execution') ->label('scope', 'execution.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getExecution') - ->label('sdk.description', '/docs/references/functions/get-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EXECUTION) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getExecution', + description: '/docs/references/functions/get-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EXECUTION, + ) + ] + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') @@ -2255,22 +2425,30 @@ App::delete('/v1/functions/:functionId/executions/:executionId') ->groups(['api', 'functions']) ->desc('Delete execution') ->label('scope', 'execution.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('event', 'functions.[functionId].executions.[executionId].delete') ->label('audits.event', 'executions.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteExecution') - ->label('sdk.description', '/docs/references/functions/delete-execution.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteExecution', + description: '/docs/references/functions/delete-execution.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('functionId', '', new UID(), 'Function ID.') ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForEvents') - ->action(function (string $functionId, string $executionId, Response $response, Database $dbForProject, Database $dbForConsole, Event $queueForEvents) { + ->action(function (string $functionId, string $executionId, Response $response, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { @@ -2296,18 +2474,18 @@ App::delete('/v1/functions/:functionId/executions/:executionId') } if ($status === 'scheduled') { - $schedule = $dbForConsole->findOne('schedules', [ + $schedule = $dbForPlatform->findOne('schedules', [ Query::equal('resourceId', [$execution->getId()]), Query::equal('resourceType', [ScheduleExecutions::getSupportedResource()]), Query::equal('active', [true]), ]); - if ($schedule && !$schedule->isEmpty()) { + if (!$schedule->isEmpty()) { $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('active', false); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); } } @@ -2325,23 +2503,29 @@ App::post('/v1/functions/:functionId/variables') ->desc('Create variable') ->groups(['api', 'functions']) ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.create') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/functions/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'createVariable', + description: '/docs/references/functions/create-variable.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) ->param('secret', false, new Boolean(), 'Is secret? Secret variables can only be updated or deleted, they cannot be read.', true) ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (string $functionId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $functionId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Database $dbForPlatform) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { @@ -2375,12 +2559,12 @@ App::post('/v1/functions/:functionId/variables') $dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('live', false)); // Inform scheduler to pull the latest changes - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -2391,13 +2575,22 @@ App::get('/v1/functions/:functionId/variables') ->desc('List variables') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/functions/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label( + 'sdk', + new Method( + namespace: 'functions', + name: 'listVariables', + description: '/docs/references/functions/list-variables.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ], + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->inject('response') ->inject('dbForProject') @@ -2418,13 +2611,22 @@ App::get('/v1/functions/:functionId/variables/:variableId') ->desc('Get variable') ->groups(['api', 'functions']) ->label('scope', 'functions.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/functions/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label( + 'sdk', + new Method( + namespace: 'functions', + name: 'getVariable', + description: '/docs/references/functions/get-variable.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ], + ) + ) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') @@ -2457,23 +2659,29 @@ App::put('/v1/functions/:functionId/variables/:variableId') ->desc('Update variable') ->groups(['api', 'functions']) ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.update') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/functions/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'updateVariable', + description: '/docs/references/functions/update-variable.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true) ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (string $functionId, string $variableId, string $key, ?string $value, Response $response, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $functionId, string $variableId, string $key, ?string $value, Response $response, Database $dbForProject, Database $dbForPlatform) { $function = $dbForProject->getDocument('functions', $functionId); @@ -2504,12 +2712,12 @@ App::put('/v1/functions/:functionId/variables/:variableId') $dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('live', false)); // Inform scheduler to pull the latest changes - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response->dynamic($variable, Response::MODEL_VARIABLE); }); @@ -2518,20 +2726,28 @@ App::delete('/v1/functions/:functionId/variables/:variableId') ->desc('Delete variable') ->groups(['api', 'functions']) ->label('scope', 'functions.write') + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) ->label('audits.event', 'variable.delete') ->label('audits.resource', 'function/{request.functionId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/functions/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'functions', + name: 'deleteVariable', + description: '/docs/references/functions/delete-variable.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('functionId', '', new UID(), 'Function unique ID.', false) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (string $functionId, string $variableId, Response $response, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $functionId, string $variableId, Response $response, Database $dbForProject, Database $dbForPlatform) { $function = $dbForProject->getDocument('functions', $functionId); if ($function->isEmpty()) { @@ -2552,12 +2768,12 @@ App::delete('/v1/functions/:functionId/variables/:variableId') $dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('live', false)); // Inform scheduler to pull the latest changes - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $response->noContent(); }); @@ -2566,13 +2782,19 @@ App::get('/v1/functions/templates') ->groups(['api']) ->desc('List function templates') ->label('scope', 'public') - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'listTemplates') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/list-templates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION_LIST) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'listTemplates', + description: '/docs/references/functions/list-templates.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION_LIST, + ) + ] + )) ->param('runtimes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('runtimes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of runtimes allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' runtimes are allowed.', true) ->param('useCases', [], new ArrayList(new WhiteList(['dev-tools','starter','databases','ai','messaging','utilities']), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of use cases allowed for filtering function templates. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' use cases are allowed.', true) ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) @@ -2603,21 +2825,29 @@ App::get('/v1/functions/templates') App::get('/v1/functions/templates/:templateId') ->desc('Get function template') ->label('scope', 'public') - ->label('sdk.namespace', 'functions') - ->label('sdk.method', 'getTemplate') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.description', '/docs/references/functions/get-template.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEMPLATE_FUNCTION) + ->label('resourceType', RESOURCE_TYPE_FUNCTIONS) + ->label('sdk', new Method( + namespace: 'functions', + name: 'getTemplate', + description: '/docs/references/functions/get-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEMPLATE_FUNCTION, + ) + ] + )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') ->action(function (string $templateId, Response $response) { $templates = Config::getParam('function-templates', []); - $template = array_shift(\array_filter($templates, function ($template) use ($templateId) { + $filtered = \array_filter($templates, function ($template) use ($templateId) { return $template['id'] === $templateId; - })); + }); + + $template = array_shift($filtered); if (empty($template)) { throw new Exception(Exception::FUNCTION_TEMPLATE_NOT_FOUND); diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index f79f433b5c..72951b608e 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -5,6 +5,10 @@ use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\GraphQL\Promises\Adapter; use Appwrite\GraphQL\Schema; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use GraphQL\Error\DebugFlag; @@ -38,13 +42,19 @@ App::get('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.hide', true) - ->label('sdk.description', '/docs/references/graphql/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'get', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + hide: true, + description: '/docs/references/graphql/get.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ] + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->param('query', '', new Text(0, 0), 'The query to execute.') @@ -78,17 +88,22 @@ App::post('/v1/graphql/mutation') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'mutation') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'mutation', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], + type: MethodType::GRAPHQL, + additionalParameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') @@ -123,17 +138,22 @@ App::post('/v1/graphql') ->desc('GraphQL endpoint') ->groups(['graphql']) ->label('scope', 'graphql') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'graphql') - ->label('sdk.method', 'query') - ->label('sdk.methodType', 'graphql') - ->label('sdk.description', '/docs/references/graphql/post.md') - ->label('sdk.parameters', [ - 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], - ]) - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_ANY) + ->label('sdk', new Method( + namespace: 'graphql', + name: 'query', + auth: [AuthType::KEY, AuthType::SESSION, AuthType::JWT], + description: '/docs/references/graphql/post.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_ANY, + ) + ], + type: MethodType::GRAPHQL, + additionalParameters: [ + 'query' => ['default' => [], 'validator' => new JSON(), 'description' => 'The query or queries to execute.', 'optional' => false], + ], + )) ->label('abuse-limit', 60) ->label('abuse-time', 60) ->inject('request') diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index f4581df8e4..1db4713311 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -3,6 +3,10 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; @@ -26,13 +30,19 @@ App::get('/v1/health') ->desc('Get HTTP') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/health/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + namespace: 'health', + name: 'get', + auth: [AuthType::KEY], + description: '/docs/references/health/get.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -49,9 +59,6 @@ App::get('/v1/health/version') ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_VERSION) ->inject('response') ->action(function (Response $response) { $response->dynamic(new Document([ 'version' => APP_VERSION_STABLE ]), Response::MODEL_HEALTH_VERSION); @@ -61,13 +68,19 @@ App::get('/v1/health/db') ->desc('Get DB') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getDB') - ->label('sdk.description', '/docs/references/health/get-db.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getDB', + description: '/docs/references/health/get-db.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -115,13 +128,19 @@ App::get('/v1/health/cache') ->desc('Get cache') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCache') - ->label('sdk.description', '/docs/references/health/get-cache.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCache', + description: '/docs/references/health/get-cache.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -135,6 +154,7 @@ App::get('/v1/health/cache') foreach ($configs as $key => $config) { foreach ($config as $database) { try { + /** @var \Utopia\Cache\Adapter $adapter */ $adapter = $pools->get($database)->pop()->getResource(); $checkStart = \microtime(true); @@ -172,13 +192,19 @@ App::get('/v1/health/queue') ->desc('Get queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueue') - ->label('sdk.description', '/docs/references/health/get-queue.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueue', + description: '/docs/references/health/get-queue.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -191,11 +217,11 @@ App::get('/v1/health/queue') foreach ($configs as $key => $config) { foreach ($config as $database) { + $checkStart = \microtime(true); try { + /** @var Connection $adapter */ $adapter = $pools->get($database)->pop()->getResource(); - $checkStart = \microtime(true); - if ($adapter->ping()) { $output[] = new Document([ 'name' => $key . " ($database)", @@ -229,13 +255,19 @@ App::get('/v1/health/pubsub') ->desc('Get pubsub') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getPubSub') - ->label('sdk.description', '/docs/references/health/get-pubsub.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getPubSub', + description: '/docs/references/health/get-pubsub.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('pools') ->action(function (Response $response, Group $pools) { @@ -249,6 +281,7 @@ App::get('/v1/health/pubsub') foreach ($configs as $key => $config) { foreach ($config as $database) { try { + /** @var \Appwrite\PubSub\Adapter $adapter */ $adapter = $pools->get($database)->pop()->getResource(); $checkStart = \microtime(true); @@ -286,13 +319,19 @@ App::get('/v1/health/time') ->desc('Get time') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getTime') - ->label('sdk.description', '/docs/references/health/get-time.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_TIME) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getTime', + description: '/docs/references/health/get-time.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_TIME, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -343,13 +382,19 @@ App::get('/v1/health/queue/webhooks') ->desc('Get webhooks queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueWebhooks') - ->label('sdk.description', '/docs/references/health/get-queue-webhooks.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueWebhooks', + description: '/docs/references/health/get-queue-webhooks.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -370,13 +415,19 @@ App::get('/v1/health/queue/logs') ->desc('Get logs queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueLogs') - ->label('sdk.description', '/docs/references/health/get-queue-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueLogs', + description: '/docs/references/health/get-queue-logs.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -397,13 +448,19 @@ App::get('/v1/health/certificate') ->desc('Get the SSL certificate for a domain') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getCertificate') - ->label('sdk.description', '/docs/references/health/get-certificate.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_CERTIFICATE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getCertificate', + description: '/docs/references/health/get-certificate.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_CERTIFICATE, + ) + ], + contentType: ContentType::JSON + )) ->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name') ->inject('response') ->action(function (string $domain, Response $response) { @@ -447,13 +504,19 @@ App::get('/v1/health/queue/certificates') ->desc('Get certificates queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueCertificates') - ->label('sdk.description', '/docs/references/health/get-queue-certificates.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueCertificates', + description: '/docs/references/health/get-queue-certificates.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -474,13 +537,19 @@ App::get('/v1/health/queue/builds') ->desc('Get builds queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueBuilds') - ->label('sdk.description', '/docs/references/health/get-queue-builds.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueBuilds', + description: '/docs/references/health/get-queue-builds.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -501,13 +570,19 @@ App::get('/v1/health/queue/databases') ->desc('Get databases queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDatabases') - ->label('sdk.description', '/docs/references/health/get-queue-databases.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDatabases', + description: '/docs/references/health/get-queue-databases.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') @@ -529,13 +604,19 @@ App::get('/v1/health/queue/deletes') ->desc('Get deletes queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueDeletes') - ->label('sdk.description', '/docs/references/health/get-queue-deletes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueDeletes', + description: '/docs/references/health/get-queue-deletes.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -556,13 +637,19 @@ App::get('/v1/health/queue/mails') ->desc('Get mails queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMails') - ->label('sdk.description', '/docs/references/health/get-queue-mails.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMails', + description: '/docs/references/health/get-queue-mails.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -583,13 +670,19 @@ App::get('/v1/health/queue/messaging') ->desc('Get messaging queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMessaging') - ->label('sdk.description', '/docs/references/health/get-queue-messaging.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMessaging', + description: '/docs/references/health/get-queue-messaging.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -610,13 +703,19 @@ App::get('/v1/health/queue/migrations') ->desc('Get migrations queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueMigrations') - ->label('sdk.description', '/docs/references/health/get-queue-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueMigrations', + description: '/docs/references/health/get-queue-migrations.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -637,13 +736,19 @@ App::get('/v1/health/queue/functions') ->desc('Get functions queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueFunctions') - ->label('sdk.description', '/docs/references/health/get-queue-functions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueFunctions', + description: '/docs/references/health/get-queue-functions.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -664,13 +769,19 @@ App::get('/v1/health/queue/usage') ->desc('Get usage queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsage') - ->label('sdk.description', '/docs/references/health/get-queue-usage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsage', + description: '/docs/references/health/get-queue-usage.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -691,13 +802,19 @@ App::get('/v1/health/queue/usage-dump') ->desc('Get usage dump queue') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getQueueUsageDump') - ->label('sdk.description', '/docs/references/health/get-queue-usage-dump.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getQueueUsageDump', + description: '/docs/references/health/get-queue-usage-dump.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('queue') ->inject('response') @@ -718,13 +835,19 @@ App::get('/v1/health/storage/local') ->desc('Get local storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorageLocal') - ->label('sdk.description', '/docs/references/health/get-storage-local.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorageLocal', + description: '/docs/references/health/get-storage-local.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -761,13 +884,19 @@ App::get('/v1/health/storage') ->desc('Get storage') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getStorage') - ->label('sdk.description', '/docs/references/health/get-storage.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_STATUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getStorage', + description: '/docs/references/health/get-storage.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_STATUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->inject('deviceForFiles') ->inject('deviceForFunctions') @@ -802,13 +931,19 @@ App::get('/v1/health/anti-virus') ->desc('Get antivirus') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getAntivirus') - ->label('sdk.description', '/docs/references/health/get-storage-anti-virus.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_ANTIVIRUS) + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getAntivirus', + description: '/docs/references/health/get-storage-anti-virus.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_ANTIVIRUS, + ) + ], + contentType: ContentType::JSON + )) ->inject('response') ->action(function (Response $response) { @@ -841,9 +976,19 @@ App::get('/v1/health/queue/failed/:name') ->desc('Get number of failed queue jobs') ->groups(['api', 'health']) ->label('scope', 'health.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'health') - ->label('sdk.method', 'getFailedJobs') + ->label('sdk', new Method( + auth: [AuthType::KEY], + namespace: 'health', + name: 'getFailedJobs', + description: '/docs/references/health/get-failed-queue-jobs.md', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_HEALTH_QUEUE, + ) + ], + contentType: ContentType::JSON + )) ->param('name', '', new WhiteList([ Event::DATABASE_QUEUE_NAME, Event::DELETE_QUEUE_NAME, @@ -859,10 +1004,6 @@ App::get('/v1/health/queue/failed/:name') Event::MIGRATIONS_QUEUE_NAME ]), 'The name of the queue') ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->label('sdk.description', '/docs/references/health/get-failed-queue-jobs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_HEALTH_QUEUE) ->inject('response') ->inject('queue') ->action(function (string $name, int|string $threshold, Response $response, Connection $queue) { diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index 2917bc8416..5b4c1ac47f 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -1,5 +1,8 @@ <?php +use Appwrite\SDK\AuthType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use MaxMind\Db\Reader; @@ -12,15 +15,18 @@ App::get('/v1/locale') ->desc('Get user locale') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/locale/get-locale.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE) - ->label('sdk.offline.model', '/localed') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'get', + description: '/docs/references/locale/get-locale.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE, + ) + ] + )) ->inject('request') ->inject('response') ->inject('locale') @@ -63,7 +69,7 @@ App::get('/v1/locale') $response ->addHeader('Cache-Control', 'public, max-age=' . $time) - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $time) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ; $response->dynamic(new Document($output), Response::MODEL_LOCALE); }); @@ -72,15 +78,18 @@ App::get('/v1/locale/codes') ->desc('List locale codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCodes') - ->label('sdk.description', '/docs/references/locale/list-locale-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOCALE_CODE_LIST) - ->label('sdk.offline.model', '/locale/localeCode') - ->label('sdk.offline.key', 'current') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCodes', + description: '/docs/references/locale/list-locale-codes.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOCALE_CODE_LIST, + ) + ] + )) ->inject('response') ->action(function (Response $response) { $codes = Config::getParam('locale-codes'); @@ -94,15 +103,18 @@ App::get('/v1/locale/countries') ->desc('List countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountries') - ->label('sdk.description', '/docs/references/locale/list-countries.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountries', + description: '/docs/references/locale/list-countries.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ] + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -127,15 +139,18 @@ App::get('/v1/locale/countries/eu') ->desc('List EU countries') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesEU') - ->label('sdk.description', '/docs/references/locale/list-countries-eu.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_COUNTRY_LIST) - ->label('sdk.offline.model', '/locale/countries/eu') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesEU', + description: '/docs/references/locale/list-countries-eu.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_COUNTRY_LIST, + ) + ] + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -162,15 +177,18 @@ App::get('/v1/locale/countries/phones') ->desc('List countries phone codes') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCountriesPhones') - ->label('sdk.description', '/docs/references/locale/list-countries-phones.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PHONE_LIST) - ->label('sdk.offline.model', '/locale/countries/phones') - ->label('sdk.offline.response.key', 'countryCode') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCountriesPhones', + description: '/docs/references/locale/list-countries-phones.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PHONE_LIST, + ) + ] + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -196,15 +214,18 @@ App::get('/v1/locale/continents') ->desc('List continents') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listContinents') - ->label('sdk.description', '/docs/references/locale/list-continents.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CONTINENT_LIST) - ->label('sdk.offline.model', '/locale/continents') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listContinents', + description: '/docs/references/locale/list-continents.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CONTINENT_LIST, + ) + ] + )) ->inject('response') ->inject('locale') ->action(function (Response $response, Locale $locale) { @@ -228,15 +249,18 @@ App::get('/v1/locale/currencies') ->desc('List currencies') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listCurrencies') - ->label('sdk.description', '/docs/references/locale/list-currencies.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_CURRENCY_LIST) - ->label('sdk.offline.model', '/locale/currencies') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listCurrencies', + description: '/docs/references/locale/list-currencies.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_CURRENCY_LIST, + ) + ] + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-currencies'); @@ -251,15 +275,18 @@ App::get('/v1/locale/languages') ->desc('List languages') ->groups(['api', 'locale']) ->label('scope', 'locale.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'locale') - ->label('sdk.method', 'listLanguages') - ->label('sdk.description', '/docs/references/locale/list-languages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LANGUAGE_LIST) - ->label('sdk.offline.model', '/locale/languages') - ->label('sdk.offline.response.key', 'code') + ->label('sdk', new Method( + namespace: 'locale', + name: 'listLanguages', + description: '/docs/references/locale/list-languages.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LANGUAGE_LIST, + ) + ] + )) ->inject('response') ->action(function (Response $response) { $list = Config::getParam('locale-languages'); diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index c68ba91297..d7d3750ccf 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -11,6 +11,10 @@ use Appwrite\Messaging\Status as MessageStatus; use Appwrite\Network\Validator\Email; use Appwrite\Permission; use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Messages; @@ -56,13 +60,19 @@ App::post('/v1/messaging/providers/mailgun') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/create-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMailgunProvider', + description: '/docs/references/messaging/create-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -143,13 +153,19 @@ App::post('/v1/messaging/providers/sendgrid') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/create-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSendgridProvider', + description: '/docs/references/messaging/create-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('apiKey', '', new Text(0), 'Sendgrid API key.', true) @@ -218,13 +234,19 @@ App::post('/v1/messaging/providers/smtp') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/create-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSmtpProvider', + description: '/docs/references/messaging/create-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.') @@ -305,14 +327,20 @@ App::post('/v1/messaging/providers/msg91') ->label('audits.event', 'provider.create') ->label('audits.resource', 'provider/{response.$id}') ->label('scope', 'providers.write') + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) ->label('event', 'providers.[providerId].create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/create-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createMsg91Provider', + description: '/docs/references/messaging/create-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('templateId', '', new Text(0), 'Msg91 template ID', true) @@ -382,13 +410,19 @@ App::post('/v1/messaging/providers/telesign') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/create-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTelesignProvider', + description: '/docs/references/messaging/create-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -459,13 +493,19 @@ App::post('/v1/messaging/providers/textmagic') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/create-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTextmagicProvider', + description: '/docs/references/messaging/create-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -536,13 +576,19 @@ App::post('/v1/messaging/providers/twilio') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/create-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTwilioProvider', + description: '/docs/references/messaging/create-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -613,13 +659,19 @@ App::post('/v1/messaging/providers/vonage') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createVonageProvider') - ->label('sdk.description', '/docs/references/messaging/create-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createVonageProvider', + description: '/docs/references/messaging/create-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('from', '', new Phone(), 'Sender Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -690,13 +742,19 @@ App::post('/v1/messaging/providers/fcm') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createFcmProvider') - ->label('sdk.description', '/docs/references/messaging/create-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createFcmProvider', + description: '/docs/references/messaging/create-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('serviceAccountJSON', null, new JSON(), 'FCM service account JSON.', true) @@ -753,13 +811,19 @@ App::post('/v1/messaging/providers/apns') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].create') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createApnsProvider') - ->label('sdk.description', '/docs/references/messaging/create-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createApnsProvider', + description: '/docs/references/messaging/create-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new CustomId(), 'Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Provider name.') ->param('authKey', '', new Text(0), 'APNS authentication key.', true) @@ -836,13 +900,19 @@ App::get('/v1/messaging/providers') ->desc('List providers') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviders') - ->label('sdk.description', '/docs/references/messaging/list-providers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_LIST) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviders', + description: '/docs/references/messaging/list-providers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_LIST, + ) + ] + )) ->param('queries', [], new Providers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -892,13 +962,19 @@ App::get('/v1/messaging/providers/:providerId/logs') ->desc('List provider logs') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listProviderLogs') - ->label('sdk.description', '/docs/references/messaging/list-provider-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listProviderLogs', + description: '/docs/references/messaging/list-provider-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -980,13 +1056,19 @@ App::get('/v1/messaging/providers/:providerId') ->desc('Get provider') ->groups(['api', 'messaging']) ->label('scope', 'providers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getProvider') - ->label('sdk.description', '/docs/references/messaging/get-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getProvider', + description: '/docs/references/messaging/get-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('dbForProject') ->inject('response') @@ -1007,13 +1089,19 @@ App::patch('/v1/messaging/providers/mailgun/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMailgunProvider') - ->label('sdk.description', '/docs/references/messaging/update-mailgun-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMailgunProvider', + description: '/docs/references/messaging/update-mailgun-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('apiKey', '', new Text(0), 'Mailgun API Key.', true) @@ -1113,13 +1201,19 @@ App::patch('/v1/messaging/providers/sendgrid/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSendgridProvider') - ->label('sdk.description', '/docs/references/messaging/update-sendgrid-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSendgridProvider', + description: '/docs/references/messaging/update-sendgrid-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1204,13 +1298,19 @@ App::patch('/v1/messaging/providers/smtp/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSmtpProvider') - ->label('sdk.description', '/docs/references/messaging/update-smtp-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSmtpProvider', + description: '/docs/references/messaging/update-smtp-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('host', '', new Text(0), 'SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls://smtp1.example.com:587;ssl://smtp2.example.com:465"`. Hosts will be tried in order.', true) @@ -1326,13 +1426,19 @@ App::patch('/v1/messaging/providers/msg91/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateMsg91Provider') - ->label('sdk.description', '/docs/references/messaging/update-msg91-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateMsg91Provider', + description: '/docs/references/messaging/update-msg91-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1406,13 +1512,19 @@ App::patch('/v1/messaging/providers/telesign/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTelesignProvider') - ->label('sdk.description', '/docs/references/messaging/update-telesign-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTelesignProvider', + description: '/docs/references/messaging/update-telesign-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1488,13 +1600,19 @@ App::patch('/v1/messaging/providers/textmagic/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTextmagicProvider') - ->label('sdk.description', '/docs/references/messaging/update-textmagic-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTextmagicProvider', + description: '/docs/references/messaging/update-textmagic-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1570,13 +1688,19 @@ App::patch('/v1/messaging/providers/twilio/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTwilioProvider') - ->label('sdk.description', '/docs/references/messaging/update-twilio-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTwilioProvider', + description: '/docs/references/messaging/update-twilio-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1652,13 +1776,19 @@ App::patch('/v1/messaging/providers/vonage/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateVonageProvider') - ->label('sdk.description', '/docs/references/messaging/update-vonage-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateVonageProvider', + description: '/docs/references/messaging/update-vonage-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1734,13 +1864,19 @@ App::patch('/v1/messaging/providers/fcm/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateFcmProvider') - ->label('sdk.description', '/docs/references/messaging/update-fcm-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateFcmProvider', + description: '/docs/references/messaging/update-fcm-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1803,13 +1939,19 @@ App::patch('/v1/messaging/providers/apns/:providerId') ->label('audits.resource', 'provider/{response.$id}') ->label('event', 'providers.[providerId].update') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateApnsProvider') - ->label('sdk.description', '/docs/references/messaging/update-apns-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateApnsProvider', + description: '/docs/references/messaging/update-apns-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER, + ) + ] + )) ->param('providerId', '', new UID(), 'Provider ID.') ->param('name', '', new Text(128), 'Provider name.', true) ->param('enabled', null, new Boolean(), 'Set as enabled.', true) @@ -1898,13 +2040,20 @@ App::delete('/v1/messaging/providers/:providerId') ->label('audits.resource', 'provider/{request.$providerId}') ->label('event', 'providers.[providerId].delete') ->label('scope', 'providers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteProvider') - ->label('sdk.description', '/docs/references/messaging/delete-provider.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('resourceType', RESOURCE_TYPE_PROVIDERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteProvider', + description: '/docs/references/messaging/delete-provider.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('providerId', '', new UID(), 'Provider ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -1933,13 +2082,19 @@ App::post('/v1/messaging/topics') ->label('audits.resource', 'topic/{response.$id}') ->label('event', 'topics.[topicId].create') ->label('scope', 'topics.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createTopic') - ->label('sdk.description', '/docs/references/messaging/create-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createTopic', + description: '/docs/references/messaging/create-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOPIC, + ) + ] + )) ->param('topicId', '', new CustomId(), 'Topic ID. Choose a custom Topic ID or a new Topic ID.') ->param('name', '', new Text(128), 'Topic Name.') ->param('subscribe', [Role::users()], new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -1973,13 +2128,19 @@ App::get('/v1/messaging/topics') ->desc('List topics') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopics') - ->label('sdk.description', '/docs/references/messaging/list-topics.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC_LIST) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopics', + description: '/docs/references/messaging/list-topics.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC_LIST, + ) + ] + )) ->param('queries', [], new Topics(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Topics::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -2029,13 +2190,19 @@ App::get('/v1/messaging/topics/:topicId/logs') ->desc('List topic logs') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTopicLogs') - ->label('sdk.description', '/docs/references/messaging/list-topic-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTopicLogs', + description: '/docs/references/messaging/list-topic-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2118,13 +2285,19 @@ App::get('/v1/messaging/topics/:topicId') ->desc('Get topic') ->groups(['api', 'messaging']) ->label('scope', 'topics.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getTopic') - ->label('sdk.description', '/docs/references/messaging/get-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getTopic', + description: '/docs/references/messaging/get-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('dbForProject') ->inject('response') @@ -2146,13 +2319,19 @@ App::patch('/v1/messaging/topics/:topicId') ->label('audits.resource', 'topic/{response.$id}') ->label('event', 'topics.[topicId].update') ->label('scope', 'topics.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateTopic') - ->label('sdk.description', '/docs/references/messaging/update-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOPIC) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateTopic', + description: '/docs/references/messaging/update-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TOPIC, + ) + ] + )) ->param('topicId', '', new UID(), 'Topic ID.') ->param('name', null, new Text(128), 'Topic Name.', true) ->param('subscribe', null, new Roles(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 64 characters long.', true) @@ -2190,13 +2369,20 @@ App::delete('/v1/messaging/topics/:topicId') ->label('audits.resource', 'topic/{request.$topicId}') ->label('event', 'topics.[topicId].delete') ->label('scope', 'topics.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteTopic') - ->label('sdk.description', '/docs/references/messaging/delete-topic.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('resourceType', RESOURCE_TYPE_TOPICS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteTopic', + description: '/docs/references/messaging/delete-topic.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('topicId', '', new UID(), 'Topic ID.') ->inject('queueForEvents') ->inject('dbForProject') @@ -2230,13 +2416,19 @@ App::post('/v1/messaging/topics/:topicId/subscribers') ->label('audits.resource', 'subscriber/{response.$id}') ->label('event', 'topics.[topicId].subscribers.[subscriberId].create') ->label('scope', 'subscribers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSubscriber') - ->label('sdk.description', '/docs/references/messaging/create-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSubscriber', + description: '/docs/references/messaging/create-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SUBSCRIBER, + ) + ] + )) ->param('subscriberId', '', new CustomId(), 'Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.') ->param('topicId', '', new UID(), 'Topic ID. The topic ID to subscribe to.') ->param('targetId', '', new UID(), 'Target ID. The target ID to link to the specified Topic ID.') @@ -2323,13 +2515,19 @@ App::get('/v1/messaging/topics/:topicId/subscribers') ->desc('List subscribers') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscribers') - ->label('sdk.description', '/docs/references/messaging/list-subscribers.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER_LIST) + ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscribers', + description: '/docs/references/messaging/list-subscribers.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER_LIST, + ) + ] + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('queries', [], new Subscribers(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Providers::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -2402,13 +2600,19 @@ App::get('/v1/messaging/subscribers/:subscriberId/logs') ->desc('List subscriber logs') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listSubscriberLogs') - ->label('sdk.description', '/docs/references/messaging/list-subscriber-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listSubscriberLogs', + description: '/docs/references/messaging/list-subscriber-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] + )) ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -2491,13 +2695,19 @@ App::get('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->desc('Get subscriber') ->groups(['api', 'messaging']) ->label('scope', 'subscribers.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getSubscriber') - ->label('sdk.description', '/docs/references/messaging/get-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SUBSCRIBER) + ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getSubscriber', + description: '/docs/references/messaging/get-subscriber.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SUBSCRIBER, + ) + ] + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('dbForProject') @@ -2533,13 +2743,20 @@ App::delete('/v1/messaging/topics/:topicId/subscribers/:subscriberId') ->label('audits.resource', 'subscriber/{request.$subscriberId}') ->label('event', 'topics.[topicId].subscribers.[subscriberId].delete') ->label('scope', 'subscribers.write') - ->label('sdk.auth', [APP_AUTH_TYPE_JWT, APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'deleteSubscriber') - ->label('sdk.description', '/docs/references/messaging/delete-subscriber.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('resourceType', RESOURCE_TYPE_SUBSCRIBERS) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'deleteSubscriber', + description: '/docs/references/messaging/delete-subscriber.md', + auth: [AuthType::JWT, AuthType::SESSION, AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('topicId', '', new UID(), 'Topic ID. The topic ID subscribed to.') ->param('subscriberId', '', new UID(), 'Subscriber ID.') ->inject('queueForEvents') @@ -2592,13 +2809,19 @@ App::post('/v1/messaging/messages/email') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createEmail') - ->label('sdk.description', '/docs/references/messaging/create-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createEmail', + description: '/docs/references/messaging/create-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('subject', '', new Text(998), 'Email Subject.') ->param('content', '', new Text(64230), 'Email Content.') @@ -2613,11 +2836,11 @@ App::post('/v1/messaging/messages/email') ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $subject, string $content, array $topics, array $users, array $targets, array $cc, array $bcc, array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $subject, string $content, array $topics, array $users, array $targets, array $cc, array $bcc, array $attachments, bool $draft, bool $html, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -2706,7 +2929,7 @@ App::post('/v1/messaging/messages/email') ->setMessageId($message->getId()); break; case MessageStatus::SCHEDULED: - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -2744,13 +2967,19 @@ App::post('/v1/messaging/messages/sms') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createSms') - ->label('sdk.description', '/docs/references/messaging/create-sms.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createSms', + description: '/docs/references/messaging/create-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('content', '', new Text(64230), 'SMS Content.') ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) @@ -2760,11 +2989,11 @@ App::post('/v1/messaging/messages/sms') ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $content, array $topics, array $users, array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $content, array $topics, array $users, array $targets, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -2822,7 +3051,7 @@ App::post('/v1/messaging/messages/sms') ->setMessageId($message->getId()); break; case MessageStatus::SCHEDULED: - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -2860,36 +3089,45 @@ App::post('/v1/messaging/messages/push') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].create') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'createPush') - ->label('sdk.description', '/docs/references/messaging/create-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'createPush', + description: '/docs/references/messaging/create-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new CustomId(), 'Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') - ->param('title', '', new Text(256), 'Title for push notification.') - ->param('body', '', new Text(64230), 'Body for push notification.') + ->param('title', '', new Text(256), 'Title for push notification.', true) + ->param('body', '', new Text(64230), 'Body for push notification.', true) ->param('topics', [], new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', [], new ArrayList(new UID()), 'List of User IDs.', true) ->param('targets', [], new ArrayList(new UID()), 'List of Targets IDs.', true) - ->param('data', null, new JSON(), 'Additional Data for push notification.', true) + ->param('data', null, new JSON(), 'Additional key-value pair data for push notification.', true) ->param('action', '', new Text(256), 'Action for push notification.', true) ->param('image', '', new CompoundUID(), 'Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.', true) ->param('icon', '', new Text(256), 'Icon for push notification. Available only for Android and Web Platform.', true) - ->param('sound', '', new Text(256), 'Sound for push notification. Available only for Android and IOS Platform.', true) + ->param('sound', '', new Text(256), 'Sound for push notification. Available only for Android and iOS Platform.', true) ->param('color', '', new Text(256), 'Color for push notification. Available only for Android Platform.', true) ->param('tag', '', new Text(256), 'Tag for push notification. Available only for Android Platform.', true) - ->param('badge', '', new Text(256), 'Badge for push notification. Available only for IOS Platform.', true) + ->param('badge', -1, new Integer(), 'Badge for push notification. Available only for iOS Platform.', true) ->param('draft', false, new Boolean(), 'Is message a draft', true) ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) + ->param('contentAvailable', false, new Boolean(), 'If set to true, the notification will be delivered in the background. Available only for iOS Platform.', true) + ->param('critical', false, new Boolean(), 'If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.', true) + ->param('priority', 'high', new WhiteList(['normal', 'high']), 'Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, string $title, string $body, array $topics, array $users, array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, string $badge, bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, string $title, string $body, array $topics, array $users, array $targets, ?array $data, string $action, string $image, string $icon, string $sound, string $color, string $tag, int $badge, bool $draft, ?string $scheduledAt, bool $contentAvailable, bool $critical, string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $messageId = $messageId == 'unique()' ? ID::unique() : $messageId; @@ -2972,12 +3210,44 @@ App::post('/v1/messaging/messages/push') $pushData = []; - $keys = ['title', 'body', 'data', 'action', 'image', 'icon', 'sound', 'color', 'tag', 'badge']; - - foreach ($keys as $key) { - if (!empty($$key)) { - $pushData[$key] = $$key; - } + if (!empty($title)) { + $pushData['title'] = $title; + } + if (!empty($body)) { + $pushData['body'] = $body; + } + if (!empty($data)) { + $pushData['data'] = $data; + } + if (!empty($action)) { + $pushData['action'] = $action; + } + if (!empty($image)) { + $pushData['image'] = $image; + } + if (!empty($icon)) { + $pushData['icon'] = $icon; + } + if (!empty($sound)) { + $pushData['sound'] = $sound; + } + if (!empty($color)) { + $pushData['color'] = $color; + } + if (!empty($tag)) { + $pushData['tag'] = $tag; + } + if ($badge >= 0) { + $pushData['badge'] = $badge; + } + if ($contentAvailable) { + $pushData['contentAvailable'] = true; + } + if ($critical) { + $pushData['critical'] = true; + } + if (!empty($priority)) { + $pushData['priority'] = $priority; } $message = $dbForProject->createDocument('messages', new Document([ @@ -2998,7 +3268,7 @@ App::post('/v1/messaging/messages/push') ->setMessageId($message->getId()); break; case MessageStatus::SCHEDULED: - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -3033,13 +3303,19 @@ App::get('/v1/messaging/messages') ->desc('List messages') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessages') - ->label('sdk.description', '/docs/references/messaging/list-messages.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE_LIST) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessages', + description: '/docs/references/messaging/list-messages.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE_LIST, + ) + ], + )) ->param('queries', [], new Messages(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Messages::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('dbForProject') @@ -3089,13 +3365,19 @@ App::get('/v1/messaging/messages/:messageId/logs') ->desc('List message logs') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listMessageLogs') - ->label('sdk.description', '/docs/references/messaging/list-message-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listMessageLogs', + description: '/docs/references/messaging/list-message-logs.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ], + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -3178,13 +3460,19 @@ App::get('/v1/messaging/messages/:messageId/targets') ->desc('List message targets') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/messaging/list-message-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'listTargets', + description: '/docs/references/messaging/list-message-targets.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ], + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -3248,13 +3536,19 @@ App::get('/v1/messaging/messages/:messageId') ->desc('Get message') ->groups(['api', 'messaging']) ->label('scope', 'messages.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'getMessage') - ->label('sdk.description', '/docs/references/messaging/get-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'getMessage', + description: '/docs/references/messaging/get-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') ->inject('response') @@ -3275,13 +3569,19 @@ App::patch('/v1/messaging/messages/email/:messageId') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateEmail', + description: '/docs/references/messaging/update-email.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3296,11 +3596,11 @@ App::patch('/v1/messaging/messages/email/:messageId') ->param('attachments', null, new ArrayList(new CompoundUID()), 'Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $subject, ?string $content, ?bool $draft, ?bool $html, ?array $cc, ?array $bcc, ?string $scheduledAt, ?array $attachments, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $subject, ?string $content, ?bool $draft, ?bool $html, ?array $cc, ?array $bcc, ?string $scheduledAt, ?array $attachments, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $message = $dbForProject->getDocument('messages', $messageId); if ($message->isEmpty()) { @@ -3352,7 +3652,7 @@ App::patch('/v1/messaging/messages/email/:messageId') } if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -3367,7 +3667,7 @@ App::patch('/v1/messaging/messages/email/:messageId') } if (!\is_null($currentScheduledAt)) { - $schedule = $dbForConsole->getDocument('schedules', $message->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $message->getAttribute('scheduleId')); $scheduledStatus = ($status ?? $message->getAttribute('status')) === MessageStatus::SCHEDULED; if ($schedule->isEmpty()) { @@ -3382,7 +3682,7 @@ App::patch('/v1/messaging/messages/email/:messageId') $schedule->setAttribute('schedule', $scheduledAt); } - $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule); + $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule); } if (!\is_null($scheduledAt)) { @@ -3475,13 +3775,19 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updateSms') - ->label('sdk.description', '/docs/references/messaging/update-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updateSms', + description: '/docs/references/messaging/update-sms.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3491,11 +3797,11 @@ App::patch('/v1/messaging/messages/sms/:messageId') ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $content, ?bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $content, ?bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $message = $dbForProject->getDocument('messages', $messageId); if ($message->isEmpty()) { @@ -3547,7 +3853,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') } if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -3562,7 +3868,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') } if (!\is_null($currentScheduledAt)) { - $schedule = $dbForConsole->getDocument('schedules', $message->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $message->getAttribute('scheduleId')); $scheduledStatus = ($status ?? $message->getAttribute('status')) === MessageStatus::SCHEDULED; if ($schedule->isEmpty()) { @@ -3577,7 +3883,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') $schedule->setAttribute('schedule', $scheduledAt); } - $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule); + $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule); } if (!\is_null($scheduledAt)) { @@ -3630,13 +3936,19 @@ App::patch('/v1/messaging/messages/push/:messageId') ->label('audits.resource', 'message/{response.$id}') ->label('event', 'messages.[messageId].update') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'updatePush') - ->label('sdk.description', '/docs/references/messaging/update-push.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MESSAGE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'updatePush', + description: '/docs/references/messaging/update-push.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MESSAGE, + ) + ] + )) ->param('messageId', '', new UID(), 'Message ID.') ->param('topics', null, new ArrayList(new UID()), 'List of Topic IDs.', true) ->param('users', null, new ArrayList(new UID()), 'List of User IDs.', true) @@ -3653,13 +3965,16 @@ App::patch('/v1/messaging/messages/push/:messageId') ->param('badge', null, new Integer(), 'Badge for push notification. Available only for iOS platforms.', true) ->param('draft', null, new Boolean(), 'Is message a draft', true) ->param('scheduledAt', null, new DatetimeValidator(requireDateInFuture: true), 'Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.', true) + ->param('contentAvailable', null, new Boolean(), 'If set to true, the notification will be delivered in the background. Available only for iOS Platform.', true) + ->param('critical', null, new Boolean(), 'If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.', true) + ->param('priority', null, new WhiteList(['normal', 'high']), 'Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.', true) ->inject('queueForEvents') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('project') ->inject('queueForMessaging') ->inject('response') - ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $title, ?string $body, ?array $data, ?string $action, ?string $image, ?string $icon, ?string $sound, ?string $color, ?string $tag, ?int $badge, ?bool $draft, ?string $scheduledAt, Event $queueForEvents, Database $dbForProject, Database $dbForConsole, Document $project, Messaging $queueForMessaging, Response $response) { + ->action(function (string $messageId, ?array $topics, ?array $users, ?array $targets, ?string $title, ?string $body, ?array $data, ?string $action, ?string $image, ?string $icon, ?string $sound, ?string $color, ?string $tag, ?int $badge, ?bool $draft, ?string $scheduledAt, ?bool $contentAvailable, ?bool $critical, ?string $priority, Event $queueForEvents, Database $dbForProject, Database $dbForPlatform, Document $project, Messaging $queueForMessaging, Response $response) { $message = $dbForProject->getDocument('messages', $messageId); if ($message->isEmpty()) { @@ -3711,7 +4026,7 @@ App::patch('/v1/messaging/messages/push/:messageId') } if (\is_null($currentScheduledAt) && !\is_null($scheduledAt)) { - $schedule = $dbForConsole->createDocument('schedules', new Document([ + $schedule = $dbForPlatform->createDocument('schedules', new Document([ 'region' => System::getEnv('_APP_REGION', 'default'), 'resourceType' => 'message', 'resourceId' => $message->getId(), @@ -3726,7 +4041,7 @@ App::patch('/v1/messaging/messages/push/:messageId') } if (!\is_null($currentScheduledAt)) { - $schedule = $dbForConsole->getDocument('schedules', $message->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $message->getAttribute('scheduleId')); $scheduledStatus = ($status ?? $message->getAttribute('status')) === MessageStatus::SCHEDULED; if ($schedule->isEmpty()) { @@ -3741,7 +4056,7 @@ App::patch('/v1/messaging/messages/push/:messageId') $schedule->setAttribute('schedule', $scheduledAt); } - $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule); + $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule); } if (!\is_null($scheduledAt)) { @@ -3798,6 +4113,18 @@ App::patch('/v1/messaging/messages/push/:messageId') $pushData['badge'] = $badge; } + if (!\is_null($contentAvailable)) { + $pushData['contentAvailable'] = $contentAvailable; + } + + if (!\is_null($critical)) { + $pushData['critical'] = $critical; + } + + if (!\is_null($priority)) { + $pushData['priority'] = $priority; + } + if (!\is_null($image)) { [$bucketId, $fileId] = CompoundUID::parse($image); @@ -3868,19 +4195,26 @@ App::delete('/v1/messaging/messages/:messageId') ->label('audits.resource', 'message/{request.messageId}') ->label('event', 'messages.[messageId].delete') ->label('scope', 'messages.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN, APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'messaging') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/messaging/delete-message.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('resourceType', RESOURCE_TYPE_MESSAGES) + ->label('sdk', new Method( + namespace: 'messaging', + name: 'delete', + description: '/docs/references/messaging/delete-message.md', + auth: [AuthType::ADMIN, AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('messageId', '', new UID(), 'Message ID.') ->inject('dbForProject') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForEvents') ->inject('response') - ->action(function (string $messageId, Database $dbForProject, Database $dbForConsole, Event $queueForEvents, Response $response) { + ->action(function (string $messageId, Database $dbForProject, Database $dbForPlatform, Event $queueForEvents, Response $response) { $message = $dbForProject->getDocument('messages', $messageId); if ($message->isEmpty()) { @@ -3903,7 +4237,7 @@ App::delete('/v1/messaging/messages/:messageId') if (!empty($scheduleId)) { try { - $dbForConsole->deleteDocument('schedules', $scheduleId); + $dbForPlatform->deleteDocument('schedules', $scheduleId); } catch (Exception) { // Ignore } diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index a4880cef86..ac149ac8eb 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -1,17 +1,16 @@ <?php -use Appwrite\Auth\OAuth2\Firebase as OAuth2Firebase; use Appwrite\Event\Event; use Appwrite\Event\Migration; use Appwrite\Extend\Exception; -use Appwrite\Permission; -use Appwrite\Role; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Migrations; -use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; -use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Helpers\ID; @@ -22,9 +21,7 @@ use Utopia\Migration\Sources\Appwrite; use Utopia\Migration\Sources\Firebase; use Utopia\Migration\Sources\NHost; use Utopia\Migration\Sources\Supabase; -use Utopia\System\System; use Utopia\Validator\ArrayList; -use Utopia\Validator\Host; use Utopia\Validator\Integer; use Utopia\Validator\Text; use Utopia\Validator\URL; @@ -38,13 +35,18 @@ App::post('/v1/migrations/appwrite') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createAppwriteMigration') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createAppwriteMigration', + description: '/docs/references/migrations/migration-appwrite.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectId', '', new UID(), "Source's Project ID") @@ -87,122 +89,25 @@ App::post('/v1/migrations/appwrite') ->dynamic($migration, Response::MODEL_MIGRATION); }); -App::post('/v1/migrations/firebase/oauth') - ->groups(['api', 'migrations']) - ->desc('Migrate Firebase data (OAuth)') - ->label('scope', 'migrations.write') - ->label('event', 'migrations.[migrationId].create') - ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseOAuthMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) - ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') - ->param('projectId', '', new Text(65536), 'Project ID of the Firebase Project') - ->inject('response') - ->inject('dbForProject') - ->inject('dbForConsole') - ->inject('project') - ->inject('user') - ->inject('queueForEvents') - ->inject('queueForMigrations') - ->inject('request') - ->action(function (array $resources, string $projectId, Response $response, Database $dbForProject, Database $dbForConsole, Document $project, Document $user, Event $queueForEvents, Migration $queueForMigrations, Request $request) { - $firebase = new OAuth2Firebase( - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''), - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''), - $request->getProtocol() . '://' . $request->getHostname() . '/v1/migrations/firebase/redirect' - ); - - $identity = $dbForConsole->findOne('identities', [ - Query::equal('provider', ['firebase']), - Query::equal('userInternalId', [$user->getInternalId()]), - ]); - if ($identity === false || $identity->isEmpty()) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $accessToken = $identity->getAttribute('providerAccessToken'); - $refreshToken = $identity->getAttribute('providerRefreshToken'); - $accessTokenExpiry = $identity->getAttribute('providerAccessTokenExpiry'); - - $isExpired = new \DateTime($accessTokenExpiry) < new \DateTime('now'); - if ($isExpired) { - $firebase->refreshTokens($refreshToken); - - $accessToken = $firebase->getAccessToken(''); - $refreshToken = $firebase->getRefreshToken(''); - - $verificationId = $firebase->getUserID($accessToken); - - if (empty($verificationId)) { - throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED, 'Another request is currently refreshing OAuth token. Please try again.'); - } - - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$firebase->getAccessTokenExpiry(''))); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } - - if ($identity->getAttribute('secrets')) { - $serviceAccount = $identity->getAttribute('secrets'); - } else { - $firebase->cleanupServiceAccounts($accessToken, $projectId); - $serviceAccount = $firebase->createServiceAccount($accessToken, $projectId); - $identity = $identity - ->setAttribute('secrets', json_encode($serviceAccount)); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } - - $migration = $dbForProject->createDocument('migrations', new Document([ - '$id' => ID::unique(), - 'status' => 'pending', - 'stage' => 'init', - 'source' => Firebase::getName(), - 'destination' => Appwrite::getName(), - 'credentials' => [ - 'serviceAccount' => json_encode($serviceAccount), - ], - 'resources' => $resources, - 'statusCounters' => '{}', - 'resourceData' => '{}', - 'errors' => [] - ])); - - $queueForEvents->setParam('migrationId', $migration->getId()); - - // Trigger Transfer - $queueForMigrations - ->setMigration($migration) - ->setProject($project) - ->setUser($user) - ->trigger(); - - $response - ->setStatusCode(Response::STATUS_CODE_ACCEPTED) - ->dynamic($migration, Response::MODEL_MIGRATION); - }); App::post('/v1/migrations/firebase') ->groups(['api', 'migrations']) - ->desc('Migrate Firebase data (Service Account)') + ->desc('Migrate Firebase data') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-firebase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createFirebaseMigration', + description: '/docs/references/migrations/migration-firebase.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -257,13 +162,18 @@ App::post('/v1/migrations/supabase') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createSupabaseMigration') - ->label('sdk.description', '/docs/references/migrations/migration-supabase.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createSupabaseMigration', + description: '/docs/references/migrations/migration-supabase.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint') ->param('apiKey', '', new Text(512), 'Source\'s API Key') @@ -318,13 +228,18 @@ App::post('/v1/migrations/nhost') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createNHostMigration') - ->label('sdk.description', '/docs/references/migrations/migration-nhost.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'createNHostMigration', + description: '/docs/references/migrations/migration-nhost.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain') ->param('region', '', new Text(512), 'Source\'s Region') @@ -379,13 +294,18 @@ App::get('/v1/migrations') ->groups(['api', 'migrations']) ->desc('List migrations') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/migrations/list-migrations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_LIST) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'list', + description: '/docs/references/migrations/list-migrations.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_LIST, + ) + ] + )) ->param('queries', [], new Migrations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Migrations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -438,13 +358,18 @@ App::get('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) ->desc('Get migration') ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/migrations/get-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'get', + description: '/docs/references/migrations/get-migration.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -462,13 +387,18 @@ App::get('/v1/migrations/appwrite/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Appwrite data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getAppwriteReport') - ->label('sdk.description', '/docs/references/migrations/migration-appwrite-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getAppwriteReport', + description: '/docs/references/migrations/migration-appwrite-report.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Appwrite::getSupportedResources())), 'List of resources to migrate') ->param('endpoint', '', new URL(), "Source's Appwrite Endpoint") ->param('projectID', '', new Text(512), "Source's Project ID") @@ -504,13 +434,18 @@ App::get('/v1/migrations/firebase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Firebase data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getFirebaseReport', + description: '/docs/references/migrations/migration-firebase-report.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') ->param('serviceAccount', '', new Text(65536), 'JSON of the Firebase service account credentials') ->inject('response') @@ -547,379 +482,22 @@ App::get('/v1/migrations/firebase/report') ->dynamic(new Document($report), Response::MODEL_MIGRATION_REPORT); }); -App::get('/v1/migrations/firebase/report/oauth') - ->groups(['api', 'migrations']) - ->desc('Generate a report on Firebase data using OAuth') - ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getFirebaseReportOAuth') - ->label('sdk.description', '/docs/references/migrations/migration-firebase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) - ->param('resources', [], new ArrayList(new WhiteList(Firebase::getSupportedResources())), 'List of resources to migrate') - ->param('projectId', '', new Text(65536), 'Project ID') - ->inject('response') - ->inject('request') - ->inject('user') - ->inject('dbForConsole') - ->action(function (array $resources, string $projectId, Response $response, Request $request, Document $user, Database $dbForConsole) { - $firebase = new OAuth2Firebase( - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''), - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''), - $request->getProtocol() . '://' . $request->getHostname() . '/v1/migrations/firebase/redirect' - ); - - $identity = $dbForConsole->findOne('identities', [ - Query::equal('provider', ['firebase']), - Query::equal('userInternalId', [$user->getInternalId()]), - ]); - - if ($identity === false || $identity->isEmpty()) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $accessToken = $identity->getAttribute('providerAccessToken'); - $refreshToken = $identity->getAttribute('providerRefreshToken'); - $accessTokenExpiry = $identity->getAttribute('providerAccessTokenExpiry'); - - if (empty($accessToken) || empty($refreshToken) || empty($accessTokenExpiry)) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - if (System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', '') === '' || System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', '') === '') { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $isExpired = new \DateTime($accessTokenExpiry) < new \DateTime('now'); - if ($isExpired) { - $firebase->refreshTokens($refreshToken); - - $accessToken = $firebase->getAccessToken(''); - $refreshToken = $firebase->getRefreshToken(''); - - $verificationId = $firebase->getUserID($accessToken); - - if (empty($verificationId)) { - throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED, 'Another request is currently refreshing OAuth token. Please try again.'); - } - - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$firebase->getAccessTokenExpiry(''))); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } - - // Get Service Account - if ($identity->getAttribute('secrets')) { - $serviceAccount = $identity->getAttribute('secrets'); - } else { - $firebase->cleanupServiceAccounts($accessToken, $projectId); - $serviceAccount = $firebase->createServiceAccount($accessToken, $projectId); - $identity = $identity - ->setAttribute('secrets', json_encode($serviceAccount)); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } - - $firebase = new Firebase($serviceAccount); - - try { - $report = $firebase->report($resources); - } catch (\Throwable $e) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Source Error: ' . $e->getMessage()); - } - - $response - ->setStatusCode(Response::STATUS_CODE_OK) - ->dynamic(new Document($report), Response::MODEL_MIGRATION_REPORT); - }); - -App::get('/v1/migrations/firebase/connect') - ->desc('Authorize with Firebase') - ->groups(['api', 'migrations']) - ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'createFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) - ->param('redirect', '', fn ($clients) => new Host($clients), 'URL to redirect back to your Firebase authorization. Only console hostnames are allowed.', true, ['clients']) - ->param('projectId', '', new UID(), 'Project ID') - ->inject('response') - ->inject('request') - ->inject('user') - ->inject('dbForConsole') - ->action(function (string $redirect, string $projectId, Response $response, Request $request, Document $user, Database $dbForConsole) { - $state = \json_encode([ - 'projectId' => $projectId, - 'redirect' => $redirect, - ]); - - $prefs = $user->getAttribute('prefs', []); - $prefs['migrationState'] = $state; - $user->setAttribute('prefs', $prefs); - $dbForConsole->updateDocument('users', $user->getId(), $user); - - $oauth2 = new OAuth2Firebase( - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''), - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''), - $request->getProtocol() . '://' . $request->getHostname() . '/v1/migrations/firebase/redirect' - ); - $url = $oauth2->getLoginURL(); - - $response - ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') - ->addHeader('Pragma', 'no-cache') - ->redirect($url); - }); - -App::get('/v1/migrations/firebase/redirect') - ->desc('Capture and receive data on Firebase authorization') - ->groups(['api', 'migrations']) - ->label('scope', 'public') - ->label('error', __DIR__ . '/../../views/general/error.phtml') - ->param('code', '', new Text(2048), 'OAuth2 code. This is a temporary code that the will be later exchanged for an access token.', true) - ->inject('user') - ->inject('project') - ->inject('request') - ->inject('response') - ->inject('dbForConsole') - ->action(function (string $code, Document $user, Document $project, Request $request, Response $response, Database $dbForConsole) { - $state = $user['prefs']['migrationState'] ?? '{}'; - $prefs['migrationState'] = ''; - $user->setAttribute('prefs', $prefs); - $dbForConsole->updateDocument('users', $user->getId(), $user); - - if (empty($state)) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Installation requests from organisation members for the Appwrite Google App are currently unsupported.'); - } - - $state = \json_decode($state, true); - $redirect = $state['redirect'] ?? ''; - $projectId = $state['projectId'] ?? ''; - - $project = $dbForConsole->getDocument('projects', $projectId); - - if (empty($redirect)) { - $redirect = $request->getProtocol() . '://' . $request->getHostname() . '/console/project-$projectId/settings/migrations'; - } - - if ($project->isEmpty()) { - $response - ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') - ->addHeader('Pragma', 'no-cache') - ->redirect($redirect); - - return; - } - - // OAuth Authroization - if (!empty($code)) { - $oauth2 = new OAuth2Firebase( - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''), - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''), - $request->getProtocol() . '://' . $request->getHostname() . '/v1/migrations/firebase/redirect' - ); - - $accessToken = $oauth2->getAccessToken($code); - $refreshToken = $oauth2->getRefreshToken($code); - $accessTokenExpiry = $oauth2->getAccessTokenExpiry($code); - $email = $oauth2->getUserEmail($accessToken); - $oauth2ID = $oauth2->getUserID($accessToken); - - if (empty($accessToken)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to get access token.'); - } - - if (empty($refreshToken)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to get refresh token.'); - } - - if (empty($accessTokenExpiry)) { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to get access token expiry.'); - } - - // Makes sure this email is not already used in another identity - $identity = $dbForConsole->findOne('identities', [ - Query::equal('providerEmail', [$email]), - ]); - - if ($identity !== false && !$identity->isEmpty()) { - if ($identity->getAttribute('userInternalId', '') !== $user->getInternalId()) { - throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); - } - } - - if ($identity !== false && !$identity->isEmpty()) { - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$accessTokenExpiry)); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } else { - $identity = $dbForConsole->createDocument('identities', new Document([ - '$id' => ID::unique(), - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::user($user->getId())), - Permission::delete(Role::user($user->getId())), - ], - 'userInternalId' => $user->getInternalId(), - 'userId' => $user->getId(), - 'provider' => 'firebase', - 'providerUid' => $oauth2ID, - 'providerEmail' => $email, - 'providerAccessToken' => $accessToken, - 'providerRefreshToken' => $refreshToken, - 'providerAccessTokenExpiry' => DateTime::addSeconds(new \DateTime(), (int)$accessTokenExpiry), - ])); - } - } else { - throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Missing OAuth2 code.'); - } - - $response - ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') - ->addHeader('Pragma', 'no-cache') - ->redirect($redirect); - }); - -App::get('/v1/migrations/firebase/projects') - ->desc('List Firebase projects') - ->groups(['api', 'migrations']) - ->label('scope', 'migrations.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'listFirebaseProjects') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST) - ->inject('user') - ->inject('response') - ->inject('project') - ->inject('dbForConsole') - ->inject('request') - ->action(function (Document $user, Response $response, Document $project, Database $dbForConsole, Request $request) { - $firebase = new OAuth2Firebase( - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', ''), - System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', ''), - $request->getProtocol() . '://' . $request->getHostname() . '/v1/migrations/firebase/redirect' - ); - - $identity = $dbForConsole->findOne('identities', [ - Query::equal('provider', ['firebase']), - Query::equal('userInternalId', [$user->getInternalId()]), - ]); - - if ($identity === false || $identity->isEmpty()) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $accessToken = $identity->getAttribute('providerAccessToken'); - $refreshToken = $identity->getAttribute('providerRefreshToken'); - $accessTokenExpiry = $identity->getAttribute('providerAccessTokenExpiry'); - - if (empty($accessToken) || empty($refreshToken) || empty($accessTokenExpiry)) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - if (System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_ID', '') === '' || System::getEnv('_APP_MIGRATIONS_FIREBASE_CLIENT_SECRET', '') === '') { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - try { - $isExpired = new \DateTime($accessTokenExpiry) < new \DateTime('now'); - if ($isExpired) { - try { - $firebase->refreshTokens($refreshToken); - } catch (\Throwable $e) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $accessToken = $firebase->getAccessToken(''); - $refreshToken = $firebase->getRefreshToken(''); - - $verificationId = $firebase->getUserID($accessToken); - - if (empty($verificationId)) { - throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED, 'Another request is currently refreshing OAuth token. Please try again.'); - } - - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$firebase->getAccessTokenExpiry(''))); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } - - $projects = $firebase->getProjects($accessToken); - - $output = []; - foreach ($projects as $project) { - $output[] = [ - 'displayName' => $project['displayName'], - 'projectId' => $project['projectId'], - ]; - } - } catch (\Throwable $e) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } - - $response->dynamic(new Document([ - 'projects' => $output, - 'total' => count($output), - ]), Response::MODEL_MIGRATION_FIREBASE_PROJECT_LIST); - }); - -App::get('/v1/migrations/firebase/deauthorize') - ->desc('Revoke Appwrite\'s authorization to access Firebase projects') - ->groups(['api', 'migrations']) - ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'deleteFirebaseAuth') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->inject('user') - ->inject('response') - ->inject('dbForConsole') - ->action(function (Document $user, Response $response, Database $dbForConsole) { - $identity = $dbForConsole->findOne('identities', [ - Query::equal('provider', ['firebase']), - Query::equal('userInternalId', [$user->getInternalId()]), - ]); - - if ($identity === false || $identity->isEmpty()) { - throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Not authenticated with Firebase'); //TODO: Replace with USER_IDENTITY_NOT_FOUND - } - - $dbForConsole->deleteDocument('identities', $identity->getId()); - - $response->noContent(); - }); - App::get('/v1/migrations/supabase/report') ->groups(['api', 'migrations']) ->desc('Generate a report on Supabase Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getSupabaseReport') - ->label('sdk.description', '/docs/references/migrations/migration-supabase-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getSupabaseReport', + description: '/docs/references/migrations/migration-supabase-report.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(Supabase::getSupportedResources(), true)), 'List of resources to migrate') ->param('endpoint', '', new URL(), 'Source\'s Supabase Endpoint.') ->param('apiKey', '', new Text(512), 'Source\'s API Key.') @@ -956,13 +534,18 @@ App::get('/v1/migrations/nhost/report') ->groups(['api', 'migrations']) ->desc('Generate a report on NHost Data') ->label('scope', 'migrations.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'getNHostReport') - ->label('sdk.description', '/docs/references/migrations/migration-nhost-report.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION_REPORT) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'getNHostReport', + description: '/docs/references/migrations/migration-nhost-report.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MIGRATION_REPORT, + ) + ] + )) ->param('resources', [], new ArrayList(new WhiteList(NHost::getSupportedResources())), 'List of resources to migrate.') ->param('subdomain', '', new Text(512), 'Source\'s Subdomain.') ->param('region', '', new Text(512), 'Source\'s Region.') @@ -1002,13 +585,18 @@ App::patch('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].retry') ->label('audits.event', 'migration.retry') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'retry') - ->label('sdk.description', '/docs/references/migrations/retry-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_ACCEPTED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MIGRATION) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'retry', + description: '/docs/references/migrations/retry-migration.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_ACCEPTED, + model: Response::MODEL_MIGRATION, + ) + ] + )) ->param('migrationId', '', new UID(), 'Migration unique ID.') ->inject('response') ->inject('dbForProject') @@ -1047,12 +635,19 @@ App::delete('/v1/migrations/:migrationId') ->label('event', 'migrations.[migrationId].delete') ->label('audits.event', 'migrationId.delete') ->label('audits.resource', 'migrations/{request.migrationId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'migrations') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/migrations/delete-migration.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'migrations', + name: 'delete', + description: '/docs/references/migrations/delete-migration.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('migrationId', '', new UID(), 'Migration ID.') ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 7ac49466a2..0544760e73 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -1,6 +1,10 @@ <?php use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Database\Database; @@ -21,18 +25,25 @@ App::get('/v1/project/usage') ->desc('Get project usage stats') ->groups(['api', 'usage']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_PROJECT) + ->label('sdk', new Method( + namespace: 'project', + name: 'getUsage', + description: '/docs/references/project/get-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_PROJECT, + ) + ] + )) ->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage') ->param('endDate', '', new DateTimeValidator(), 'End date for the usage') ->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true) ->inject('response') ->inject('dbForProject') - ->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject) { + ->inject('smsRates') + ->action(function (string $startDate, string $endDate, string $period, Response $response, Database $dbForProject, array $smsRates) { $stats = $total = $usage = []; $format = 'Y-m-d 00:00:00'; $firstDay = (new DateTime($startDate))->format($format); @@ -50,7 +61,9 @@ App::get('/v1/project/usage') METRIC_FILES_STORAGE, METRIC_DATABASES_STORAGE, METRIC_DEPLOYMENTS_STORAGE, - METRIC_BUILDS_STORAGE + METRIC_BUILDS_STORAGE, + METRIC_DATABASES_OPERATIONS_READS, + METRIC_DATABASES_OPERATIONS_WRITES, ], 'period' => [ METRIC_NETWORK_REQUESTS, @@ -60,7 +73,9 @@ App::get('/v1/project/usage') METRIC_EXECUTIONS, METRIC_DATABASES_STORAGE, METRIC_EXECUTIONS_MB_SECONDS, - METRIC_BUILDS_MB_SECONDS + METRIC_BUILDS_MB_SECONDS, + METRIC_DATABASES_OPERATIONS_READS, + METRIC_DATABASES_OPERATIONS_WRITES, ] ]; @@ -258,6 +273,46 @@ 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', [ + Query::equal('metric', [METRIC_AUTH_METHOD_PHONE]), + Query::equal('period', ['1d']), + Query::greaterThanEqual('time', $firstDay), + Query::lessThan('time', $lastDay), + ])); + + // This estimate is only for paid SMS usage + $authPhoneMetrics = Authorization::skip(fn () => $dbForProject->find('stats', [ + Query::startsWith('metric', METRIC_AUTH_METHOD_PHONE . '.'), + Query::equal('period', ['1d']), + Query::greaterThanEqual('time', $firstDay), + Query::lessThan('time', $lastDay), + ])); + + $authPhoneEstimate = 0.0; + $authPhoneCountryBreakdown = []; + foreach ($authPhoneMetrics as $metric) { + $parts = explode('.', $metric->getAttribute('metric')); + $countryCode = $parts[3] ?? null; + if ($countryCode === null) { + continue; + } + + $value = $metric->getAttribute('value', 0); + + if (isset($smsRates[$countryCode])) { + $authPhoneEstimate += $value * $smsRates[$countryCode]; + } + + $authPhoneCountryBreakdown[] = [ + 'name' => $countryCode, + 'value' => $value, + 'estimate' => isset($smsRates[$countryCode]) + ? $value * $smsRates[$countryCode] + : 0.0, + ]; + } + // merge network inbound + outbound $projectBandwidth = []; foreach ($usage[METRIC_NETWORK_INBOUND] as $item) { @@ -296,14 +351,19 @@ App::get('/v1/project/usage') 'functionsStorageTotal' => $total[METRIC_DEPLOYMENTS_STORAGE] + $total[METRIC_BUILDS_STORAGE], 'buildsStorageTotal' => $total[METRIC_BUILDS_STORAGE], 'deploymentsStorageTotal' => $total[METRIC_DEPLOYMENTS_STORAGE], + 'databasesReadsTotal' => $total[METRIC_DATABASES_OPERATIONS_READS], + 'databasesWritesTotal' => $total[METRIC_DATABASES_OPERATIONS_WRITES], 'executionsBreakdown' => $executionsBreakdown, - 'executionsMbSecondsBreakdown' => $executionsMbSecondsBreakdown, - 'buildsMbSecondsBreakdown' => $buildsMbSecondsBreakdown, 'bucketsBreakdown' => $bucketsBreakdown, + 'databasesReads' => $usage[METRIC_DATABASES_OPERATIONS_READS], + 'databasesWrites' => $usage[METRIC_DATABASES_OPERATIONS_WRITES], 'databasesStorageBreakdown' => $databasesStorageBreakdown, 'executionsMbSecondsBreakdown' => $executionsMbSecondsBreakdown, 'buildsMbSecondsBreakdown' => $buildsMbSecondsBreakdown, 'functionsStorageBreakdown' => $functionsStorageBreakdown, + 'authPhoneTotal' => $authPhoneTotal, + 'authPhoneEstimate' => $authPhoneEstimate, + 'authPhoneCountryBreakdown' => $authPhoneCountryBreakdown, ]), Response::MODEL_USAGE_PROJECT); }); @@ -314,21 +374,26 @@ App::post('/v1/project/variables') ->groups(['api']) ->label('scope', 'projects.write') ->label('audits.event', 'variable.create') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'createVariable') - ->label('sdk.description', '/docs/references/project/create-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'createVariable', + description: '/docs/references/project/create-variable.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_VARIABLE, + ) + ] + )) ->param('key', null, new Text(Database::LENGTH_KEY), 'Variable key. Max length: ' . Database::LENGTH_KEY . ' chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', false) ->param('secret', false, new Boolean(), 'Is secret? Secret variables can only be updated or deleted, they cannot be read.', true) ->inject('project') ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (string $key, string $value, bool $secret, Document $project, Response $response, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $key, string $value, bool $secret, Document $project, Response $response, Database $dbForProject, Database $dbForPlatform) { $variableId = ID::unique(); $variable = new Document([ @@ -370,13 +435,18 @@ App::get('/v1/project/variables') ->desc('List variables') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'listVariables') - ->label('sdk.description', '/docs/references/project/list-variables.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE_LIST) + ->label('sdk', new Method( + namespace: 'project', + name: 'listVariables', + description: '/docs/references/project/list-variables.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE_LIST, + ) + ] + )) ->inject('response') ->inject('dbForProject') ->action(function (Response $response, Database $dbForProject) { @@ -395,13 +465,18 @@ App::get('/v1/project/variables/:variableId') ->desc('Get variable') ->groups(['api']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'getVariable') - ->label('sdk.description', '/docs/references/project/get-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'getVariable', + description: '/docs/references/project/get-variable.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('project') @@ -419,21 +494,26 @@ App::put('/v1/project/variables/:variableId') ->desc('Update variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'updateVariable') - ->label('sdk.description', '/docs/references/project/update-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VARIABLE) + ->label('sdk', new Method( + namespace: 'project', + name: 'updateVariable', + description: '/docs/references/project/update-variable.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VARIABLE, + ) + ] + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->param('key', null, new Text(255), 'Variable key. Max length: 255 chars.', false) ->param('value', null, new Text(8192, 0), 'Variable value. Max length: 8192 chars.', true) ->inject('project') ->inject('response') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (string $variableId, string $key, ?string $value, Document $project, Response $response, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $variableId, string $key, ?string $value, Document $project, Response $response, Database $dbForProject, Database $dbForPlatform) { $variable = $dbForProject->getDocument('variables', $variableId); if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceType') !== 'project') { throw new Exception(Exception::VARIABLE_NOT_FOUND); @@ -465,12 +545,19 @@ App::delete('/v1/project/variables/:variableId') ->desc('Delete variable') ->groups(['api']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'project') - ->label('sdk.method', 'deleteVariable') - ->label('sdk.description', '/docs/references/project/delete-variable.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'project', + name: 'deleteVariable', + description: '/docs/references/project/delete-variable.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('project') ->inject('response') diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 3bfa416bd8..48d20cd17f 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -10,13 +10,16 @@ use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\ProjectId; use Appwrite\Utopia\Database\Validator\Queries\Projects; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use PHPMailer\PHPMailer\PHPMailer; -use Utopia\Abuse\Adapters\Database\TimeLimit; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Cache\Cache; @@ -61,13 +64,20 @@ App::post('/v1/projects') ->desc('Create project') ->groups(['api', 'projects']) ->label('audits.event', 'projects.create') + ->label('audits.resource', 'project/{response.$id}') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'create') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'create', + description: '/docs/references/projects/create.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new ProjectId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('teamId', '', new UID(), 'Team unique ID.') @@ -83,13 +93,13 @@ App::post('/v1/projects') ->param('legalTaxId', '', new Text(256), 'Project legal Tax ID. Max length: 256 chars.', true) ->inject('request') ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('cache') ->inject('pools') ->inject('hooks') - ->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Request $request, Response $response, Database $dbForConsole, Cache $cache, Group $pools, Hooks $hooks) { + ->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Request $request, Response $response, Database $dbForPlatform, Cache $cache, Group $pools, Hooks $hooks) { - $team = $dbForConsole->getDocument('teams', $teamId); + $team = $dbForPlatform->getDocument('teams', $teamId); if ($team->isEmpty()) { throw new Exception(Exception::TEAM_NOT_FOUND); @@ -111,6 +121,9 @@ App::post('/v1/projects') 'personalDataCheck' => false, 'mockNumbers' => [], 'sessionAlerts' => false, + 'membershipsUserName' => false, + 'membershipsUserEmail' => false, + 'membershipsMfa' => false, ]; foreach ($auth as $method) { @@ -119,6 +132,10 @@ App::post('/v1/projects') $projectId = ($projectId == 'unique()') ? ID::unique() : $projectId; + if ($projectId === 'console') { + throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); + } + $databases = Config::getParam('pools-database', []); $databaseOverride = System::getEnv('_APP_DATABASE_OVERRIDE'); @@ -129,16 +146,14 @@ App::post('/v1/projects') $dsn = $databases[array_rand($databases)]; } - if ($projectId === 'console') { - throw new Exception(Exception::PROJECT_RESERVED_PROJECT, "'console' is a reserved project."); - } - // TODO: Temporary until all projects are using shared tables. - if ($dsn === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn, $sharedTables)) { $schema = 'appwrite'; $database = 'appwrite'; $namespace = System::getEnv('_APP_DATABASE_SHARED_NAMESPACE', ''); - $dsn = $schema . '://' . System::getEnv('_APP_DATABASE_SHARED_TABLES', '') . '?database=' . $database; + $dsn = $schema . '://' . $dsn . '?database=' . $database; if (!empty($namespace)) { $dsn .= '&namespace=' . $namespace; @@ -146,7 +161,7 @@ App::post('/v1/projects') } try { - $project = $dbForConsole->createDocument('projects', new Document([ + $project = $dbForPlatform->createDocument('projects', new Document([ '$id' => $projectId, '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -192,47 +207,78 @@ App::post('/v1/projects') $adapter = $pools->get($dsn->getHost())->pop()->getResource(); $dbForProject = new Database($adapter, $cache); + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', '')); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { - $dbForProject - ->setSharedTables(true) - ->setTenant($project->getInternalId()) - ->setNamespace($dsn->getParam('namespace')); - } else { - $dbForProject - ->setSharedTables(false) - ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); - } + $projectTables = !\in_array($dsn->getHost(), $sharedTables); + $sharedTablesV1 = \in_array($dsn->getHost(), $sharedTablesV1); + $sharedTablesV2 = !$projectTables && !$sharedTablesV1; + $sharedTables = $sharedTablesV1 || $sharedTablesV2; - $dbForProject->create(); - - $audit = new Audit($dbForProject); - $audit->setup(); - - $abuse = new TimeLimit('', 0, 1, $dbForProject); - $abuse->setup(); - - /** @var array $collections */ - $collections = Config::getParam('collections', [])['projects'] ?? []; - - foreach ($collections as $key => $collection) { - if (($collection['$collection'] ?? '') !== Database::METADATA) { - continue; + if (!$sharedTablesV2) { + if ($sharedTables) { + $dbForProject + ->setSharedTables(true) + ->setTenant($sharedTablesV1 ? $project->getInternalId() : null) + ->setNamespace($dsn->getParam('namespace')); + } else { + $dbForProject + ->setSharedTables(false) + ->setTenant(null) + ->setNamespace('_' . $project->getInternalId()); } - $attributes = \array_map(function (array $attribute) { - return new Document($attribute); - }, $collection['attributes']); - - $indexes = \array_map(function (array $index) { - return new Document($index); - }, $collection['indexes']); + $create = true; try { - $dbForProject->createCollection($key, $attributes, $indexes); + $dbForProject->create(); } catch (Duplicate) { - // Collection already exists + $create = false; + } + + if ($create || $projectTables) { + $audit = new Audit($dbForProject); + $audit->setup(); + } + + if (!$create && $sharedTablesV1) { + $attributes = \array_map(fn ($attribute) => new Document($attribute), Audit::ATTRIBUTES); + $indexes = \array_map(fn (array $index) => new Document($index), Audit::INDEXES); + $dbForProject->createDocument(Database::METADATA, new Document([ + '$id' => ID::custom('audit'), + '$permissions' => [Permission::create(Role::any())], + 'name' => 'audit', + 'attributes' => $attributes, + 'indexes' => $indexes, + 'documentSecurity' => true + ])); + } + + if ($create || $sharedTablesV1) { + /** @var array $collections */ + $collections = Config::getParam('collections', [])['projects'] ?? []; + + foreach ($collections as $key => $collection) { + if (($collection['$collection'] ?? '') !== Database::METADATA) { + continue; + } + + $attributes = \array_map(fn ($attribute) => new Document($attribute), $collection['attributes']); + $indexes = \array_map(fn (array $index) => new Document($index), $collection['indexes']); + + try { + $dbForProject->createCollection($key, $attributes, $indexes); + } catch (Duplicate) { + $dbForProject->createDocument(Database::METADATA, new Document([ + '$id' => ID::custom($key), + '$permissions' => [Permission::create(Role::any())], + 'name' => $key, + 'attributes' => $attributes, + 'indexes' => $indexes, + 'documentSecurity' => true + ])); + } + } } } @@ -249,17 +295,23 @@ App::get('/v1/projects') ->desc('List projects') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'list') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'list', + description: '/docs/references/projects/list.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT_LIST, + ) + ] + )) ->param('queries', [], new Projects(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Projects::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (array $queries, string $search, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (array $queries, string $search, Response $response, Database $dbForPlatform) { try { $queries = Query::parseQueries($queries); @@ -287,7 +339,7 @@ App::get('/v1/projects') } $projectId = $cursor->getValue(); - $cursorDocument = $dbForConsole->getDocument('projects', $projectId); + $cursorDocument = $dbForPlatform->getDocument('projects', $projectId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Project '{$projectId}' for the 'cursor' value not found."); @@ -299,8 +351,8 @@ App::get('/v1/projects') $filterQueries = Query::groupByType($queries)['filters']; $response->dynamic(new Document([ - 'projects' => $dbForConsole->find('projects', $queries), - 'total' => $dbForConsole->count('projects', $filterQueries, APP_LIMIT_COUNT), + 'projects' => $dbForPlatform->find('projects', $queries), + 'total' => $dbForPlatform->count('projects', $filterQueries, APP_LIMIT_COUNT), ]), Response::MODEL_PROJECT_LIST); }); @@ -308,18 +360,24 @@ App::get('/v1/projects/:projectId') ->desc('Get project') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'get') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'get', + description: '/docs/references/projects/get.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -332,12 +390,20 @@ App::patch('/v1/projects/:projectId') ->desc('Update project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'update') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('audits.event', 'projects.update') + ->label('audits.resource', 'project/{request.projectId}') + ->label('sdk', new Method( + namespace: 'projects', + name: 'update', + description: '/docs/references/projects/update.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Project name. Max length: 128 chars.') ->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true) @@ -350,16 +416,16 @@ App::patch('/v1/projects/:projectId') ->param('legalAddress', '', new Text(256), 'Project legal address. Max length: 256 chars.', true) ->param('legalTaxId', '', new Text(256), 'Project legal tax ID. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $name, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $name, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('name', $name) ->setAttribute('description', $description) ->setAttribute('logo', $logo) @@ -379,20 +445,26 @@ App::patch('/v1/projects/:projectId/team') ->desc('Update project team') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateTeam') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateTeam', + description: '/docs/references/projects/update-team.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('teamId', '', new UID(), 'Team ID of the team to transfer project to.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $teamId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $teamId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); - $team = $dbForConsole->getDocument('teams', $teamId); + $project = $dbForPlatform->getDocument('projects', $projectId); + $team = $dbForPlatform->getDocument('teams', $teamId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -414,30 +486,30 @@ App::patch('/v1/projects/:projectId/team') ->setAttribute('teamId', $teamId) ->setAttribute('teamInternalId', $team->getInternalId()) ->setAttribute('$permissions', $permissions); - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project); - $installations = $dbForConsole->find('installations', [ + $installations = $dbForPlatform->find('installations', [ Query::equal('projectInternalId', [$project->getInternalId()]), ]); foreach ($installations as $installation) { $installation->getAttribute('$permissions', $permissions); - $dbForConsole->updateDocument('installations', $installation->getId(), $installation); + $dbForPlatform->updateDocument('installations', $installation->getId(), $installation); } - $repositories = $dbForConsole->find('repositories', [ + $repositories = $dbForPlatform->find('repositories', [ Query::equal('projectInternalId', [$project->getInternalId()]), ]); foreach ($repositories as $repository) { $repository->getAttribute('$permissions', $permissions); - $dbForConsole->updateDocument('repositories', $repository->getId(), $repository); + $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository); } - $vcsComments = $dbForConsole->find('vcsComments', [ + $vcsComments = $dbForPlatform->find('vcsComments', [ Query::equal('projectInternalId', [$project->getInternalId()]), ]); foreach ($vcsComments as $vcsComment) { $vcsComment->getAttribute('$permissions', $permissions); - $dbForConsole->updateDocument('vcsComments', $vcsComment->getId(), $vcsComment); + $dbForPlatform->updateDocument('vcsComments', $vcsComment->getId(), $vcsComment); } $response->dynamic($project, Response::MODEL_PROJECT); @@ -447,20 +519,26 @@ App::patch('/v1/projects/:projectId/service') ->desc('Update service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatus', + description: '/docs/references/projects/update-service-status.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('service', '', new WhiteList(array_keys(array_filter(Config::getParam('services'), fn ($element) => $element['optional'])), true), 'Service name.') ->param('status', null, new Boolean(), 'Service status.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $service, bool $status, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $service, bool $status, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -469,7 +547,7 @@ App::patch('/v1/projects/:projectId/service') $services = $project->getAttribute('services', []); $services[$service] = $status; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('services', $services)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('services', $services)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -478,19 +556,25 @@ App::patch('/v1/projects/:projectId/service/all') ->desc('Update all service status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateServiceStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateServiceStatusAll', + description: '/docs/references/projects/update-service-status-all.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'Service status.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $status, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $status, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -503,7 +587,7 @@ App::patch('/v1/projects/:projectId/service/all') $services[$service] = $status; } - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('services', $services)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('services', $services)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -512,20 +596,26 @@ App::patch('/v1/projects/:projectId/api') ->desc('Update API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatus', + description: '/docs/references/projects/update-api-status.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('api', '', new WhiteList(array_keys(Config::getParam('apis')), true), 'API name.') ->param('status', null, new Boolean(), 'API status.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $api, bool $status, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $api, bool $status, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -534,7 +624,7 @@ App::patch('/v1/projects/:projectId/api') $apis = $project->getAttribute('apis', []); $apis[$api] = $status; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('apis', $apis)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('apis', $apis)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -543,19 +633,25 @@ App::patch('/v1/projects/:projectId/api/all') ->desc('Update all API status') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateApiStatusAll') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateApiStatusAll', + description: '/docs/references/projects/update-api-status-all.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('status', null, new Boolean(), 'API status.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $status, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $status, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -568,7 +664,7 @@ App::patch('/v1/projects/:projectId/api/all') $apis[$api] = $status; } - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('apis', $apis)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('apis', $apis)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -577,22 +673,28 @@ App::patch('/v1/projects/:projectId/oauth2') ->desc('Update project OAuth2') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateOAuth2') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateOAuth2', + description: '/docs/references/projects/update-oauth2.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'Provider Name') ->param('appId', null, new Text(256), 'Provider app ID. Max length: 256 chars.', true) ->param('secret', null, new text(512), 'Provider secret key. Max length: 512 chars.', true) ->param('enabled', null, new Boolean(), 'Provider status. Set to \'false\' to disable new session creation.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $provider, ?string $appId, ?string $secret, ?bool $enabled, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $provider, ?string $appId, ?string $secret, ?bool $enabled, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -612,7 +714,7 @@ App::patch('/v1/projects/:projectId/oauth2') $providers[$provider . 'Enabled'] = $enabled; } - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('oAuthProviders', $providers)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('oAuthProviders', $providers)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -621,19 +723,25 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') ->desc('Update project sessions emails') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSessionAlerts') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSessionAlerts', + description: '/docs/references/projects/update-session-alerts.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('alerts', false, new Boolean(true), 'Set to true to enable session emails.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $alerts, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $alerts, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -642,7 +750,48 @@ App::patch('/v1/projects/:projectId/auth/session-alerts') $auths = $project->getAttribute('auths', []); $auths['sessionAlerts'] = $alerts; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project + ->setAttribute('auths', $auths)); + + $response->dynamic($project, Response::MODEL_PROJECT); + }); + +App::patch('/v1/projects/:projectId/auth/memberships-privacy') + ->desc('Update project memberships privacy attributes') + ->groups(['api', 'projects']) + ->label('scope', 'projects.write') + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMembershipsPrivacy', + description: '/docs/references/projects/update-memberships-privacy.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) + ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('userName', true, new Boolean(true), 'Set to true to show userName to members of a team.') + ->param('userEmail', true, new Boolean(true), 'Set to true to show email to members of a team.') + ->param('mfa', true, new Boolean(true), 'Set to true to show mfa to members of a team.') + ->inject('response') + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $userName, bool $userEmail, bool $mfa, Response $response, Database $dbForPlatform) { + $project = $dbForPlatform->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + throw new Exception(Exception::PROJECT_NOT_FOUND); + } + + $auths = $project->getAttribute('auths', []); + + $auths['membershipsUserName'] = $userName; + $auths['membershipsUserEmail'] = $userEmail; + $auths['membershipsMfa'] = $mfa; + + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -652,19 +801,25 @@ App::patch('/v1/projects/:projectId/auth/limit') ->desc('Update project users limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthLimit', + description: '/docs/references/projects/update-auth-limit.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(0, APP_LIMIT_USERS), 'Set the max number of users allowed in this project. Use 0 for unlimited.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, int $limit, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -673,7 +828,7 @@ App::patch('/v1/projects/:projectId/auth/limit') $auths = $project->getAttribute('auths', []); $auths['limit'] = $limit; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -683,19 +838,25 @@ App::patch('/v1/projects/:projectId/auth/duration') ->desc('Update project authentication duration') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthDuration') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthDuration', + description: '/docs/references/projects/update-auth-duration.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('duration', 31536000, new Range(0, 31536000), 'Project session length in seconds. Max length: 31536000 seconds.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, int $duration, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, int $duration, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -704,7 +865,7 @@ App::patch('/v1/projects/:projectId/auth/duration') $auths = $project->getAttribute('auths', []); $auths['duration'] = $duration; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -714,20 +875,26 @@ App::patch('/v1/projects/:projectId/auth/:method') ->desc('Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthStatus') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthStatus', + description: '/docs/references/projects/update-auth-status.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('method', '', new WhiteList(\array_keys(Config::getParam('auth')), true), 'Auth Method. Possible values: ' . implode(',', \array_keys(Config::getParam('auth'))), false) ->param('status', false, new Boolean(true), 'Set the status of this auth method.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $method, bool $status, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $method, bool $status, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); $auth = Config::getParam('auth')[$method] ?? []; $authKey = $auth['key'] ?? ''; $status = ($status === '1' || $status === 'true' || $status === 1 || $status === true); @@ -739,7 +906,7 @@ App::patch('/v1/projects/:projectId/auth/:method') $auths = $project->getAttribute('auths', []); $auths[$authKey] = $status; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('auths', $auths)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -748,19 +915,25 @@ App::patch('/v1/projects/:projectId/auth/password-history') ->desc('Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordHistory') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordHistory', + description: '/docs/references/projects/update-auth-password-history.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', 0, new Range(0, APP_LIMIT_USER_PASSWORD_HISTORY), 'Set the max number of passwords to store in user history. User can\'t choose a new password that is already stored in the password history list. Max number of passwords allowed in history is' . APP_LIMIT_USER_PASSWORD_HISTORY . '. Default value is 0') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, int $limit, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -769,7 +942,7 @@ App::patch('/v1/projects/:projectId/auth/password-history') $auths = $project->getAttribute('auths', []); $auths['passwordHistory'] = $limit; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -779,19 +952,25 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') ->desc('Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthPasswordDictionary') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthPasswordDictionary', + description: '/docs/references/projects/update-auth-password-dictionary.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to enable checking user\'s password against most commonly used passwords. Default is false.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $enabled, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $enabled, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -800,7 +979,7 @@ App::patch('/v1/projects/:projectId/auth/password-dictionary') $auths = $project->getAttribute('auths', []); $auths['passwordDictionary'] = $enabled; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -810,19 +989,25 @@ App::patch('/v1/projects/:projectId/auth/personal-data') ->desc('Enable or disable checking user passwords for similarity with their personal data.') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePersonalDataCheck') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePersonalDataCheck', + description: '/docs/references/projects/update-personal-data-check.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(false), 'Set whether or not to check a password for similarity with personal data. Default is false.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $enabled, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $enabled, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -831,7 +1016,7 @@ App::patch('/v1/projects/:projectId/auth/personal-data') $auths = $project->getAttribute('auths', []); $auths['personalDataCheck'] = $enabled; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -841,19 +1026,25 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') ->desc('Update project user sessions limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateAuthSessionsLimit') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateAuthSessionsLimit', + description: '/docs/references/projects/update-auth-sessions-limit.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('limit', false, new Range(1, APP_LIMIT_USER_SESSIONS_MAX), 'Set the max number of users allowed in this project. Value allowed is between 1-' . APP_LIMIT_USER_SESSIONS_MAX . '. Default is ' . APP_LIMIT_USER_SESSIONS_DEFAULT) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, int $limit, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, int $limit, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -862,7 +1053,7 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') $auths = $project->getAttribute('auths', []); $auths['maxSessions'] = $limit; - $dbForConsole->updateDocument('projects', $project->getId(), $project + $dbForPlatform->updateDocument('projects', $project->getId(), $project ->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); @@ -872,17 +1063,23 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') ->desc('Update the mock numbers for the project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateMockNumbers') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateMockNumbers', + description: '/docs/references/projects/update-mock-numbers.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('numbers', '', new ArrayList(new MockNumber(), 10), 'An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, array $numbers, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, array $numbers, Response $response, Database $dbForPlatform) { $uniqueNumbers = []; foreach ($numbers as $number) { @@ -892,7 +1089,7 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') $uniqueNumbers[$number['phone']] = $number['otp']; } - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -902,7 +1099,7 @@ App::patch('/v1/projects/:projectId/auth/mock-numbers') $auths['mockNumbers'] = $numbers; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('auths', $auths)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('auths', $auths)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -911,19 +1108,28 @@ App::delete('/v1/projects/:projectId') ->desc('Delete project') ->groups(['api', 'projects']) ->label('audits.event', 'projects.delete') + ->label('audits.resource', 'project/{request.projectId}') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'delete') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'delete', + description: '/docs/references/projects/delete.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('user') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForDeletes') - ->action(function (string $projectId, Response $response, Document $user, Database $dbForConsole, Delete $queueForDeletes) { - $project = $dbForConsole->getDocument('projects', $projectId); + ->action(function (string $projectId, Response $response, Document $user, Database $dbForPlatform, Delete $queueForDeletes) { + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -934,7 +1140,7 @@ App::delete('/v1/projects/:projectId') ->setType(DELETE_TYPE_DOCUMENT) ->setDocument($project); - if (!$dbForConsole->deleteDocument('projects', $projectId)) { + if (!$dbForPlatform->deleteDocument('projects', $projectId)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove project from DB'); } @@ -947,12 +1153,18 @@ App::post('/v1/projects/:projectId/webhooks') ->desc('Create webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createWebhook', + description: '/docs/references/projects/create-webhook.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_WEBHOOK, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') ->param('enabled', true, new Boolean(true), 'Enable or disable a webhook.', true) @@ -962,10 +1174,10 @@ App::post('/v1/projects/:projectId/webhooks') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $name, bool $enabled, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $name, bool $enabled, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -992,9 +1204,9 @@ App::post('/v1/projects/:projectId/webhooks') 'enabled' => $enabled, ]); - $webhook = $dbForConsole->createDocument('webhooks', $webhook); + $webhook = $dbForPlatform->createDocument('webhooks', $webhook); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -1005,24 +1217,30 @@ App::get('/v1/projects/:projectId/webhooks') ->desc('List webhooks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listWebhooks') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listWebhooks', + description: '/docs/references/projects/list-webhooks.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK_LIST, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $webhooks = $dbForConsole->find('webhooks', [ + $webhooks = $dbForPlatform->find('webhooks', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); @@ -1037,30 +1255,36 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Get webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getWebhook', + description: '/docs/references/projects/get-webhook.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $webhook = $dbForConsole->findOne('webhooks', [ + $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($webhook === false || $webhook->isEmpty()) { + if ($webhook->isEmpty()) { throw new Exception(Exception::WEBHOOK_NOT_FOUND); } @@ -1071,12 +1295,18 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Update webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhook', + description: '/docs/references/projects/update-webhook.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.') @@ -1087,10 +1317,10 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') ->param('httpUser', '', new Text(256), 'Webhook HTTP user. Max length: 256 chars.', true) ->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $webhookId, string $name, bool $enabled, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $webhookId, string $name, bool $enabled, array $events, string $url, bool $security, string $httpUser, string $httpPass, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1098,12 +1328,12 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') $security = ($security === '1' || $security === 'true' || $security === 1 || $security === true); - $webhook = $dbForConsole->findOne('webhooks', [ + $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($webhook === false || $webhook->isEmpty()) { + if ($webhook->isEmpty()) { throw new Exception(Exception::WEBHOOK_NOT_FOUND); } @@ -1120,8 +1350,8 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') $webhook->setAttribute('attempts', 0); } - $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('webhooks', $webhook->getId(), $webhook); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->dynamic($webhook, Response::MODEL_WEBHOOK); }); @@ -1130,37 +1360,43 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') ->desc('Update webhook signature key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateWebhookSignature') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_WEBHOOK) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateWebhookSignature', + description: '/docs/references/projects/update-webhook-signature.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_WEBHOOK, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $webhook = $dbForConsole->findOne('webhooks', [ + $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($webhook === false || $webhook->isEmpty()) { + if ($webhook->isEmpty()) { throw new Exception(Exception::WEBHOOK_NOT_FOUND); } $webhook->setAttribute('signatureKey', \bin2hex(\random_bytes(64))); - $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('webhooks', $webhook->getId(), $webhook); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->dynamic($webhook, Response::MODEL_WEBHOOK); }); @@ -1169,35 +1405,43 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') ->desc('Delete webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteWebhook') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteWebhook', + description: '/docs/references/projects/delete-webhook.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('webhookId', '', new UID(), 'Webhook unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $webhookId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $webhook = $dbForConsole->findOne('webhooks', [ + $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($webhook === false || $webhook->isEmpty()) { + if ($webhook->isEmpty()) { throw new Exception(Exception::WEBHOOK_NOT_FOUND); } - $dbForConsole->deleteDocument('webhooks', $webhook->getId()); + $dbForPlatform->deleteDocument('webhooks', $webhook->getId()); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -1208,21 +1452,27 @@ App::post('/v1/projects/:projectId/keys') ->desc('Create key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createKey') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createKey', + description: '/docs/references/projects/create-key.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_KEY, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1245,9 +1495,9 @@ App::post('/v1/projects/:projectId/keys') 'secret' => API_KEY_STANDARD . '_' . \bin2hex(\random_bytes(128)), ]); - $key = $dbForConsole->createDocument('keys', $key); + $key = $dbForPlatform->createDocument('keys', $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -1258,24 +1508,30 @@ App::get('/v1/projects/:projectId/keys') ->desc('List keys') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listKeys') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listKeys', + description: '/docs/references/projects/list-keys.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY_LIST, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $keys = $dbForConsole->find('keys', [ + $keys = $dbForPlatform->find('keys', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); @@ -1290,30 +1546,36 @@ App::get('/v1/projects/:projectId/keys/:keyId') ->desc('Get key') ->groups(['api', 'projects']) ->label('scope', 'keys.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getKey', + description: '/docs/references/projects/get-key.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $keyId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('keys', [ + $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($key === false || $key->isEmpty()) { + if ($key->isEmpty()) { throw new Exception(Exception::KEY_NOT_FOUND); } @@ -1324,33 +1586,39 @@ App::put('/v1/projects/:projectId/keys/:keyId') ->desc('Update key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateKey') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_KEY) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateKey', + description: '/docs/references/projects/update-key.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_KEY, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('keys', [ + $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($key === false || $key->isEmpty()) { + if ($key->isEmpty()) { throw new Exception(Exception::KEY_NOT_FOUND); } @@ -1359,9 +1627,9 @@ App::put('/v1/projects/:projectId/keys/:keyId') ->setAttribute('scopes', $scopes) ->setAttribute('expire', $expire); - $dbForConsole->updateDocument('keys', $key->getId(), $key); + $dbForPlatform->updateDocument('keys', $key->getId(), $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->dynamic($key, Response::MODEL_KEY); }); @@ -1370,35 +1638,43 @@ App::delete('/v1/projects/:projectId/keys/:keyId') ->desc('Delete key') ->groups(['api', 'projects']) ->label('scope', 'keys.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteKey') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteKey', + description: '/docs/references/projects/delete-key.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $keyId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $keyId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForConsole->findOne('keys', [ + $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($key === false || $key->isEmpty()) { + if ($key->isEmpty()) { throw new Exception(Exception::KEY_NOT_FOUND); } - $dbForConsole->deleteDocument('keys', $key->getId()); + $dbForPlatform->deleteDocument('keys', $key->getId()); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -1409,20 +1685,26 @@ App::post('/v1/projects/:projectId/jwts') ->groups(['api', 'projects']) ->desc('Create JWT') ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createJWT') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createJWT', + description: '/docs/references/projects/create-jwt.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('scopes', [], new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'List of scopes allowed for JWT key. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.') ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, array $scopes, int $duration, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, array $scopes, int $duration, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1444,13 +1726,20 @@ App::post('/v1/projects/:projectId/platforms') ->desc('Create platform') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.create') + ->label('audits.resource', 'project/{request.projectId}') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createPlatform', + description: '/docs/references/projects/create-platform.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PLATFORM, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1458,9 +1747,9 @@ App::post('/v1/projects/:projectId/platforms') ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) ->param('hostname', '', new Hostname(), 'Platform client hostname. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $name, string $key, string $store, string $hostname, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('projects', $projectId); + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $name, string $key, string $store, string $hostname, Response $response, Database $dbForPlatform) { + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1482,9 +1771,9 @@ App::post('/v1/projects/:projectId/platforms') 'hostname' => $hostname ]); - $platform = $dbForConsole->createDocument('platforms', $platform); + $platform = $dbForPlatform->createDocument('platforms', $platform); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -1495,24 +1784,30 @@ App::get('/v1/projects/:projectId/platforms') ->desc('List platforms') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'listPlatforms') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM_LIST) + ->label('sdk', new Method( + namespace: 'projects', + name: 'listPlatforms', + description: '/docs/references/projects/list-platforms.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM_LIST, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $platforms = $dbForConsole->find('platforms', [ + $platforms = $dbForPlatform->find('platforms', [ Query::equal('projectInternalId', [$project->getInternalId()]), Query::limit(5000), ]); @@ -1527,30 +1822,36 @@ App::get('/v1/projects/:projectId/platforms/:platformId') ->desc('Get platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getPlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getPlatform', + description: '/docs/references/projects/get-platform.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $platformId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $platformId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $platform = $dbForConsole->findOne('platforms', [ + $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($platform === false || $platform->isEmpty()) { + if ($platform->isEmpty()) { throw new Exception(Exception::PLATFORM_NOT_FOUND); } @@ -1561,12 +1862,18 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->desc('Update platform') ->groups(['api', 'projects']) ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updatePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PLATFORM) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updatePlatform', + description: '/docs/references/projects/update-platform.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PLATFORM, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.') @@ -1574,20 +1881,20 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) ->param('hostname', '', new Hostname(), 'Platform client URL. Max length: 256 chars.', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $platformId, string $name, string $key, string $store, string $hostname, Response $response, Database $dbForConsole) { - $project = $dbForConsole->getDocument('projects', $projectId); + ->inject('dbForPlatform') + ->action(function (string $projectId, string $platformId, string $name, string $key, string $store, string $hostname, Response $response, Database $dbForPlatform) { + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $platform = $dbForConsole->findOne('platforms', [ + $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($platform === false || $platform->isEmpty()) { + if ($platform->isEmpty()) { throw new Exception(Exception::PLATFORM_NOT_FOUND); } @@ -1597,9 +1904,9 @@ App::put('/v1/projects/:projectId/platforms/:platformId') ->setAttribute('store', $store) ->setAttribute('hostname', $hostname); - $dbForConsole->updateDocument('platforms', $platform->getId(), $platform); + $dbForPlatform->updateDocument('platforms', $platform->getId(), $platform); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->dynamic($platform, Response::MODEL_PLATFORM); }); @@ -1608,36 +1915,45 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') ->desc('Delete platform') ->groups(['api', 'projects']) ->label('audits.event', 'platforms.delete') + ->label('audits.resource', 'project/{request.projectId}/platform/${request.platformId}') ->label('scope', 'platforms.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deletePlatform') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deletePlatform', + description: '/docs/references/projects/delete-platform.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('platformId', '', new UID(), 'Platform unique ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $platformId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $platformId, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); } - $platform = $dbForConsole->findOne('platforms', [ + $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), Query::equal('projectInternalId', [$project->getInternalId()]), ]); - if ($platform === false || $platform->isEmpty()) { + if ($platform->isEmpty()) { throw new Exception(Exception::PLATFORM_NOT_FOUND); } - $dbForConsole->deleteDocument('platforms', $platformId); + $dbForPlatform->deleteDocument('platforms', $platformId); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response->noContent(); }); @@ -1648,12 +1964,18 @@ App::patch('/v1/projects/:projectId/smtp') ->desc('Update SMTP') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmtp') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmtp', + description: '/docs/references/projects/update-smtp.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROJECT, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('enabled', false, new Boolean(), 'Enable custom SMTP service') ->param('senderName', '', new Text(255, 0), 'Name of the email sender', true) @@ -1665,10 +1987,10 @@ App::patch('/v1/projects/:projectId/smtp') ->param('password', '', new Text(0, 0), 'SMTP server password', true) ->param('secure', '', new WhiteList(['tls', 'ssl'], true), 'Does SMTP server use secure connection', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, bool $enabled, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, bool $enabled, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1729,7 +2051,7 @@ App::patch('/v1/projects/:projectId/smtp') ]; } - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('smtp', $smtp)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('smtp', $smtp)); $response->dynamic($project, Response::MODEL_PROJECT); }); @@ -1738,11 +2060,18 @@ App::post('/v1/projects/:projectId/smtp/tests') ->desc('Create SMTP test') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'createSmtpTest') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'createSmtpTest', + description: '/docs/references/projects/create-smtp-test.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('emails', [], new ArrayList(new Email(), 10), 'Array of emails to send test email to. Maximum of 10 emails are allowed.') ->param('senderName', System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server'), new Text(255, 0), 'Name of the email sender') @@ -1754,10 +2083,10 @@ App::post('/v1/projects/:projectId/smtp/tests') ->param('password', '', new Text(0, 0), 'SMTP server password', true) ->param('secure', '', new WhiteList(['tls', 'ssl'], true), 'Does SMTP server use secure connection', true) ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForMails') - ->action(function (string $projectId, array $emails, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForConsole, Mail $queueForMails) { - $project = $dbForConsole->getDocument('projects', $projectId); + ->action(function (string $projectId, array $emails, string $senderName, string $senderEmail, string $replyTo, string $host, int $port, string $username, string $password, string $secure, Response $response, Database $dbForPlatform, Mail $queueForMails) { + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1797,22 +2126,28 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Get custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getSmsTemplate', + description: '/docs/references/projects/get-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForPlatform) { throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1838,20 +2173,26 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Get custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'getEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'getEmailTemplate', + description: '/docs/references/projects/get-email-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1890,23 +2231,29 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Update custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateSmsTemplate', + description: '/docs/references/projects/update-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->param('message', '', new Text(0), 'Template message') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, string $message, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, string $message, Response $response, Database $dbForPlatform) { throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1917,7 +2264,7 @@ App::patch('/v1/projects/:projectId/templates/sms/:type/:locale') 'message' => $message ]; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); $response->dynamic(new Document([ 'message' => $message, @@ -1930,12 +2277,18 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Update custom email templates') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'updateEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROJECT) + ->label('sdk', new Method( + namespace: 'projects', + name: 'updateEmailTemplate', + description: '/docs/references/projects/update-email-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ] + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) @@ -1945,10 +2298,10 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') ->param('senderEmail', '', new Email(), 'Email of the sender', true) ->param('replyTo', '', new Email(), 'Reply to email', true) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, string $subject, string $message, string $senderName, string $senderEmail, string $replyTo, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, string $subject, string $message, string $senderName, string $senderEmail, string $replyTo, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -1963,7 +2316,7 @@ App::patch('/v1/projects/:projectId/templates/email/:type/:locale') 'message' => $message ]; - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); $response->dynamic(new Document([ 'type' => $type, @@ -1980,22 +2333,29 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') ->desc('Reset custom SMS template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteSmsTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SMS_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteSmsTemplate', + description: '/docs/references/projects/delete-sms-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SMS_TEMPLATE, + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['sms'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForPlatform) { throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -2010,7 +2370,7 @@ App::delete('/v1/projects/:projectId/templates/sms/:type/:locale') unset($template['sms.' . $type . '-' . $locale]); - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); $response->dynamic(new Document([ 'type' => $type, @@ -2023,20 +2383,27 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Reset custom email template') ->groups(['api', 'projects']) ->label('scope', 'projects.write') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'projects') - ->label('sdk.method', 'deleteEmailTemplate') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_EMAIL_TEMPLATE) + ->label('sdk', new Method( + namespace: 'projects', + name: 'deleteEmailTemplate', + description: '/docs/references/projects/delete-email-template.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_EMAIL_TEMPLATE, + ) + ], + contentType: ContentType::JSON + )) ->param('projectId', '', new UID(), 'Project unique ID.') ->param('type', '', new WhiteList(Config::getParam('locale-templates')['email'] ?? []), 'Template type') ->param('locale', '', fn ($localeCodes) => new WhiteList($localeCodes), 'Template locale', false, ['localeCodes']) ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, string $type, string $locale, Response $response, Database $dbForPlatform) { - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -2051,7 +2418,7 @@ App::delete('/v1/projects/:projectId/templates/email/:type/:locale') unset($templates['email.' . $type . '-' . $locale]); - $project = $dbForConsole->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); + $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates)); $response->dynamic(new Document([ 'type' => $type, diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 984a9fb974..2567c23be6 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -5,6 +5,10 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\CNAME; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Rules; use Appwrite\Utopia\Response; use Utopia\App; @@ -29,13 +33,18 @@ App::post('/v1/proxy/rules') ->label('event', 'rules.[ruleId].create') ->label('audits.event', 'rule.create') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'createRule') - ->label('sdk.description', '/docs/references/proxy/create-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'createRule', + description: '/docs/references/proxy/create-rule.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_PROXY_RULE, + ) + ] + )) ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('resourceType', null, new WhiteList(['api', 'function']), 'Action definition for the rule. Possible values are "api", "function"') ->param('resourceId', '', new UID(), 'ID of resource for the action type. If resourceType is "api", leave empty. If resourceType is "function", provide ID of the function.', true) @@ -43,9 +52,9 @@ App::post('/v1/proxy/rules') ->inject('project') ->inject('queueForCertificates') ->inject('queueForEvents') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('dbForProject') - ->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForConsole, Database $dbForProject) { + ->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) { $mainDomain = System::getEnv('_APP_DOMAIN', ''); if ($domain === $mainDomain) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your main domain to specific resource. Please use subdomain or a different domain.'); @@ -60,11 +69,17 @@ App::post('/v1/proxy/rules') throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please pick another one.'); } - $document = $dbForConsole->findOne('rules', [ - Query::equal('domain', [$domain]), - ]); + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $document = $dbForPlatform->getDocument('rules', md5($domain)); + } else { + $document = $dbForPlatform->findOne('rules', [ + Query::equal('domain', [$domain]), + ]); + } - if ($document && !$document->isEmpty()) { + + if (!$document->isEmpty()) { if ($document->getAttribute('projectId') === $project->getId()) { $resourceType = $document->getAttribute('resourceType'); $resourceId = $document->getAttribute('resourceId'); @@ -103,7 +118,9 @@ App::post('/v1/proxy/rules') throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Domain may not start with http:// or https://.'); } - $ruleId = ID::unique(); + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + $ruleId = System::getEnv('_APP_RULES_FORMAT') === 'md5' ? md5($domain->get()) : ID::unique(); + $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -137,7 +154,7 @@ App::post('/v1/proxy/rules') } $rule->setAttribute('status', $status); - $rule = $dbForConsole->createDocument('rules', $rule); + $rule = $dbForPlatform->createDocument('rules', $rule); $queueForEvents->setParam('ruleId', $rule->getId()); @@ -152,19 +169,24 @@ App::get('/v1/proxy/rules') ->groups(['api', 'proxy']) ->desc('List rules') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'listRules') - ->label('sdk.description', '/docs/references/proxy/list-rules.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE_LIST) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'listRules', + description: '/docs/references/proxy/list-rules.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE_LIST, + ) + ] + )) ->param('queries', [], new Rules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Rules::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (array $queries, string $search, Response $response, Document $project, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (array $queries, string $search, Response $response, Document $project, Database $dbForPlatform) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -193,7 +215,7 @@ App::get('/v1/proxy/rules') } $ruleId = $cursor->getValue(); - $cursorDocument = $dbForConsole->getDocument('rules', $ruleId); + $cursorDocument = $dbForPlatform->getDocument('rules', $ruleId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Rule '{$ruleId}' for the 'cursor' value not found."); @@ -204,16 +226,16 @@ App::get('/v1/proxy/rules') $filterQueries = Query::groupByType($queries)['filters']; - $rules = $dbForConsole->find('rules', $queries); + $rules = $dbForPlatform->find('rules', $queries); foreach ($rules as $rule) { - $certificate = $dbForConsole->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); } $response->dynamic(new Document([ 'rules' => $rules, - 'total' => $dbForConsole->count('rules', $filterQueries, APP_LIMIT_COUNT), + 'total' => $dbForPlatform->count('rules', $filterQueries, APP_LIMIT_COUNT), ]), Response::MODEL_PROXY_RULE_LIST); }); @@ -221,25 +243,30 @@ App::get('/v1/proxy/rules/:ruleId') ->groups(['api', 'proxy']) ->desc('Get rule') ->label('scope', 'rules.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'getRule') - ->label('sdk.description', '/docs/references/proxy/get-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'getRule', + description: '/docs/references/proxy/get-rule.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $ruleId, Response $response, Document $project, Database $dbForConsole) { - $rule = $dbForConsole->getDocument('rules', $ruleId); + ->inject('dbForPlatform') + ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { throw new Exception(Exception::RULE_NOT_FOUND); } - $certificate = $dbForConsole->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); $rule->setAttribute('renewAt', $certificate->getAttribute('renewDate', '')); @@ -253,26 +280,33 @@ App::delete('/v1/proxy/rules/:ruleId') ->label('event', 'rules.[ruleId].delete') ->label('audits.event', 'rules.delete') ->label('audits.resource', 'rule/{request.ruleId}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'deleteRule') - ->label('sdk.description', '/docs/references/proxy/delete-rule.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'deleteRule', + description: '/docs/references/proxy/delete-rule.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForDeletes') ->inject('queueForEvents') - ->action(function (string $ruleId, Response $response, Document $project, Database $dbForConsole, Delete $queueForDeletes, Event $queueForEvents) { - $rule = $dbForConsole->getDocument('rules', $ruleId); + ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform, Delete $queueForDeletes, Event $queueForEvents) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { throw new Exception(Exception::RULE_NOT_FOUND); } - $dbForConsole->deleteDocument('rules', $rule->getId()); + $dbForPlatform->deleteDocument('rules', $rule->getId()); $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) @@ -290,21 +324,27 @@ App::patch('/v1/proxy/rules/:ruleId/verification') ->label('event', 'rules.[ruleId].update') ->label('audits.event', 'rule.update') ->label('audits.resource', 'rule/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'proxy') - ->label('sdk.method', 'updateRuleVerification') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROXY_RULE) + ->label('sdk', new Method( + namespace: 'proxy', + name: 'updateRuleVerification', + description: '/docs/references/proxy/update-rule-verification.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROXY_RULE, + ) + ] + )) ->param('ruleId', '', new UID(), 'Rule ID.') ->inject('response') ->inject('queueForCertificates') ->inject('queueForEvents') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('log') - ->action(function (string $ruleId, Response $response, Certificate $queueForCertificates, Event $queueForEvents, Document $project, Database $dbForConsole, Log $log) { - $rule = $dbForConsole->getDocument('rules', $ruleId); + ->action(function (string $ruleId, Response $response, Certificate $queueForCertificates, Event $queueForEvents, Document $project, Database $dbForPlatform, Log $log) { + $rule = $dbForPlatform->getDocument('rules', $ruleId); if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { throw new Exception(Exception::RULE_NOT_FOUND); @@ -334,7 +374,7 @@ App::patch('/v1/proxy/rules/:ruleId/verification') throw new Exception(Exception::RULE_VERIFICATION_FAILED); } - $dbForConsole->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); + $dbForPlatform->updateDocument('rules', $rule->getId(), $rule->setAttribute('status', 'verifying')); // Issue a TLS certificate when domain is verified $queueForCertificates @@ -345,7 +385,7 @@ App::patch('/v1/proxy/rules/:ruleId/verification') $queueForEvents->setParam('ruleId', $rule->getId()); - $certificate = $dbForConsole->getDocument('certificates', $rule->getAttribute('certificateId', '')); + $certificate = $dbForPlatform->getDocument('certificates', $rule->getAttribute('certificateId', '')); $rule->setAttribute('logs', $certificate->getAttribute('logs', '')); $response->dynamic($rule, Response::MODEL_PROXY_RULE); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 1c03f04638..41641d51d6 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -6,8 +6,14 @@ use Appwrite\Auth\Auth; use Appwrite\ClamAV\Network; use Appwrite\Event\Delete; use Appwrite\Event\Event; +use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; @@ -15,8 +21,10 @@ use Appwrite\Utopia\Response; use Utopia\App; use Utopia\Config\Config; use Utopia\Database\Database; +use Utopia\Database\DateTime; use Utopia\Database\Document; -use Utopia\Database\Exception\Duplicate; +use Utopia\Database\Exception\Duplicate as DuplicateException; +use Utopia\Database\Exception\NotFound as NotFoundException; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; @@ -49,16 +57,22 @@ App::post('/v1/storage/buckets') ->desc('Create bucket') ->groups(['api', 'storage']) ->label('scope', 'buckets.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('event', 'buckets.[bucketId].create') ->label('audits.event', 'bucket.create') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createBucket') - ->label('sdk.description', '/docs/references/storage/create-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createBucket', + description: '/docs/references/storage/create-bucket.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_BUCKET, + ) + ] + )) ->param('bucketId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', '', new Text(128), 'Bucket name') ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -66,19 +80,20 @@ App::post('/v1/storage/buckets') ->param('enabled', true, new Boolean(true), 'Is bucket enabled? When set to \'disabled\', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.', true) ->param('maximumFileSize', fn (array $plan) => empty($plan['fileSize']) ? (int) System::getEnv('_APP_STORAGE_LIMIT', 0) : $plan['fileSize'] * 1000 * 1000, fn (array $plan) => new Range(1, empty($plan['fileSize']) ? (int) System::getEnv('_APP_STORAGE_LIMIT', 0) : $plan['fileSize'] * 1000 * 1000), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human(System::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '.', true, ['plan']) ->param('allowedFileExtensions', [], new ArrayList(new Text(64), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Allowed file extensions. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' extensions are allowed, each 64 characters long.', true) - ->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true) + ->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD], true), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true) ->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true) ->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true) ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, int $maximumFileSize, array $allowedFileExtensions, string $compression, bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) { $bucketId = $bucketId === 'unique()' ? ID::unique() : $bucketId; // Map aggregate permissions into the multiple permissions they represent. $permissions = Permission::aggregate($permissions); - + $compression ??= Compression::NONE; + $encryption ??= true; try { $files = (Config::getParam('collections', [])['buckets'] ?? [])['files'] ?? []; if (empty($files)) { @@ -130,7 +145,7 @@ App::post('/v1/storage/buckets') $bucket = $dbForProject->getDocument('buckets', $bucketId); $dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity); - } catch (Duplicate) { + } catch (DuplicateException) { throw new Exception(Exception::STORAGE_BUCKET_ALREADY_EXISTS); } @@ -147,13 +162,19 @@ App::get('/v1/storage/buckets') ->desc('List buckets') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listBuckets') - ->label('sdk.description', '/docs/references/storage/list-buckets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET_LIST) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listBuckets', + description: '/docs/references/storage/list-buckets.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET_LIST, + ) + ] + )) ->param('queries', [], new Buckets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Buckets::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -207,13 +228,19 @@ App::get('/v1/storage/buckets/:bucketId') ->desc('Get bucket') ->groups(['api', 'storage']) ->label('scope', 'buckets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucket') - ->label('sdk.description', '/docs/references/storage/get-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucket', + description: '/docs/references/storage/get-bucket.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -232,16 +259,22 @@ App::put('/v1/storage/buckets/:bucketId') ->desc('Update bucket') ->groups(['api', 'storage']) ->label('scope', 'buckets.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('event', 'buckets.[bucketId].update') ->label('audits.event', 'bucket.update') ->label('audits.resource', 'bucket/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateBucket') - ->label('sdk.description', '/docs/references/storage/update-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BUCKET) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateBucket', + description: '/docs/references/storage/update-bucket.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BUCKET, + ) + ] + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->param('name', null, new Text(128), 'Bucket name', false) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE), 'An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) @@ -249,13 +282,13 @@ App::put('/v1/storage/buckets/:bucketId') ->param('enabled', true, new Boolean(true), 'Is bucket enabled? When set to \'disabled\', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.', true) ->param('maximumFileSize', fn (array $plan) => empty($plan['fileSize']) ? (int) System::getEnv('_APP_STORAGE_LIMIT', 0) : $plan['fileSize'] * 1000 * 1000, fn (array $plan) => new Range(1, empty($plan['fileSize']) ? (int) System::getEnv('_APP_STORAGE_LIMIT', 0) : $plan['fileSize'] * 1000 * 1000), 'Maximum file size allowed in bytes. Maximum allowed value is ' . Storage::human(System::getEnv('_APP_STORAGE_LIMIT', 0), 0) . '.', true, ['plan']) ->param('allowedFileExtensions', [], new ArrayList(new Text(64), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Allowed file extensions. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' extensions are allowed, each 64 characters long.', true) - ->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD]), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true) + ->param('compression', Compression::NONE, new WhiteList([Compression::NONE, Compression::GZIP, Compression::ZSTD], true), 'Compression algorithm choosen for compression. Can be one of ' . Compression::NONE . ', [' . Compression::GZIP . '](https://en.wikipedia.org/wiki/Gzip), or [' . Compression::ZSTD . '](https://en.wikipedia.org/wiki/Zstd), For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' compression is skipped even if it\'s enabled', true) ->param('encryption', true, new Boolean(true), 'Is encryption enabled? For file size above ' . Storage::human(APP_STORAGE_READ_BUFFER, 0) . ' encryption is skipped even if it\'s enabled', true) ->param('antivirus', true, new Boolean(true), 'Is virus scanning enabled? For file size above ' . Storage::human(APP_LIMIT_ANTIVIRUS, 0) . ' AntiVirus scanning is skipped even if it\'s enabled', true) ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, ?int $maximumFileSize, array $allowedFileExtensions, string $compression, bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $bucketId, string $name, ?array $permissions, bool $fileSecurity, bool $enabled, ?int $maximumFileSize, array $allowedFileExtensions, ?string $compression, ?bool $encryption, bool $antivirus, Response $response, Database $dbForProject, Event $queueForEvents) { $bucket = $dbForProject->getDocument('buckets', $bucketId); if ($bucket->isEmpty()) { @@ -268,11 +301,8 @@ App::put('/v1/storage/buckets/:bucketId') $enabled ??= $bucket->getAttribute('enabled', true); $encryption ??= $bucket->getAttribute('encryption', true); $antivirus ??= $bucket->getAttribute('antivirus', true); + $compression ??= $bucket->getAttribute('compression', Compression::NONE); - /** - * Map aggregate permissions into the multiple permissions they represent, - * accounting for the resource type given that some types not allowed specific permissions. - */ // Map aggregate permissions into the multiple permissions they represent. $permissions = Permission::aggregate($permissions); @@ -286,11 +316,11 @@ App::put('/v1/storage/buckets/:bucketId') ->setAttribute('encryption', $encryption) ->setAttribute('compression', $compression) ->setAttribute('antivirus', $antivirus)); + $dbForProject->updateCollection('bucket_' . $bucket->getInternalId(), $permissions, $fileSecurity); $queueForEvents - ->setParam('bucketId', $bucket->getId()) - ; + ->setParam('bucketId', $bucket->getId()); $response->dynamic($bucket, Response::MODEL_BUCKET); }); @@ -299,15 +329,23 @@ App::delete('/v1/storage/buckets/:bucketId') ->desc('Delete bucket') ->groups(['api', 'storage']) ->label('scope', 'buckets.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('audits.event', 'bucket.delete') ->label('event', 'buckets.[bucketId].delete') ->label('audits.resource', 'bucket/{request.bucketId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteBucket') - ->label('sdk.description', '/docs/references/storage/delete-bucket.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteBucket', + description: '/docs/references/storage/delete-bucket.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('bucketId', '', new UID(), 'Bucket unique ID.') ->inject('response') ->inject('dbForProject') @@ -337,25 +375,31 @@ App::delete('/v1/storage/buckets/:bucketId') }); App::post('/v1/storage/buckets/:bucketId/files') - ->alias('/v1/storage/files', ['bucketId' => 'default']) + ->alias('/v1/storage/files') ->desc('Create file') ->groups(['api', 'storage']) ->label('scope', 'files.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('audits.event', 'file.create') ->label('event', 'buckets.[bucketId].files.[fileId].create') ->label('audits.resource', 'file/{response.$id}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'createFile') - ->label('sdk.description', '/docs/references/storage/create-file.md') - ->label('sdk.request.type', 'multipart/form-data') - ->label('sdk.methodType', 'upload') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'createFile', + description: '/docs/references/storage/create-file.md', + type: MethodType::UPLOAD, + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + requestType: 'multipart/form-data', + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_FILE, + ) + ] + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new CustomId(), 'File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('file', [], new File(), 'Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/products/storage/upload-download#input-file).', skipValidation: true) @@ -664,7 +708,11 @@ App::post('/v1/storage/buckets/:bucketId/files') 'metadata' => $metadata, ]); - $file = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), $doc); + try { + $file = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), $doc); + } catch (NotFoundException) { + throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); + } } else { $file = $file ->setAttribute('chunksUploaded', $chunksUploaded) @@ -680,15 +728,19 @@ App::post('/v1/storage/buckets/:bucketId/files') if (!$validator->isValid($bucket->getCreate())) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + + try { + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + } catch (NotFoundException) { + throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); + } } } $queueForEvents ->setParam('bucketId', $bucket->getId()) ->setParam('fileId', $file->getId()) - ->setContext('bucket', $bucket) - ; + ->setContext('bucket', $bucket); $metadata = null; // was causing leaks as it was passed by reference @@ -698,17 +750,23 @@ App::post('/v1/storage/buckets/:bucketId/files') }); App::get('/v1/storage/buckets/:bucketId/files') - ->alias('/v1/storage/files', ['bucketId' => 'default']) + ->alias('/v1/storage/files') ->desc('List files') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'listFiles') - ->label('sdk.description', '/docs/references/storage/list-files.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE_LIST) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'listFiles', + description: '/docs/references/storage/list-files.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE_LIST, + ) + ] + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('queries', [], new Files(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Files::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) @@ -732,11 +790,7 @@ App::get('/v1/storage/buckets/:bucketId/files') throw new Exception(Exception::USER_UNAUTHORIZED); } - try { - $queries = Query::parseQueries($queries); - } catch (QueryException $e) { - throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); - } + $queries = Query::parseQueries($queries); if (!empty($search)) { $queries[] = Query::search('search', $search); @@ -774,12 +828,16 @@ App::get('/v1/storage/buckets/:bucketId/files') $filterQueries = Query::groupByType($queries)['filters']; - if ($fileSecurity && !$valid) { - $files = $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries); - $total = $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT); - } else { - $files = Authorization::skip(fn () => $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries)); - $total = Authorization::skip(fn () => $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT)); + try { + if ($fileSecurity && !$valid) { + $files = $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries); + $total = $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT); + } else { + $files = Authorization::skip(fn () => $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries)); + $total = Authorization::skip(fn () => $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT)); + } + } catch (NotFoundException) { + throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $response->dynamic(new Document([ @@ -789,17 +847,23 @@ App::get('/v1/storage/buckets/:bucketId/files') }); App::get('/v1/storage/buckets/:bucketId/files/:fileId') - ->alias('/v1/storage/files/:fileId', ['bucketId' => 'default']) + ->alias('/v1/storage/files/:fileId') ->desc('Get file') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFile') - ->label('sdk.description', '/docs/references/storage/get-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFile', + description: '/docs/references/storage/get-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -836,20 +900,28 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') }); App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') - ->alias('/v1/storage/files/:fileId/preview', ['bucketId' => 'default']) + ->alias('/v1/storage/files/:fileId/preview') ->desc('Get file preview') ->groups(['api', 'storage']) ->label('scope', 'files.read') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('cache', true) ->label('cache.resourceType', 'bucket/{request.bucketId}') ->label('cache.resource', 'file/{request.fileId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFilePreview') - ->label('sdk.description', '/docs/references/storage/get-file-preview.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_IMAGE) - ->label('sdk.methodType', 'location') + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFilePreview', + description: '/docs/references/storage/get-file-preview.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], + type: MethodType::LOCATION, + contentType: ContentType::IMAGE + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID') ->param('width', 0, new Range(0, 4000), 'Resize preview image width, Pass an integer between 0 to 4000.', true) @@ -871,7 +943,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->inject('mode') ->inject('deviceForFiles') ->inject('deviceForLocal') - ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Request $request, Response $response, Document $project, Database $dbForProject, Document $resourceToken, string $mode, Device $deviceForFiles, Device $deviceForLocal) { + ->inject('queueForUsage') + ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, Request $request, Response $response, Document $project, Database $dbForProject, Document $resourceToken, string $mode, Device $deviceForFiles, Device $deviceForLocal, Usage $queueForUsage) { if (!\extension_loaded('imagick')) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing'); @@ -1004,8 +1077,19 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg']; + $queueForUsage + ->addMetric(METRIC_FILES_TRANSFORMATIONS, 1) + ->addMetric(str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_TRANSFORMATIONS), 1) + ; + + $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)); + } + $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + 60 * 60 * 24 * 30) . ' GMT') + ->addHeader('Cache-Control', 'private, max-age=2592000') // 30 days ->setContentType($contentType) ->file($data) ; @@ -1014,17 +1098,25 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') }); App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') - ->alias('/v1/storage/files/:fileId/download', ['bucketId' => 'default']) + ->alias('/v1/storage/files/:fileId/download') ->desc('Get file for download') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileDownload') - ->label('sdk.description', '/docs/references/storage/get-file-download.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileDownload', + description: '/docs/references/storage/get-file-download.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE + ) + ], + type: MethodType::LOCATION, + contentType: ContentType::ANY, + )) ->param('bucketId', '', new UID(), 'Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('request') @@ -1068,7 +1160,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') $response ->setContentType($file->getAttribute('mimeType')) - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->addHeader('X-Peak', \memory_get_peak_usage()) ->addHeader('Content-Disposition', 'attachment; filename="' . $file->getAttribute('name', '') . '"') ; @@ -1154,17 +1246,25 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') }); App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') - ->alias('/v1/storage/files/:fileId/view', ['bucketId' => 'default']) + ->alias('/v1/storage/files/:fileId/view') ->desc('Get file for view') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getFileView') - ->label('sdk.description', '/docs/references/storage/get-file-view.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', '*/*') - ->label('sdk.methodType', 'location') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getFileView', + description: '/docs/references/storage/get-file-view.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_NONE, + ) + ], + type: MethodType::LOCATION, + contentType: ContentType::ANY, + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1218,7 +1318,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->addHeader('Content-Security-Policy', 'script-src none;') ->addHeader('X-Content-Type-Options', 'nosniff') ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->addHeader('X-Peak', \memory_get_peak_usage()) ; @@ -1309,6 +1409,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') ->desc('Get file for push notification') ->groups(['api', 'storage']) ->label('scope', 'public') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('sdk.response.code', Response::STATUS_CODE_OK) ->label('sdk.response.type', '*/*') ->label('sdk.methodType', 'location') @@ -1372,7 +1473,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') ->addHeader('Content-Security-Policy', 'script-src none;') ->addHeader('X-Content-Type-Options', 'nosniff') ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days ->addHeader('X-Peak', \memory_get_peak_usage()); $size = $file->getAttribute('sizeOriginal', 0); @@ -1459,23 +1560,29 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') }); App::put('/v1/storage/buckets/:bucketId/files/:fileId') - ->alias('/v1/storage/files/:fileId', ['bucketId' => 'default']) + ->alias('/v1/storage/files/:fileId') ->desc('Update file') ->groups(['api', 'storage']) ->label('scope', 'files.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('event', 'buckets.[bucketId].files.[fileId].update') ->label('audits.event', 'file.update') ->label('audits.resource', 'file/{response.$id}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'updateFile') - ->label('sdk.description', '/docs/references/storage/update-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_FILE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'updateFile', + description: '/docs/references/storage/update-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_FILE, + ) + ] + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('name', null, new Text(255), 'Name of the file', true) @@ -1548,10 +1655,14 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') $file->setAttribute('name', $name); } - if ($fileSecurity && !$valid) { - $file = $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file); - } else { - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + try { + if ($fileSecurity && !$valid) { + $file = $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file); + } else { + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + } + } catch (NotFoundException) { + throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } $queueForEvents @@ -1567,18 +1678,26 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') ->desc('Delete file') ->groups(['api', 'storage']) ->label('scope', 'files.write') + ->label('resourceType', RESOURCE_TYPE_BUCKETS) ->label('event', 'buckets.[bucketId].files.[fileId].delete') ->label('audits.event', 'file.delete') ->label('audits.resource', 'file/{request.fileId}') ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'deleteFile') - ->label('sdk.description', '/docs/references/storage/delete-file.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'storage', + name: 'deleteFile', + description: '/docs/references/storage/delete-file.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File ID.') ->inject('response') @@ -1633,10 +1752,14 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') ->setResource('file/' . $fileId) ; - if ($fileSecurity && !$valid) { - $deleted = $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId); - } else { - $deleted = Authorization::skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId)); + try { + if ($fileSecurity && !$valid) { + $deleted = $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId); + } else { + $deleted = Authorization::skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId)); + } + } catch (NotFoundException) { + throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } if (!$deleted) { @@ -1661,12 +1784,19 @@ App::get('/v1/storage/usage') ->desc('Get storage usage stats') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_STORAGE) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getUsage', + description: '/docs/references/storage/get-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_STORAGE, + ) + ] + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') @@ -1740,12 +1870,19 @@ App::get('/v1/storage/:bucketId/usage') ->desc('Get bucket usage stats') ->groups(['api', 'storage']) ->label('scope', 'files.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'storage') - ->label('sdk.method', 'getBucketUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_BUCKETS) + ->label('resourceType', RESOURCE_TYPE_BUCKETS) + ->label('sdk', new Method( + namespace: 'storage', + name: 'getBucketUsage', + description: '/docs/references/storage/get-bucket-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_BUCKETS, + ) + ] + )) ->param('bucketId', '', new UID(), 'Bucket ID.') ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index f9abaeeb44..e525086ebf 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -8,16 +8,23 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Mail; use Appwrite\Event\Messaging; +use Appwrite\Event\Usage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; use Appwrite\Platform\Workers\Deletes; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Template\Template; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Memberships; use Appwrite\Utopia\Database\Validator\Queries\Teams; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; +use libphonenumber\PhoneNumberUtil; use MaxMind\Db\Reader; +use Utopia\Abuse\Abuse; use Utopia\App; use Utopia\Audit\Audit; use Utopia\Config\Config; @@ -53,13 +60,18 @@ App::post('/v1/teams') ->label('scope', 'teams.write') ->label('audits.event', 'team.create') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/teams/create-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) + ->label('sdk', new Method( + namespace: 'teams', + name: 'create', + description: '/docs/references/teams/create-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TEAM, + ) + ] + )) ->param('teamId', '', new CustomId(), 'Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('name', null, new Text(128), 'Team name. Max length: 128 chars.') ->param('roles', ['owner'], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', true) @@ -138,14 +150,18 @@ App::get('/v1/teams') ->desc('List teams') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/teams/list-teams.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM_LIST) - ->label('sdk.offline.model', '/teams') + ->label('sdk', new Method( + namespace: 'teams', + name: 'list', + description: '/docs/references/teams/list-teams.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM_LIST, + ) + ] + )) ->param('queries', [], new Teams(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Teams::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -202,15 +218,18 @@ App::get('/v1/teams/:teamId') ->desc('Get team') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/teams/get-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'get', + description: '/docs/references/teams/get-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -229,14 +248,18 @@ App::get('/v1/teams/:teamId/prefs') ->desc('Get team preferences') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/teams/get-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getPrefs', + description: '/docs/references/teams/get-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('dbForProject') @@ -260,15 +283,18 @@ App::put('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/teams/update-team-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TEAM) - ->label('sdk.offline.model', '/teams') - ->label('sdk.offline.key', '{teamId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateName', + description: '/docs/references/teams/update-team-name.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TEAM, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('name', null, new Text(128), 'New team name. Max length: 128 chars.') ->inject('requestTimestamp') @@ -304,14 +330,18 @@ App::put('/v1/teams/:teamId/prefs') ->label('audits.event', 'team.update') ->label('audits.resource', 'team/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/teams/update-team-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) - ->label('sdk.offline.model', '/teams/{teamId}/prefs') + ->label('sdk', new Method( + namespace: 'teams', + name: 'updatePrefs', + description: '/docs/references/teams/update-team-prefs.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -339,12 +369,19 @@ App::delete('/v1/teams/:teamId') ->label('scope', 'teams.write') ->label('audits.event', 'team.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/teams/delete-team.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'delete', + description: '/docs/references/teams/delete-team.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('teamId', '', new UID(), 'Team ID.') ->inject('response') ->inject('getProjectDB') @@ -390,13 +427,18 @@ App::post('/v1/teams/:teamId/memberships') ->label('audits.event', 'membership.create') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'createMembership') - ->label('sdk.description', '/docs/references/teams/create-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'createMembership', + description: '/docs/references/teams/create-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MEMBERSHIP, + ) + ] + )) ->label('abuse-limit', 10) ->param('teamId', '', new UID(), 'Team ID.') ->param('email', '', new Email(), 'Email of the new team member.', true) @@ -423,7 +465,10 @@ App::post('/v1/teams/:teamId/memberships') ->inject('queueForMails') ->inject('queueForMessaging') ->inject('queueForEvents') - ->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) { + ->inject('timelimit') + ->inject('queueForUsage') + ->inject('plan') + ->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, Usage $queueForUsage, array $plan) { $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -467,17 +512,17 @@ App::post('/v1/teams/:teamId/memberships') $name = empty($name) ? $invitee->getAttribute('name', '') : $name; } elseif (!empty($email)) { $invitee = $dbForProject->findOne('users', [Query::equal('email', [$email])]); // Get user by email address - if (!empty($invitee) && !empty($phone) && $invitee->getAttribute('phone', '') !== $phone) { + if (!$invitee->isEmpty() && !empty($phone) && $invitee->getAttribute('phone', '') !== $phone) { throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given email and phone doesn\'t match', 409); } } elseif (!empty($phone)) { $invitee = $dbForProject->findOne('users', [Query::equal('phone', [$phone])]); - if (!empty($invitee) && !empty($email) && $invitee->getAttribute('email', '') !== $email) { + if (!$invitee->isEmpty() && !empty($email) && $invitee->getAttribute('email', '') !== $email) { throw new Exception(Exception::USER_ALREADY_EXISTS, 'Given phone and email doesn\'t match', 409); } } - if (empty($invitee)) { // Create new user if no user with same email found + if ($invitee->isEmpty()) { // Create new user if no user with same email found $limit = $project->getAttribute('auths', [])['limit'] ?? 0; if (!$isPrivilegedUser && !$isAppUser && $limit !== 0 && $project->getId() !== 'console') { // check users limit, console invites are allways allowed. @@ -492,7 +537,7 @@ App::post('/v1/teams/:teamId/memberships') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); } @@ -540,47 +585,58 @@ App::post('/v1/teams/:teamId/memberships') throw new Exception(Exception::USER_UNAUTHORIZED, 'User is not allowed to send invitations for this team'); } - $secret = Auth::tokenGenerator(); - - $membershipId = ID::unique(); - $membership = new Document([ - '$id' => $membershipId, - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::user($invitee->getId())), - Permission::update(Role::team($team->getId(), 'owner')), - Permission::delete(Role::user($invitee->getId())), - Permission::delete(Role::team($team->getId(), 'owner')), - ], - 'userId' => $invitee->getId(), - 'userInternalId' => $invitee->getInternalId(), - 'teamId' => $team->getId(), - 'teamInternalId' => $team->getInternalId(), - 'roles' => $roles, - 'invited' => DateTime::now(), - 'joined' => ($isPrivilegedUser || $isAppUser) ? DateTime::now() : null, - 'confirm' => ($isPrivilegedUser || $isAppUser), - 'secret' => Auth::hash($secret), - 'search' => implode(' ', [$membershipId, $invitee->getId()]) + $membership = $dbForProject->findOne('memberships', [ + Query::equal('userInternalId', [$invitee->getInternalId()]), + Query::equal('teamInternalId', [$team->getInternalId()]), ]); - if ($isPrivilegedUser || $isAppUser) { // Allow admin to create membership - try { - $membership = Authorization::skip(fn () => $dbForProject->createDocument('memberships', $membership)); - } catch (Duplicate $th) { - throw new Exception(Exception::TEAM_INVITE_ALREADY_EXISTS); - } + if ($membership->isEmpty()) { + $secret = Auth::tokenGenerator(); + $membershipId = ID::unique(); + $membership = new Document([ + '$id' => $membershipId, + '$permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::user($invitee->getId())), + Permission::update(Role::team($team->getId(), 'owner')), + Permission::delete(Role::user($invitee->getId())), + Permission::delete(Role::team($team->getId(), 'owner')), + ], + 'userId' => $invitee->getId(), + 'userInternalId' => $invitee->getInternalId(), + 'teamId' => $team->getId(), + 'teamInternalId' => $team->getInternalId(), + 'roles' => $roles, + 'invited' => DateTime::now(), + 'joined' => ($isPrivilegedUser || $isAppUser) ? DateTime::now() : null, + 'confirm' => ($isPrivilegedUser || $isAppUser), + 'secret' => Auth::hash($secret), + 'search' => implode(' ', [$membershipId, $invitee->getId()]) + ]); + + $membership = ($isPrivilegedUser || $isAppUser) ? + Authorization::skip(fn () => $dbForProject->createDocument('memberships', $membership)) : + $dbForProject->createDocument('memberships', $membership); Authorization::skip(fn () => $dbForProject->increaseDocumentAttribute('teams', $team->getId(), 'total', 1)); - $dbForProject->purgeCachedDocument('users', $invitee->getId()); } else { - try { - $membership = $dbForProject->createDocument('memberships', $membership); - } catch (Duplicate $th) { - throw new Exception(Exception::TEAM_INVITE_ALREADY_EXISTS); + $membership->setAttribute('invited', DateTime::now()); + + if ($isPrivilegedUser || $isAppUser) { + $membership->setAttribute('joined', DateTime::now()); + $membership->setAttribute('confirm', true); } + $membership = ($isPrivilegedUser || $isAppUser) ? + Authorization::skip(fn () => $dbForProject->updateDocument('memberships', $membership->getId(), $membership)) : + $dbForProject->updateDocument('memberships', $membership->getId(), $membership); + } + + + if ($isPrivilegedUser || $isAppUser) { + $dbForProject->purgeCachedDocument('users', $invitee->getId()); + } else { $url = Template::parseURL($url); $url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['membershipId' => $membership->getId(), 'userId' => $invitee->getId(), 'secret' => $secret, 'teamId' => $teamId]); $url = Template::unParseURL($url); @@ -650,7 +706,7 @@ App::post('/v1/teams/:teamId/memberships') 'owner' => $user->getAttribute('name'), 'direction' => $locale->getText('settings.direction'), /* {{user}}, {{team}}, {{redirect}} and {{project}} are required in default and custom templates */ - 'user' => $user->getAttribute('name'), + 'user' => $name, 'team' => $team->getAttribute('name'), 'redirect' => $url, 'project' => $projectName @@ -662,8 +718,8 @@ App::post('/v1/teams/:teamId/memberships') ->setRecipient($invitee->getAttribute('email')) ->setName($invitee->getAttribute('name')) ->setVariables($emailVariables) - ->trigger() - ; + ->trigger(); + } elseif (!empty($phone)) { if (empty(System::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception(Exception::GENERAL_PHONE_DISABLED, 'Phone provider not configured'); @@ -691,6 +747,27 @@ App::post('/v1/teams/:teamId/memberships') ->setMessage($messageDoc) ->setRecipients([$phone]) ->setProviderType('SMS'); + + if (isset($plan['authPhone'])) { + $timelimit = $timelimit('organization:{organizationId}', $plan['authPhone'], 30 * 24 * 60 * 60); // 30 days + $timelimit + ->setParam('{organizationId}', $project->getAttribute('teamId')); + + $abuse = new Abuse($timelimit); + if ($abuse->check() && System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') === 'enabled') { + $helper = PhoneNumberUtil::getInstance(); + $countryCode = $helper->parse($phone)->getCountryCode(); + + if (!empty($countryCode)) { + $queueForUsage + ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); + } + } + $queueForUsage + ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) + ->setProject($project) + ->trigger(); + } } } @@ -715,21 +792,25 @@ App::get('/v1/teams/:teamId/memberships') ->desc('List team memberships') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/teams/list-team-members.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') + ->label('sdk', new Method( + namespace: 'teams', + name: 'listMemberships', + description: '/docs/references/teams/list-team-members.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Memberships(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Memberships::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') + ->inject('project') ->inject('dbForProject') - ->action(function (string $teamId, array $queries, string $search, Response $response, Database $dbForProject) { - + ->action(function (string $teamId, array $queries, string $search, Response $response, Document $project, Database $dbForProject) { $team = $dbForProject->getDocument('teams', $teamId); if ($team->isEmpty()) { @@ -790,27 +871,51 @@ App::get('/v1/teams/:teamId/memberships') $memberships = array_filter($memberships, fn (Document $membership) => !empty($membership->getAttribute('userId'))); - $memberships = array_map(function ($membership) use ($dbForProject, $team) { - $user = $dbForProject->getDocument('users', $membership->getAttribute('userId')); + $membershipsPrivacy = [ + 'userName' => $project->getAttribute('auths', [])['membershipsUserName'] ?? true, + 'userEmail' => $project->getAttribute('auths', [])['membershipsUserEmail'] ?? true, + 'mfa' => $project->getAttribute('auths', [])['membershipsMfa'] ?? true, + ]; - $mfa = $user->getAttribute('mfa', false); - if ($mfa) { - $totp = TOTP::getAuthenticatorFromUser($user); - $totpEnabled = $totp && $totp->getAttribute('verified', false); - $emailEnabled = $user->getAttribute('email', false) && $user->getAttribute('emailVerification', false); - $phoneEnabled = $user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false); + $roles = Authorization::getRoles(); + $isPrivilegedUser = Auth::isPrivilegedUser($roles); + $isAppUser = Auth::isAppUser($roles); - if (!$totpEnabled && !$emailEnabled && !$phoneEnabled) { - $mfa = false; + $membershipsPrivacy = array_map(function ($privacy) use ($isPrivilegedUser, $isAppUser) { + return $privacy || $isPrivilegedUser || $isAppUser; + }, $membershipsPrivacy); + + $memberships = array_map(function ($membership) use ($dbForProject, $team, $membershipsPrivacy) { + $user = !empty(array_filter($membershipsPrivacy)) + ? $dbForProject->getDocument('users', $membership->getAttribute('userId')) + : new Document(); + + if ($membershipsPrivacy['mfa']) { + $mfa = $user->getAttribute('mfa', false); + + if ($mfa) { + $totp = TOTP::getAuthenticatorFromUser($user); + $totpEnabled = $totp && $totp->getAttribute('verified', false); + $emailEnabled = $user->getAttribute('email', false) && $user->getAttribute('emailVerification', false); + $phoneEnabled = $user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false); + + if (!$totpEnabled && !$emailEnabled && !$phoneEnabled) { + $mfa = false; + } } + + $membership->setAttribute('mfa', $mfa); } - $membership - ->setAttribute('mfa', $mfa) - ->setAttribute('teamName', $team->getAttribute('name')) - ->setAttribute('userName', $user->getAttribute('name')) - ->setAttribute('userEmail', $user->getAttribute('email')) - ; + if ($membershipsPrivacy['userName']) { + $membership->setAttribute('userName', $user->getAttribute('name')); + } + + if ($membershipsPrivacy['userEmail']) { + $membership->setAttribute('userEmail', $user->getAttribute('email')); + } + + $membership->setAttribute('teamName', $team->getAttribute('name')); return $membership; }, $memberships); @@ -825,20 +930,24 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') ->desc('Get team membership') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'getMembership') - ->label('sdk.description', '/docs/references/teams/get-team-member.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) - ->label('sdk.offline.model', '/teams/{teamId}/memberships') - ->label('sdk.offline.key', '{membershipId}') + ->label('sdk', new Method( + namespace: 'teams', + name: 'getMembership', + description: '/docs/references/teams/get-team-member.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') + ->inject('project') ->inject('dbForProject') - ->action(function (string $teamId, string $membershipId, Response $response, Database $dbForProject) { + ->action(function (string $teamId, string $membershipId, Response $response, Document $project, Database $dbForProject) { $team = $dbForProject->getDocument('teams', $teamId); @@ -852,27 +961,50 @@ App::get('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::MEMBERSHIP_NOT_FOUND); } - $user = $dbForProject->getDocument('users', $membership->getAttribute('userId')); + $membershipsPrivacy = [ + 'userName' => $project->getAttribute('auths', [])['membershipsUserName'] ?? true, + 'userEmail' => $project->getAttribute('auths', [])['membershipsUserEmail'] ?? true, + 'mfa' => $project->getAttribute('auths', [])['membershipsMfa'] ?? true, + ]; - $mfa = $user->getAttribute('mfa', false); + $roles = Authorization::getRoles(); + $isPrivilegedUser = Auth::isPrivilegedUser($roles); + $isAppUser = Auth::isAppUser($roles); - if ($mfa) { - $totp = TOTP::getAuthenticatorFromUser($user); - $totpEnabled = $totp && $totp->getAttribute('verified', false); - $emailEnabled = $user->getAttribute('email', false) && $user->getAttribute('emailVerification', false); - $phoneEnabled = $user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false); + $membershipsPrivacy = array_map(function ($privacy) use ($isPrivilegedUser, $isAppUser) { + return $privacy || $isPrivilegedUser || $isAppUser; + }, $membershipsPrivacy); - if (!$totpEnabled && !$emailEnabled && !$phoneEnabled) { - $mfa = false; + $user = !empty(array_filter($membershipsPrivacy)) + ? $dbForProject->getDocument('users', $membership->getAttribute('userId')) + : new Document(); + + if ($membershipsPrivacy['mfa']) { + $mfa = $user->getAttribute('mfa', false); + + if ($mfa) { + $totp = TOTP::getAuthenticatorFromUser($user); + $totpEnabled = $totp && $totp->getAttribute('verified', false); + $emailEnabled = $user->getAttribute('email', false) && $user->getAttribute('emailVerification', false); + $phoneEnabled = $user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false); + + if (!$totpEnabled && !$emailEnabled && !$phoneEnabled) { + $mfa = false; + } } + + $membership->setAttribute('mfa', $mfa); } - $membership - ->setAttribute('mfa', $mfa) - ->setAttribute('teamName', $team->getAttribute('name')) - ->setAttribute('userName', $user->getAttribute('name')) - ->setAttribute('userEmail', $user->getAttribute('email')) - ; + if ($membershipsPrivacy['userName']) { + $membership->setAttribute('userName', $user->getAttribute('name')); + } + + if ($membershipsPrivacy['userEmail']) { + $membership->setAttribute('userEmail', $user->getAttribute('email')); + } + + $membership->setAttribute('teamName', $team->getAttribute('name')); $response->dynamic($membership, Response::MODEL_MEMBERSHIP); }); @@ -884,13 +1016,18 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembership') - ->label('sdk.description', '/docs/references/teams/update-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembership', + description: '/docs/references/teams/update-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('roles', [], function (Document $project) { @@ -967,13 +1104,18 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->label('audits.event', 'membership.update') ->label('audits.resource', 'team/{request.teamId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'updateMembershipStatus') - ->label('sdk.description', '/docs/references/teams/update-team-membership-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP) + ->label('sdk', new Method( + namespace: 'teams', + name: 'updateMembershipStatus', + description: '/docs/references/teams/update-team-membership-status.md', + auth: [AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->param('userId', '', new UID(), 'User ID.') @@ -1012,7 +1154,8 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') throw new Exception(Exception::TEAM_INVITE_MISMATCH, 'Invite does not belong to current user (' . $user->getAttribute('email') . ')'); } - if ($user->isEmpty()) { + $hasSession = !$user->isEmpty(); + if (!$hasSession) { $user->setAttributes($dbForProject->getDocument('users', $userId)->getArrayCopy()); // Get user } @@ -1031,39 +1174,64 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') Authorization::skip(fn () => $dbForProject->updateDocument('users', $user->getId(), $user->setAttribute('emailVerification', true))); - // Log user in + // Create session for the user if not logged in + if (!$hasSession) { + Authorization::setRole(Role::user($user->getId())->toString()); - Authorization::setRole(Role::user($user->getId())->toString()); + $detector = new Detector($request->getUserAgent('UNKNOWN')); + $record = $geodb->get($request->getIP()); + $authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; + $expire = DateTime::addSeconds(new \DateTime(), $authDuration); + $secret = Auth::tokenGenerator(); + $session = new Document(array_merge([ + '$id' => ID::unique(), + '$permissions' => [ + Permission::read(Role::user($user->getId())), + Permission::update(Role::user($user->getId())), + Permission::delete(Role::user($user->getId())), + ], + 'userId' => $user->getId(), + 'userInternalId' => $user->getInternalId(), + 'provider' => Auth::SESSION_PROVIDER_EMAIL, + 'providerUid' => $user->getAttribute('email'), + 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak + 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'ip' => $request->getIP(), + 'factors' => ['email'], + 'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--', + 'expire' => DateTime::addSeconds(new \DateTime(), $authDuration) + ], $detector->getOS(), $detector->getClient(), $detector->getDevice())); - $detector = new Detector($request->getUserAgent('UNKNOWN')); - $record = $geodb->get($request->getIP()); - $authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; - $expire = DateTime::addSeconds(new \DateTime(), $authDuration); - $secret = Auth::tokenGenerator(); - $session = new Document(array_merge([ - '$id' => ID::unique(), - 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), - 'provider' => Auth::SESSION_PROVIDER_EMAIL, - 'providerUid' => $user->getAttribute('email'), - 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak - 'userAgent' => $request->getUserAgent('UNKNOWN'), - 'ip' => $request->getIP(), - 'factors' => ['email'], - 'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--', - 'expire' => DateTime::addSeconds(new \DateTime(), $authDuration) - ], $detector->getOS(), $detector->getClient(), $detector->getDevice())); + $session = $dbForProject->createDocument('sessions', $session); - $session = $dbForProject->createDocument('sessions', $session - ->setAttribute('$permissions', [ - Permission::read(Role::user($user->getId())), - Permission::update(Role::user($user->getId())), - Permission::delete(Role::user($user->getId())), - ])); + Authorization::setRole(Role::user($userId)->toString()); - $dbForProject->purgeCachedDocument('users', $user->getId()); + if (!Config::getParam('domainVerification')) { + $response->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])); + } - Authorization::setRole(Role::user($userId)->toString()); + $response + ->addCookie( + name: Auth::$cookieName . '_legacy', + value: Auth::encodeSession($user->getId(), $secret), + expire: (new \DateTime($expire))->getTimestamp(), + path: '/', + domain: Config::getParam('cookieDomain'), + secure: ('https' === $protocol), + httponly: true + ) + ->addCookie( + name: Auth::$cookieName, + value: Auth::encodeSession($user->getId(), $secret), + expire: (new \DateTime($expire))->getTimestamp(), + path: '/', + domain: Config::getParam('cookieDomain'), + secure: ('https' === $protocol), + httponly: true, + sameSite: Config::getParam('cookieSamesite') + ) + ; + } $membership = $dbForProject->updateDocument('memberships', $membership->getId(), $membership); @@ -1077,22 +1245,11 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') ->setParam('membershipId', $membership->getId()) ; - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) - ; - } - - $response - ->addCookie(Auth::$cookieName . '_legacy', Auth::encodeSession($user->getId(), $secret), (new \DateTime($expire))->getTimestamp(), '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) - ->addCookie(Auth::$cookieName, Auth::encodeSession($user->getId(), $secret), (new \DateTime($expire))->getTimestamp(), '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, Config::getParam('cookieSamesite')) - ; - $response->dynamic( $membership - ->setAttribute('teamName', $team->getAttribute('name')) - ->setAttribute('userName', $user->getAttribute('name')) - ->setAttribute('userEmail', $user->getAttribute('email')), + ->setAttribute('teamName', $team->getAttribute('name')) + ->setAttribute('userName', $user->getAttribute('name')) + ->setAttribute('userEmail', $user->getAttribute('email')), Response::MODEL_MEMBERSHIP ); }); @@ -1104,12 +1261,19 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') ->label('scope', 'teams.write') ->label('audits.event', 'membership.delete') ->label('audits.resource', 'team/{request.teamId}') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'deleteMembership') - ->label('sdk.description', '/docs/references/teams/delete-team-membership.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'teams', + name: 'deleteMembership', + description: '/docs/references/teams/delete-team-membership.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') ->inject('response') @@ -1167,13 +1331,18 @@ App::get('/v1/teams/:teamId/logs') ->desc('List team logs') ->groups(['api', 'teams']) ->label('scope', 'teams.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'teams') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/teams/get-team-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'teams', + name: 'listLogs', + description: '/docs/references/teams/get-team-logs.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] + )) ->param('teamId', '', new UID(), 'Team ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index f0378ed0e3..962022927f 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -15,6 +15,10 @@ use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Database\Validator\Queries\Identities; use Appwrite\Utopia\Database\Validator\Queries\Targets; @@ -51,7 +55,7 @@ use Utopia\Validator\Text; use Utopia\Validator\WhiteList; /** TODO: Remove function when we move to using utopia/platform */ -function createUser(string $hash, mixed $hashOptions, string $userId, ?string $email, ?string $password, ?string $phone, string $name, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks): Document +function createUser(string $hash, mixed $hashOptions, string $userId, ?string $email, ?string $password, ?string $phone, string $name, Document $project, Database $dbForProject, Hooks $hooks): Document { $plaintextPassword = $password; $hashOptionsObject = (\is_string($hashOptions)) ? \json_decode($hashOptions, true) : $hashOptions; // Cast to JSON array @@ -64,7 +68,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); } } @@ -141,7 +145,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$email]), ]); - if ($existingTarget) { + if (!$existingTarget->isEmpty()) { $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } @@ -165,7 +169,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e $existingTarget = $dbForProject->findOne('targets', [ Query::equal('identifier', [$phone]), ]); - if ($existingTarget) { + if (!$existingTarget->isEmpty()) { $user->setAttribute('targets', $existingTarget, Document::SET_TYPE_APPEND); } } @@ -176,25 +180,27 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e throw new Exception(Exception::USER_ALREADY_EXISTS); } - $queueForEvents->setParam('userId', $user->getId()); - return $user; } App::post('/v1/users') ->desc('Create user') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'create') - ->label('sdk.description', '/docs/references/users/create-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'create', + description: '/docs/references/users/create-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', null, new Email(), 'User email.', true) ->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) @@ -203,10 +209,9 @@ App::post('/v1/users') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('plaintext', '{}', $userId, $email, $password, $phone, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, ?string $email, ?string $phone, ?string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('plaintext', '{}', $userId, $email, $password, $phone, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) ->dynamic($user, Response::MODEL_USER); @@ -215,17 +220,21 @@ App::post('/v1/users') App::post('/v1/users/bcrypt') ->desc('Create user with bcrypt password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createBcryptUser') - ->label('sdk.description', '/docs/references/users/create-bcrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createBcryptUser', + description: '/docs/references/users/create-bcrypt-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Bcrypt.') @@ -233,10 +242,9 @@ App::post('/v1/users/bcrypt') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('bcrypt', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('bcrypt', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -246,17 +254,21 @@ App::post('/v1/users/bcrypt') App::post('/v1/users/md5') ->desc('Create user with MD5 password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMD5User') - ->label('sdk.description', '/docs/references/users/create-md5-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMD5User', + description: '/docs/references/users/create-md5-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using MD5.') @@ -264,10 +276,9 @@ App::post('/v1/users/md5') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('md5', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('md5', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -277,17 +288,21 @@ App::post('/v1/users/md5') App::post('/v1/users/argon2') ->desc('Create user with Argon2 password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createArgon2User') - ->label('sdk.description', '/docs/references/users/create-argon2-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createArgon2User', + description: '/docs/references/users/create-argon2-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Argon2.') @@ -295,10 +310,9 @@ App::post('/v1/users/argon2') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('argon2', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('argon2', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -308,17 +322,21 @@ App::post('/v1/users/argon2') App::post('/v1/users/sha') ->desc('Create user with SHA password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSHAUser') - ->label('sdk.description', '/docs/references/users/create-sha-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSHAUser', + description: '/docs/references/users/create-sha-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using SHA.') @@ -327,16 +345,15 @@ App::post('/v1/users/sha') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $passwordVersion, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { + ->action(function (string $userId, string $email, string $password, string $passwordVersion, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { $options = '{}'; if (!empty($passwordVersion)) { $options = '{"version":"' . $passwordVersion . '"}'; } - $user = createUser('sha', $options, $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + $user = createUser('sha', $options, $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -346,17 +363,21 @@ App::post('/v1/users/sha') App::post('/v1/users/phpass') ->desc('Create user with PHPass password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createPHPassUser') - ->label('sdk.description', '/docs/references/users/create-phpass-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createPHPassUser', + description: '/docs/references/users/create-phpass-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using PHPass.') @@ -364,10 +385,9 @@ App::post('/v1/users/phpass') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('phpass', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('phpass', '{}', $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -377,17 +397,21 @@ App::post('/v1/users/phpass') App::post('/v1/users/scrypt') ->desc('Create user with Scrypt password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptUser', + description: '/docs/references/users/create-scrypt-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt.') @@ -400,9 +424,8 @@ App::post('/v1/users/scrypt') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { + ->action(function (string $userId, string $email, string $password, string $passwordSalt, int $passwordCpu, int $passwordMemory, int $passwordParallel, int $passwordLength, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { $options = [ 'salt' => $passwordSalt, 'costCpu' => $passwordCpu, @@ -411,7 +434,7 @@ App::post('/v1/users/scrypt') 'length' => $passwordLength ]; - $user = createUser('scrypt', \json_encode($options), $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + $user = createUser('scrypt', \json_encode($options), $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -421,17 +444,21 @@ App::post('/v1/users/scrypt') App::post('/v1/users/scrypt-modified') ->desc('Create user with Scrypt modified password') ->groups(['api', 'users']) - ->label('event', 'users.[userId].create') ->label('scope', 'users.write') ->label('audits.event', 'user.create') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createScryptModifiedUser') - ->label('sdk.description', '/docs/references/users/create-scrypt-modified-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'createScryptModifiedUser', + description: '/docs/references/users/create-scrypt-modified-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt Modified.') @@ -442,10 +469,9 @@ App::post('/v1/users/scrypt-modified') ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('queueForEvents') ->inject('hooks') - ->action(function (string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, string $name, Response $response, Document $project, Database $dbForProject, Event $queueForEvents, Hooks $hooks) { - $user = createUser('scryptMod', '{"signerKey":"' . $passwordSignerKey . '","saltSeparator":"' . $passwordSaltSeparator . '","salt":"' . $passwordSalt . '"}', $userId, $email, $password, null, $name, $project, $dbForProject, $queueForEvents, $hooks); + ->action(function (string $userId, string $email, string $password, string $passwordSalt, string $passwordSaltSeparator, string $passwordSignerKey, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { + $user = createUser('scryptMod', '{"signerKey":"' . $passwordSignerKey . '","saltSeparator":"' . $passwordSaltSeparator . '","salt":"' . $passwordSalt . '"}', $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -459,13 +485,18 @@ App::post('/v1/users/:userId/targets') ->label('audits.resource', 'target/response.$id') ->label('event', 'users.[userId].targets.[targetId].create') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createTarget') - ->label('sdk.description', '/docs/references/users/create-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'createTarget', + description: '/docs/references/users/create-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TARGET, + ) + ] + )) ->param('targetId', '', new CustomId(), 'Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('userId', '', new UID(), 'User ID.') ->param('providerType', '', new WhiteList([MESSAGE_TYPE_EMAIL, MESSAGE_TYPE_SMS, MESSAGE_TYPE_PUSH]), 'The target provider type. Can be one of the following: `email`, `sms` or `push`.') @@ -545,13 +576,18 @@ App::get('/v1/users') ->desc('List users') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/users/list-users.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'list', + description: '/docs/references/users/list-users.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER_LIST, + ) + ] + )) ->param('queries', [], new Users(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -605,13 +641,18 @@ App::get('/v1/users/:userId') ->desc('Get user') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/users/get-user.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'get', + description: '/docs/references/users/get-user.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -630,13 +671,18 @@ App::get('/v1/users/:userId/prefs') ->desc('Get user preferences') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getPrefs') - ->label('sdk.description', '/docs/references/users/get-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getPrefs', + description: '/docs/references/users/get-user-prefs.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -657,13 +703,18 @@ App::get('/v1/users/:userId/targets/:targetId') ->desc('Get user target') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getTarget') - ->label('sdk.description', '/docs/references/users/get-user-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'getTarget', + description: '/docs/references/users/get-user-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('response') @@ -689,13 +740,18 @@ App::get('/v1/users/:userId/sessions') ->desc('List user sessions') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listSessions') - ->label('sdk.description', '/docs/references/users/list-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listSessions', + description: '/docs/references/users/list-user-sessions.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_SESSION_LIST, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -730,13 +786,18 @@ App::get('/v1/users/:userId/memberships') ->desc('List user memberships') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMemberships') - ->label('sdk.description', '/docs/references/users/list-user-memberships.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MEMBERSHIP_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMemberships', + description: '/docs/references/users/list-user-memberships.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MEMBERSHIP_LIST, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -769,13 +830,18 @@ App::get('/v1/users/:userId/logs') ->desc('List user logs') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listLogs') - ->label('sdk.description', '/docs/references/users/list-user-logs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_LOG_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listLogs', + description: '/docs/references/users/list-user-logs.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_LOG_LIST, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Queries([new Limit(), new Offset()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset', true) ->inject('response') @@ -858,13 +924,18 @@ App::get('/v1/users/:userId/targets') ->desc('List user targets') ->groups(['api', 'users']) ->label('scope', 'targets.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listTargets') - ->label('sdk.description', '/docs/references/users/list-user-targets.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listTargets', + description: '/docs/references/users/list-user-targets.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET_LIST, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) ->inject('response') @@ -918,13 +989,18 @@ App::get('/v1/users/identities') ->desc('List identities') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listIdentities') - ->label('sdk.description', '/docs/references/users/list-identities.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_IDENTITY_LIST) + ->label('sdk', new Method( + namespace: 'users', + name: 'listIdentities', + description: '/docs/references/users/list-identities.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_IDENTITY_LIST, + ) + ] + )) ->param('queries', [], new Identities(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Identities::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') @@ -982,13 +1058,18 @@ App::patch('/v1/users/:userId/status') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateStatus') - ->label('sdk.description', '/docs/references/users/update-user-status.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateStatus', + description: '/docs/references/users/update-user-status.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('status', null, new Boolean(true), 'User Status. To activate the user pass `true` and to block the user pass `false`.') ->inject('response') @@ -1017,13 +1098,18 @@ App::put('/v1/users/:userId/labels') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateLabels') - ->label('sdk.description', '/docs/references/users/update-user-labels.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateLabels', + description: '/docs/references/users/update-user-labels.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('labels', [], new ArrayList(new Text(36, allowList: [...Text::NUMBERS, ...Text::ALPHABET_UPPER, ...Text::ALPHABET_LOWER]), APP_LIMIT_ARRAY_LABELS_SIZE), 'Array of user labels. Replaces the previous labels. Maximum of ' . APP_LIMIT_ARRAY_LABELS_SIZE . ' labels are allowed, each up to 36 alphanumeric characters long.') ->inject('response') @@ -1054,13 +1140,18 @@ App::patch('/v1/users/:userId/verification/phone') ->label('scope', 'users.write') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhoneVerification') - ->label('sdk.description', '/docs/references/users/update-user-phone-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhoneVerification', + description: '/docs/references/users/update-user-phone-verification.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('phoneVerification', false, new Boolean(), 'User phone verification status.') ->inject('response') @@ -1090,13 +1181,18 @@ App::patch('/v1/users/:userId/name') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/users/update-user-name.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateName', + description: '/docs/references/users/update-user-name.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('name', '', new Text(128, 0), 'User name. Max length: 128 chars.') ->inject('response') @@ -1127,13 +1223,18 @@ App::patch('/v1/users/:userId/password') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/users/update-user-password.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePassword', + description: '/docs/references/users/update-user-password.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('password', '', fn ($project, $passwordsDictionary) => new PasswordDictionary($passwordsDictionary, enabled: $project->getAttribute('auths', [])['passwordDictionary'] ?? false, allowEmpty: true), 'New user password. Must be at least 8 chars.', false, ['project', 'passwordsDictionary']) ->inject('response') @@ -1204,13 +1305,18 @@ App::patch('/v1/users/:userId/email') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmail') - ->label('sdk.description', '/docs/references/users/update-user-email.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmail', + description: '/docs/references/users/update-user-email.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('email', '', new Email(allowEmpty: true), 'User email.') ->inject('response') @@ -1232,7 +1338,7 @@ App::patch('/v1/users/:userId/email') Query::equal('providerEmail', [$email]), Query::notEqual('userInternalId', $user->getInternalId()), ]); - if ($identityWithMatchingEmail !== false && !$identityWithMatchingEmail->isEmpty()) { + if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); } @@ -1298,13 +1404,18 @@ App::patch('/v1/users/:userId/phone') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePhone') - ->label('sdk.description', '/docs/references/users/update-user-phone.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePhone', + description: '/docs/references/users/update-user-phone.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('number', '', new Phone(allowEmpty: true), 'User phone number.') ->inject('response') @@ -1382,13 +1493,18 @@ App::patch('/v1/users/:userId/verification') ->label('audits.event', 'verification.update') ->label('audits.resource', 'user/{request.userId}') ->label('audits.userId', '{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateEmailVerification') - ->label('sdk.description', '/docs/references/users/update-user-email-verification.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateEmailVerification', + description: '/docs/references/users/update-user-email-verification.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('emailVerification', false, new Boolean(), 'User email verification status.') ->inject('response') @@ -1414,13 +1530,18 @@ App::patch('/v1/users/:userId/prefs') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.prefs') ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updatePrefs') - ->label('sdk.description', '/docs/references/users/update-user-prefs.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PREFERENCES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updatePrefs', + description: '/docs/references/users/update-user-prefs.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PREFERENCES, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('prefs', '', new Assoc(), 'Prefs key-value JSON object.') ->inject('response') @@ -1449,13 +1570,18 @@ App::patch('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{response.$id}') ->label('event', 'users.[userId].targets.[targetId].update') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateTarget') - ->label('sdk.description', '/docs/references/users/update-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TARGET) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateTarget', + description: '/docs/references/users/update-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_TARGET, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->param('identifier', '', new Text(Database::LENGTH_KEY), 'The target identifier (token, email, phone etc.)', true) @@ -1503,7 +1629,9 @@ App::patch('/v1/users/:userId/targets/:targetId') throw new Exception(Exception::PROVIDER_INCORRECT_TYPE); } - $target->setAttribute('identifier', $identifier); + $target + ->setAttribute('identifier', $identifier) + ->setAttribute('expired', false); } if ($providerId) { @@ -1517,8 +1645,9 @@ App::patch('/v1/users/:userId/targets/:targetId') throw new Exception(Exception::PROVIDER_INCORRECT_TYPE); } - $target->setAttribute('providerId', $provider->getId()); - $target->setAttribute('providerInternalId', $provider->getInternalId()); + $target + ->setAttribute('providerId', $provider->getId()) + ->setAttribute('providerInternalId', $provider->getInternalId()); } if ($name) { @@ -1545,13 +1674,18 @@ App::patch('/v1/users/:userId/mfa') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfa') - ->label('sdk.description', '/docs/references/users/update-user-mfa.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfa', + description: '/docs/references/users/update-user-mfa.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USER, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('mfa', null, new Boolean(), 'Enable or disable MFA.') ->inject('response') @@ -1579,13 +1713,18 @@ App::get('/v1/users/:userId/mfa/factors') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'listMfaFactors') - ->label('sdk.description', '/docs/references/users/list-mfa-factors.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_FACTORS) + ->label('sdk', new Method( + namespace: 'users', + name: 'listMfaFactors', + description: '/docs/references/users/list-mfa-factors.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_FACTORS, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1612,13 +1751,18 @@ App::get('/v1/users/:userId/mfa/recovery-codes') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/get-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'getMfaRecoveryCodes', + description: '/docs/references/users/get-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1651,13 +1795,18 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/create-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'createMfaRecoveryCodes', + description: '/docs/references/users/create-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1697,13 +1846,18 @@ App::put('/v1/users/:userId/mfa/recovery-codes') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'updateMfaRecoveryCodes') - ->label('sdk.description', '/docs/references/users/update-mfa-recovery-codes.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_MFA_RECOVERY_CODES) + ->label('sdk', new Method( + namespace: 'users', + name: 'updateMfaRecoveryCodes', + description: '/docs/references/users/update-mfa-recovery-codes.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_MFA_RECOVERY_CODES, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1742,13 +1896,19 @@ App::delete('/v1/users/:userId/mfa/authenticators/:type') ->label('audits.resource', 'user/{response.$id}') ->label('audits.userId', '{response.$id}') ->label('usage.metric', 'users.{scope}.requests.update') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteMfaAuthenticator') - ->label('sdk.description', '/docs/references/users/delete-mfa-authenticator.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USER) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteMfaAuthenticator', + description: '/docs/references/users/delete-mfa-authenticator.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('userId', '', new UID(), 'User ID.') ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator.') ->inject('response') @@ -1783,13 +1943,18 @@ App::post('/v1/users/:userId/sessions') ->label('audits.event', 'session.create') ->label('audits.resource', 'user/{request.userId}') ->label('usage.metric', 'sessions.{scope}.requests.create') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createSession') - ->label('sdk.description', '/docs/references/users/create-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_SESSION) + ->label('sdk', new Method( + namespace: 'users', + name: 'createSession', + description: '/docs/references/users/create-session.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_SESSION, + ) + ] + )) ->param('userId', '', new CustomId(), 'User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->inject('request') ->inject('response') @@ -1819,6 +1984,7 @@ App::post('/v1/users/:userId/sessions') 'provider' => Auth::SESSION_PROVIDER_SERVER, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak 'userAgent' => $request->getUserAgent('UNKNOWN'), + 'factors' => ['server'], 'ip' => $request->getIP(), 'countryCode' => ($record) ? \strtolower($record['country']['iso_code']) : '--', 'expire' => $expire, @@ -1828,11 +1994,20 @@ App::post('/v1/users/:userId/sessions') $detector->getDevice() )); + $session->setAttribute('$permissions', [ + Permission::read(Role::user($user->getId())), + Permission::update(Role::user($user->getId())), + Permission::delete(Role::user($user->getId())), + ]); + $countryName = $locale->getText('countries.' . strtolower($session->getAttribute('countryCode')), $locale->getText('locale.country.unknown')); $session = $dbForProject->createDocument('sessions', $session); + + $dbForProject->purgeCachedDocument('users', $user->getId()); + $session - ->setAttribute('secret', $secret) + ->setAttribute('secret', Auth::encodeSession($user->getId(), $secret)) ->setAttribute('countryName', $countryName); $queueForEvents @@ -1852,13 +2027,18 @@ App::post('/v1/users/:userId/tokens') ->label('scope', 'users.write') ->label('audits.event', 'tokens.create') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createToken') - ->label('sdk.description', '/docs/references/users/create-token.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_TOKEN) + ->label('sdk', new Method( + namespace: 'users', + name: 'createToken', + description: '/docs/references/users/create-token.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_TOKEN, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('length', 6, new Range(4, 128), 'Token length in characters. The default length is 6 characters', true) ->param('expire', Auth::TOKEN_EXPIRATION_GENERIC, new Range(60, Auth::TOKEN_EXPIRATION_LOGIN_LONG), 'Token expiration period in seconds. The default expiration is 15 minutes.', true) @@ -1909,12 +2089,19 @@ App::delete('/v1/users/:userId/sessions/:sessionId') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSession') - ->label('sdk.description', '/docs/references/users/delete-user-session.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSession', + description: '/docs/references/users/delete-user-session.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID.') ->inject('response') @@ -1952,12 +2139,19 @@ App::delete('/v1/users/:userId/sessions') ->label('scope', 'users.write') ->label('audits.event', 'session.delete') ->label('audits.resource', 'user/{user.$id}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteSessions') - ->label('sdk.description', '/docs/references/users/delete-user-sessions.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteSessions', + description: '/docs/references/users/delete-user-sessions.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -1994,12 +2188,19 @@ App::delete('/v1/users/:userId') ->label('scope', 'users.write') ->label('audits.event', 'user.delete') ->label('audits.resource', 'user/{request.userId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/users/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'delete', + description: '/docs/references/users/delete.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('userId', '', new UID(), 'User ID.') ->inject('response') ->inject('dbForProject') @@ -2036,13 +2237,19 @@ App::delete('/v1/users/:userId/targets/:targetId') ->label('audits.resource', 'target/{request.$targetId}') ->label('event', 'users.[userId].targets.[targetId].delete') ->label('scope', 'targets.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteTarget') - ->label('sdk.description', '/docs/references/users/delete-target.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteTarget', + description: '/docs/references/users/delete-target.md', + auth: [AuthType::KEY, AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('userId', '', new UID(), 'User ID.') ->param('targetId', '', new UID(), 'Target ID.') ->inject('queueForEvents') @@ -2087,12 +2294,19 @@ App::delete('/v1/users/identities/:identityId') ->label('scope', 'users.write') ->label('audits.event', 'identity.delete') ->label('audits.resource', 'identity/{request.$identityId}') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'deleteIdentity') - ->label('sdk.description', '/docs/references/users/delete-identity.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'users', + name: 'deleteIdentity', + description: '/docs/references/users/delete-identity.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE, + )) ->param('identityId', '', new UID(), 'Identity ID.') ->inject('response') ->inject('dbForProject') @@ -2119,13 +2333,18 @@ App::post('/v1/users/:userId/jwts') ->desc('Create user JWT') ->groups(['api', 'users']) ->label('scope', 'users.write') - ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'createJWT') - ->label('sdk.description', '/docs/references/users/create-user-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'users', + name: 'createJWT', + description: '/docs/references/users/create-user-jwt.md', + auth: [AuthType::KEY], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_JWT, + ) + ] + )) ->param('userId', '', new UID(), 'User ID.') ->param('sessionId', '', new UID(), 'Session ID. Use the string \'recent\' to use the most recent session. Defaults to the most recent session.', true) ->param('duration', 900, new Range(0, 3600), 'Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.', true) @@ -2169,12 +2388,18 @@ App::get('/v1/users/usage') ->desc('Get users usage stats') ->groups(['api', 'users']) ->label('scope', 'users.read') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.namespace', 'users') - ->label('sdk.method', 'getUsage') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_USAGE_USERS) + ->label('sdk', new Method( + namespace: 'users', + name: 'getUsage', + description: '/docs/references/users/get-usage.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_USAGE_USERS, + ) + ] + )) ->param('range', '30d', new WhiteList(['24h', '30d', '90d'], true), 'Date range.', true) ->inject('response') ->inject('dbForProject') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index e79eb67936..2c145febcc 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -4,6 +4,11 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\MethodType; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\Installations; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; @@ -42,7 +47,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 $dbForConsole, Build $queueForBuilds, callable $getProjectDB, Request $request) { +$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, Request $request) { $errors = []; foreach ($repositories as $resource) { try { @@ -53,7 +58,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $projectId = $resource->getAttribute('projectId'); - $project = Authorization::skip(fn () => $dbForConsole->getDocument('projects', $projectId)); + $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); $dbForProject = $getProjectDB($project); $functionId = $resource->getAttribute('resourceId'); @@ -104,13 +109,13 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $latestCommentId = ''; if (!empty($providerPullRequestId) && $function->getAttribute('providerSilentMode', false) === false) { - $latestComment = Authorization::skip(fn () => $dbForConsole->findOne('vcsComments', [ + $latestComment = Authorization::skip(fn () => $dbForPlatform->findOne('vcsComments', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::equal('providerPullRequestId', [$providerPullRequestId]), Query::orderDesc('$createdAt'), ])); - if ($latestComment !== false && !$latestComment->isEmpty()) { + if (!$latestComment->isEmpty()) { $latestCommentId = $latestComment->getAttribute('providerCommentId', ''); $comment = new Comment(); $comment->parseComment($github->getComment($owner, $repositoryName, $latestCommentId)); @@ -125,7 +130,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if (!empty($latestCommentId)) { $teamId = $project->getAttribute('teamId', ''); - $latestComment = Authorization::skip(fn () => $dbForConsole->createDocument('vcsComments', new Document([ + $latestComment = Authorization::skip(fn () => $dbForPlatform->createDocument('vcsComments', new Document([ '$id' => ID::unique(), '$permissions' => [ Permission::read(Role::team(ID::custom($teamId))), @@ -146,7 +151,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } } } elseif (!empty($providerBranch)) { - $latestComments = Authorization::skip(fn () => $dbForConsole->find('vcsComments', [ + $latestComments = Authorization::skip(fn () => $dbForPlatform->find('vcsComments', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::equal('providerBranch', [$providerBranch]), Query::orderDesc('$createdAt'), @@ -267,15 +272,22 @@ App::get('/v1/vcs/github/authorize') ->desc('Install GitHub app') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') ->label('error', __DIR__ . '/../../views/general/error.phtml') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createGitHubInstallation') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_MOVED_PERMANENTLY) - ->label('sdk.response.type', Response::CONTENT_TYPE_HTML) - ->label('sdk.methodType', 'webAuth') - ->label('sdk.hide', true) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createGitHubInstallation', + description: '/docs/references/vcs/create-github-installation.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_MOVED_PERMANENTLY, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::HTML, + type: MethodType::WEBAUTH, + hide: true, + )) ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients']) ->inject('request') @@ -319,8 +331,8 @@ App::get('/v1/vcs/github/callback') ->inject('project') ->inject('request') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $providerInstallationId, string $setupAction, string $state, string $code, GitHub $github, Document $user, Document $project, Request $request, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $providerInstallationId, string $setupAction, string $state, string $code, GitHub $github, Document $user, Document $project, Request $request, Response $response, Database $dbForPlatform) { if (empty($state)) { $error = 'Installation requests from organisation members for the Appwrite GitHub App are currently unsupported. To proceed with the installation, login to the Appwrite Console and install the GitHub App.'; throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, $error); @@ -339,7 +351,7 @@ App::get('/v1/vcs/github/callback') $redirectSuccess = $state['success'] ?? ''; $redirectFailure = $state['failure'] ?? ''; - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { $error = 'Project with the ID from state could not be found.'; @@ -355,55 +367,6 @@ App::get('/v1/vcs/github/callback') throw new Exception(Exception::PROJECT_NOT_FOUND, $error); } - $personalSlug = ''; - - // OAuth Authroization - if (!empty($code)) { - $oauth2 = new OAuth2Github(System::getEnv('_APP_VCS_GITHUB_CLIENT_ID', ''), System::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', ''), ""); - $accessToken = $oauth2->getAccessToken($code) ?? ''; - $refreshToken = $oauth2->getRefreshToken($code) ?? ''; - $accessTokenExpiry = $oauth2->getAccessTokenExpiry($code) ?? ''; - $personalSlug = $oauth2->getUserSlug($accessToken) ?? ''; - $email = $oauth2->getUserEmail($accessToken); - $oauth2ID = $oauth2->getUserID($accessToken); - - // Makes sure this email is not already used in another identity - $identity = $dbForConsole->findOne('identities', [ - Query::equal('providerEmail', [$email]), - ]); - if ($identity !== false && !$identity->isEmpty()) { - if ($identity->getAttribute('userInternalId', '') !== $user->getInternalId()) { - throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); - } - } - - if ($identity !== false && !$identity->isEmpty()) { - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$accessTokenExpiry)); - - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); - } else { - $identity = $dbForConsole->createDocument('identities', new Document([ - '$id' => ID::unique(), - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::user($user->getId())), - Permission::delete(Role::user($user->getId())), - ], - 'userInternalId' => $user->getInternalId(), - 'userId' => $user->getId(), - 'provider' => 'github', - 'providerUid' => $oauth2ID, - 'providerEmail' => $email, - 'providerAccessToken' => $accessToken, - 'providerRefreshToken' => $refreshToken, - 'providerAccessTokenExpiry' => DateTime::addSeconds(new \DateTime(), (int)$accessTokenExpiry), - ])); - } - } - // Create / Update installation if (!empty($providerInstallationId)) { $privateKey = System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'); @@ -413,12 +376,28 @@ App::get('/v1/vcs/github/callback') $projectInternalId = $project->getInternalId(); - $installation = $dbForConsole->findOne('installations', [ + $installation = $dbForPlatform->findOne('installations', [ Query::equal('providerInstallationId', [$providerInstallationId]), Query::equal('projectInternalId', [$projectInternalId]) ]); - if ($installation === false || $installation->isEmpty()) { + $personal = false; + $refreshToken = null; + $accessToken = null; + $accessTokenExpiry = null; + + if (!empty($code)) { + $oauth2 = new OAuth2Github(System::getEnv('_APP_VCS_GITHUB_CLIENT_ID', ''), System::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', ''), ""); + + $accessToken = $oauth2->getAccessToken($code) ?? ''; + $refreshToken = $oauth2->getRefreshToken($code) ?? ''; + $accessTokenExpiry = DateTime::addSeconds(new \DateTime(), \intval($oauth2->getAccessTokenExpiry($code))); + + $personalSlug = $oauth2->getUserSlug($accessToken) ?? ''; + $personal = $personalSlug === $owner; + } + + if ($installation->isEmpty()) { $teamId = $project->getAttribute('teamId', ''); $installation = new Document([ @@ -435,15 +414,21 @@ App::get('/v1/vcs/github/callback') 'projectInternalId' => $projectInternalId, 'provider' => 'github', 'organization' => $owner, - 'personal' => $personalSlug === $owner + 'personal' => $personal, + 'personalRefreshToken' => $refreshToken, + 'personalAccessToken' => $accessToken, + 'personalAccessTokenExpiry' => $accessTokenExpiry, ]); - $installation = $dbForConsole->createDocument('installations', $installation); + $installation = $dbForPlatform->createDocument('installations', $installation); } else { $installation = $installation ->setAttribute('organization', $owner) - ->setAttribute('personal', $personalSlug === $owner); - $installation = $dbForConsole->updateDocument('installations', $installation->getId(), $installation); + ->setAttribute('personal', $personal) + ->setAttribute('personalRefreshToken', $refreshToken) + ->setAttribute('personalAccessToken', $accessToken) + ->setAttribute('personalAccessTokenExpiry', $accessTokenExpiry); + $installation = $dbForPlatform->updateDocument('installations', $installation->getId(), $installation); } } else { $error = 'Installation of the Appwrite GitHub App on organization accounts is restricted to organization owners. As a member of the organization, you do not have the necessary permissions to install this GitHub App. Please contact the organization owner to create the installation from the Appwrite console.'; @@ -469,22 +454,27 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get files and directories of a VCS repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepositoryContents') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_VCS_CONTENT_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepositoryContents', + description: '/docs/references/vcs/get-repository-contents.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_VCS_CONTENT_LIST, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true) ->inject('gitHub') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -530,22 +520,27 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr ->desc('Detect runtime settings from source code') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepositoryDetection') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_DETECTION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepositoryDetection', + description: '/docs/references/vcs/create-repository-detection.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DETECTION, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to Root Directory', true) ->inject('gitHub') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -602,25 +597,30 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('List repositories') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositories') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositories', + description: '/docs/references/vcs/list-repositories.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY_LIST, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('gitHub') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $search, GitHub $github, Response $response, Document $project, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $installationId, string $search, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { if (empty($search)) { $search = ""; } - $installation = $dbForConsole->getDocument('installations', $installationId); + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -697,13 +697,18 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') ->desc('Create repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'createRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'createRepository', + description: '/docs/references/vcs/create-repository.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('name', '', new Text(256), 'Repository name (slug)') ->param('private', '', new Boolean(false), 'Mark repository public or private') @@ -711,9 +716,9 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') ->inject('user') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $name, bool $private, GitHub $github, Document $user, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, string $name, bool $private, GitHub $github, Document $user, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -722,17 +727,23 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') if ($installation->getAttribute('personal', false) === true) { $oauth2 = new OAuth2Github(System::getEnv('_APP_VCS_GITHUB_CLIENT_ID', ''), System::getEnv('_APP_VCS_GITHUB_CLIENT_SECRET', ''), ""); - $identity = $dbForConsole->findOne('identities', [ - Query::equal('provider', ['github']), - Query::equal('userInternalId', [$user->getInternalId()]), - ]); - if ($identity === false || $identity->isEmpty()) { - throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); - } + $accessToken = $installation->getAttribute('personalAccessToken'); + $refreshToken = $installation->getAttribute('personalRefreshToken'); + $accessTokenExpiry = $installation->getAttribute('personalAccessTokenExpiry'); - $accessToken = $identity->getAttribute('providerAccessToken'); - $refreshToken = $identity->getAttribute('providerRefreshToken'); - $accessTokenExpiry = $identity->getAttribute('providerAccessTokenExpiry'); + if (empty($accessToken) || empty($refreshToken) || empty($accessTokenExpiry)) { + $identity = $dbForPlatform->findOne('identities', [ + Query::equal('provider', ['github']), + Query::equal('userInternalId', [$user->getInternalId()]), + ]); + if ($identity->isEmpty()) { + throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); + } + + $accessToken = $accessToken ?? $identity->getAttribute('providerAccessToken'); + $refreshToken = $refreshToken ?? $identity->getAttribute('providerRefreshToken'); + $accessTokenExpiry = $accessTokenExpiry ?? $identity->getAttribute('providerAccessTokenExpiry'); + } $isExpired = new \DateTime($accessTokenExpiry) < new \DateTime('now'); if ($isExpired) { @@ -747,12 +758,12 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') throw new Exception(Exception::GENERAL_RATE_LIMIT_EXCEEDED, "Another request is currently refreshing OAuth token. Please try again."); } - $identity = $identity - ->setAttribute('providerAccessToken', $accessToken) - ->setAttribute('providerRefreshToken', $refreshToken) - ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$oauth2->getAccessTokenExpiry(''))); + $installation = $installation + ->setAttribute('personalAccessToken', $accessToken) + ->setAttribute('personalRefreshToken', $refreshToken) + ->setAttribute('personalAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$oauth2->getAccessTokenExpiry(''))); - $dbForConsole->updateDocument('identities', $identity->getId(), $identity); + $dbForPlatform->updateDocument('installations', $installation->getId(), $installation); } try { @@ -798,21 +809,26 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('Get repository') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getRepository') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_PROVIDER_REPOSITORY) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getRepository', + description: '/docs/references/vcs/get-repository.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_PROVIDER_REPOSITORY, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $providerRepositoryId, GitHub $github, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, string $providerRepositoryId, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -847,21 +863,26 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->desc('List repository branches') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listRepositoryBranches') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_BRANCH_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listRepositoryBranches', + description: '/docs/references/vcs/list-repository-branches.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_BRANCH_LIST, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->inject('gitHub') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, string $providerRepositoryId, GitHub $github, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, string $providerRepositoryId, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -899,11 +920,11 @@ App::post('/v1/vcs/github/events') ->inject('gitHub') ->inject('request') ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForBuilds') ->action( - function (GitHub $github, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Build $queueForBuilds) use ($createGitDeployments) { + function (GitHub $github, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Build $queueForBuilds) use ($createGitDeployments) { $payload = $request->getRawPayload(); $signatureRemote = $request->getHeader('x-hub-signature-256', ''); $signatureLocal = System::getEnv('_APP_VCS_GITHUB_WEBHOOK_SECRET', ''); @@ -937,36 +958,36 @@ App::post('/v1/vcs/github/events') $github->initializeVariables($providerInstallationId, $privateKey, $githubAppId); //find functionId from functions table - $repositories = Authorization::skip(fn () => $dbForConsole->find('repositories', [ + $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::limit(100), ])); // create new deployment only on push and not when branch is created if (!$providerBranchCreated) { - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForConsole, $queueForBuilds, $getProjectDB, $request); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); } } elseif ($event == $github::EVENT_INSTALLATION) { if ($parsedPayload["action"] == "deleted") { // TODO: Use worker for this job instead (update function as well) $providerInstallationId = $parsedPayload["installationId"]; - $installations = $dbForConsole->find('installations', [ + $installations = $dbForPlatform->find('installations', [ Query::equal('providerInstallationId', [$providerInstallationId]), Query::limit(1000) ]); foreach ($installations as $installation) { - $repositories = Authorization::skip(fn () => $dbForConsole->find('repositories', [ + $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('installationInternalId', [$installation->getInternalId()]), Query::limit(1000) ])); foreach ($repositories as $repository) { - Authorization::skip(fn () => $dbForConsole->deleteDocument('repositories', $repository->getId())); + Authorization::skip(fn () => $dbForPlatform->deleteDocument('repositories', $repository->getId())); } - $dbForConsole->deleteDocument('installations', $installation->getId()); + $dbForPlatform->deleteDocument('installations', $installation->getId()); } } } elseif ($event == $github::EVENT_PULL_REQUEST) { @@ -995,12 +1016,12 @@ App::post('/v1/vcs/github/events') $providerCommitAuthor = $commitDetails["commitAuthor"] ?? ''; $providerCommitMessage = $commitDetails["commitMessage"] ?? ''; - $repositories = Authorization::skip(fn () => $dbForConsole->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, $dbForConsole, $queueForBuilds, $getProjectDB, $request); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, $external, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); } elseif ($parsedPayload["action"] == "closed") { // Allowed external contributions cleanup @@ -1009,7 +1030,7 @@ App::post('/v1/vcs/github/events') $external = $parsedPayload["external"] ?? true; if ($external) { - $repositories = Authorization::skip(fn () => $dbForConsole->find('repositories', [ + $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::orderDesc('$createdAt') ])); @@ -1020,7 +1041,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 () => $dbForConsole->updateDocument('repositories', $repository->getId(), $repository)); + $repository = Authorization::skip(fn () => $dbForPlatform->updateDocument('repositories', $repository->getId(), $repository)); } } } @@ -1035,20 +1056,25 @@ App::get('/v1/vcs/installations') ->desc('List installations') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'listInstallations') - ->label('sdk.description', '/docs/references/vcs/list-installations.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION_LIST) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'listInstallations', + description: '/docs/references/vcs/list-installations.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION_LIST, + ) + ] + )) ->param('queries', [], new Installations(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Installations::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') - ->action(function (array $queries, string $search, Response $response, Document $project, Database $dbForProject, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (array $queries, string $search, Response $response, Document $project, Database $dbForProject, Database $dbForPlatform) { try { $queries = Query::parseQueries($queries); } catch (QueryException $e) { @@ -1077,7 +1103,7 @@ App::get('/v1/vcs/installations') } $installationId = $cursor->getValue(); - $cursorDocument = $dbForConsole->getDocument('installations', $installationId); + $cursorDocument = $dbForPlatform->getDocument('installations', $installationId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Installation '{$installationId}' for the 'cursor' value not found."); @@ -1088,8 +1114,8 @@ App::get('/v1/vcs/installations') $filterQueries = Query::groupByType($queries)['filters']; - $results = $dbForConsole->find('installations', $queries); - $total = $dbForConsole->count('installations', $filterQueries, APP_LIMIT_COUNT); + $results = $dbForPlatform->find('installations', $queries); + $total = $dbForPlatform->count('installations', $filterQueries, APP_LIMIT_COUNT); $response->dynamic(new Document([ 'installations' => $results, @@ -1101,19 +1127,24 @@ App::get('/v1/vcs/installations/:installationId') ->desc('Get installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'getInstallation') - ->label('sdk.description', '/docs/references/vcs/get-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_INSTALLATION) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'getInstallation', + description: '/docs/references/vcs/get-installation.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_INSTALLATION, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') - ->inject('dbForConsole') - ->action(function (string $installationId, Response $response, Document $project, Database $dbForConsole) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->inject('dbForPlatform') + ->action(function (string $installationId, Response $response, Document $project, Database $dbForPlatform) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation === false || $installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); @@ -1130,25 +1161,32 @@ App::delete('/v1/vcs/installations/:installationId') ->desc('Delete installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'deleteInstallation') - ->label('sdk.description', '/docs/references/vcs/delete-installation.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'deleteInstallation', + description: '/docs/references/vcs/delete-installation.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('installationId', '', new Text(256), 'Installation Id') ->inject('response') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForDeletes') - ->action(function (string $installationId, Response $response, Document $project, Database $dbForConsole, Delete $queueForDeletes) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->action(function (string $installationId, Response $response, Document $project, Database $dbForPlatform, Delete $queueForDeletes) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); } - if (!$dbForConsole->deleteDocument('installations', $installation->getId())) { + if (!$dbForPlatform->deleteDocument('installations', $installation->getId())) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove installation from DB'); } @@ -1163,12 +1201,18 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor ->desc('Authorize external deployment') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') - ->label('sdk.namespace', 'vcs') - ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) - ->label('sdk.method', 'updateExternalDeployments') - ->label('sdk.description', '') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'vcs', + name: 'updateExternalDeployments', + description: '/docs/references/vcs/update-external-deployments.md', + auth: [AuthType::ADMIN], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ] + )) ->param('installationId', '', new Text(256), 'Installation Id') ->param('repositoryId', '', new Text(256), 'VCS Repository Id') ->param('providerPullRequestId', '', new Text(256), 'GitHub Pull Request Id') @@ -1176,17 +1220,17 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor ->inject('request') ->inject('response') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForBuilds') - ->action(function (string $installationId, string $repositoryId, string $providerPullRequestId, GitHub $github, Request $request, Response $response, Document $project, Database $dbForConsole, callable $getProjectDB, Build $queueForBuilds) use ($createGitDeployments) { - $installation = $dbForConsole->getDocument('installations', $installationId); + ->action(function (string $installationId, string $repositoryId, string $providerPullRequestId, GitHub $github, Request $request, Response $response, Document $project, Database $dbForPlatform, callable $getProjectDB, Build $queueForBuilds) use ($createGitDeployments) { + $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); } - $repository = Authorization::skip(fn () => $dbForConsole->getDocument('repositories', $repositoryId, [ + $repository = Authorization::skip(fn () => $dbForPlatform->getDocument('repositories', $repositoryId, [ Query::equal('projectInternalId', [$project->getInternalId()]) ])); @@ -1203,7 +1247,7 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor // TODO: Delete from array when PR is closed - $repository = Authorization::skip(fn () => $dbForConsole->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'); @@ -1227,7 +1271,7 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor $providerBranch = \explode(':', $pullRequestResponse['head']['label'])[1] ?? ''; $providerCommitHash = $pullRequestResponse['head']['sha'] ?? ''; - $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerCommitHash, $providerPullRequestId, true, $dbForConsole, $queueForBuilds, $getProjectDB, $request); + $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerCommitHash, $providerPullRequestId, true, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); $response->noContent(); }); diff --git a/app/controllers/general.php b/app/controllers/general.php index ee78fd0679..56a4eca812 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -11,6 +11,10 @@ use Appwrite\Event\Usage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; use Appwrite\Platform\Appwrite; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Request; use Appwrite\Utopia\Request\Filters\V16 as RequestV16; use Appwrite\Utopia\Request\Filters\V17 as RequestV17; @@ -48,20 +52,28 @@ Config::setParam('domainVerification', false); Config::setParam('cookieDomain', 'localhost'); Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE); -function router(App $utopia, Database $dbForConsole, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) +function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) { $utopia->getRoute()?->label('error', __DIR__ . '/../views/general/error.phtml'); $host = $request->getHostname() ?? ''; + if (!empty($previewHostname)) { + $host = $previewHostname; + } - $route = Authorization::skip( - fn () => $dbForConsole->find('rules', [ - Query::equal('domain', [$host]), - Query::limit(1) - ]) - )[0] ?? null; + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $route = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($host))); + } else { + $route = Authorization::skip( + fn () => $dbForPlatform->find('rules', [ + Query::equal('domain', [$host]), + Query::limit(1) + ]) + )[0] ?? new Document(); + } - if ($route === null) { + if ($route->isEmpty()) { if ($host === System::getEnv('_APP_DOMAIN_FUNCTIONS', '')) { throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain cannot be used for security reasons. Please use any subdomain instead.'); } @@ -71,7 +83,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo } if (System::getEnv('_APP_OPTIONS_ROUTER_PROTECTION', 'disabled') === 'enabled') { - if ($host !== 'localhost' && $host !== APP_HOSTNAME_INTERNAL) { // localhost allowed for proxy, APP_HOSTNAME_INTERNAL allowed for migrations + if ($host !== 'localhost' && $host !== APP_HOSTNAME_INTERNAL && $host !== System::getEnv('_APP_CONSOLE_DOMAIN', '')) { throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'Router protection does not allow accessing Appwrite over this domain. Please add it as custom domain to your project or disable _APP_OPTIONS_ROUTER_PROTECTION environment variable.'); } } @@ -83,8 +95,17 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $projectId = $route->getAttribute('projectId'); $project = Authorization::skip( - fn () => $dbForConsole->getDocument('projects', $projectId) + fn () => $dbForPlatform->getDocument('projects', $projectId) ); + + if (!$project->isEmpty() && $project->getId() !== 'console') { + $accessedAt = $project->getAttribute('accessedAt', ''); + 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)); + } + } + if (array_key_exists('proxy', $project->getAttribute('services', []))) { $status = $project->getAttribute('services', [])['proxy']; if (!$status) { @@ -101,8 +122,29 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $type = $route->getAttribute('resourceType'); if ($type === 'function') { - $utopia->getRoute()?->label('sdk.namespace', 'functions'); - $utopia->getRoute()?->label('sdk.method', 'createExecution'); + $method = $utopia->getRoute()?->getLabel('sdk', null); + + if (empty($method)) { + $utopia->getRoute()?->label('sdk', new Method( + namespace: 'functions', + name: 'createExecution', + description: '/docs/references/functions/create-execution.md', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_CREATED, + model: Response::MODEL_EXECUTION, + ) + ], + contentType: ContentType::MULTIPART, + requestType: 'application/json', + )); + } else { + /** @var Method $method */ + $method->setNamespace('functions'); + $method->setMethodName('createExecution'); + $utopia->getRoute()?->label('sdk', $method); + } if (System::getEnv('_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS', 'disabled') === 'enabled') { // Force HTTPS if ($request->getProtocol() !== 'https') { @@ -129,7 +171,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo $requestHeaders = $request->getHeaders(); - $project = Authorization::skip(fn () => $dbForConsole->getDocument('projects', $projectId)); + $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); $dbForProject = $getProjectDB($project); @@ -139,6 +181,10 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo throw new AppwriteException(AppwriteException::FUNCTION_NOT_FOUND); } + if ($isResourceBlocked($project, RESOURCE_TYPE_FUNCTIONS, $functionId)) { + throw new AppwriteException(AppwriteException::GENERAL_RESOURCE_BLOCKED); + } + $version = $function->getAttribute('version', 'v2'); $runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []); $spec = Config::getParam('runtime-specifications')[$function->getAttribute('specification', APP_FUNCTION_SPECIFICATION_DEFAULT)]; @@ -350,26 +396,6 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo throw $th; } } finally { - $fileSize = 0; - $file = $request->getFiles('file'); - if (!empty($file)) { - $fileSize = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size']; - } - - $queueForUsage - ->addMetric(METRIC_NETWORK_REQUESTS, 1) - ->addMetric(METRIC_NETWORK_INBOUND, $request->getSize() + $fileSize) - ->addMetric(METRIC_NETWORK_OUTBOUND, $response->getSize()) - ->addMetric(METRIC_EXECUTIONS, 1) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS), 1) - ->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000)) // per project - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) // per function - ->addMetric(METRIC_EXECUTIONS_MB_SECONDS, (int)(($spec['memory'] ?? APP_FUNCTION_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_FUNCTION_CPUS_DEFAULT))) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_FUNCTION_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_FUNCTION_CPUS_DEFAULT))) - ->setProject($project) - ->trigger() - ; - $queueForFunctions ->setType(Func::TYPE_ASYNC_WRITE) ->setExecution($execution) @@ -404,6 +430,26 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo ->setStatusCode($execution['responseStatusCode'] ?? 200) ->send($body); + $fileSize = 0; + $file = $request->getFiles('file'); + if (!empty($file)) { + $fileSize = (\is_array($file['size']) && isset($file['size'][0])) ? $file['size'][0] : $file['size']; + } + + $queueForUsage + ->addMetric(METRIC_NETWORK_REQUESTS, 1) + ->addMetric(METRIC_NETWORK_INBOUND, $request->getSize() + $fileSize) + ->addMetric(METRIC_NETWORK_OUTBOUND, $response->getSize()) + ->addMetric(METRIC_EXECUTIONS, 1) + ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS), 1) + ->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000)) // per project + ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) // per function + ->addMetric(METRIC_EXECUTIONS_MB_SECONDS, (int)(($spec['memory'] ?? APP_FUNCTION_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_FUNCTION_CPUS_DEFAULT))) + ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_FUNCTION_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_FUNCTION_CPUS_DEFAULT))) + ->setProject($project) + ->trigger() + ; + return true; } elseif ($type === 'api') { $utopia->getRoute()?->label('error', ''); @@ -449,7 +495,7 @@ App::init() ->inject('response') ->inject('console') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('locale') ->inject('localeCodes') @@ -459,15 +505,17 @@ App::init() ->inject('queueForEvents') ->inject('queueForCertificates') ->inject('queueForFunctions') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForConsole, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, Usage $queueForUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions) { + ->inject('isResourceBlocked') + ->inject('previewHostname') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, Usage $queueForUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked, string $previewHostname) { /* * Appwrite Router */ $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain - if ($host !== $mainDomain) { - if (router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb)) { + if ($host !== $mainDomain || !empty($previewHostname)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname)) { return; } } @@ -515,19 +563,31 @@ App::init() if (!empty($envDomain) && $envDomain !== 'localhost') { $mainDomain = $envDomain; } else { - $domainDocument = $dbForConsole->findOne('rules', [Query::orderAsc('$id')]); - $mainDomain = $domainDocument ? $domainDocument->getAttribute('domain') : $domain->get(); + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $domainDocument = $dbForPlatform->getDocument('rules', md5($envDomain)); + } else { + $domainDocument = $dbForPlatform->findOne('rules', [Query::orderAsc('$id')]); + } + $mainDomain = !$domainDocument->isEmpty() ? $domainDocument->getAttribute('domain') : $domain->get(); } if ($mainDomain !== $domain->get()) { Console::warning($domain->get() . ' is not a main domain. Skipping SSL certificate generation.'); } else { - $domainDocument = $dbForConsole->findOne('rules', [ - Query::equal('domain', [$domain->get()]) - ]); + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $domainDocument = $dbForPlatform->getDocument('rules', md5($domain->get())); + } else { + $domainDocument = $dbForPlatform->findOne('rules', [ + Query::equal('domain', [$domain->get()]) + ]); + } - if (!$domainDocument) { + if ($domainDocument->isEmpty()) { $domainDocument = new Document([ + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + '$id' => System::getEnv('_APP_RULES_FORMAT') === 'md5' ? md5($domain->get()) : ID::unique(), 'domain' => $domain->get(), 'resourceType' => 'api', 'status' => 'verifying', @@ -535,7 +595,7 @@ App::init() 'projectInternalId' => 'console' ]); - $domainDocument = $dbForConsole->createDocument('rules', $domainDocument); + $domainDocument = $dbForPlatform->createDocument('rules', $domainDocument); Console::info('Issuing a TLS certificate for the main domain (' . $domain->get() . ') in a few seconds...'); @@ -671,21 +731,23 @@ App::options() ->inject('swooleRequest') ->inject('request') ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('queueForFunctions') ->inject('geodb') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { + ->inject('isResourceBlocked') + ->inject('previewHostname') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) { /* * Appwrite Router */ $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain - if ($host !== $mainDomain) { - if (router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb)) { + if ($host !== $mainDomain || !empty($previewHostname)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname)) { return; } } @@ -771,6 +833,12 @@ App::error() case 'Utopia\Database\Exception\Relationship': $error = new AppwriteException(AppwriteException::RELATIONSHIP_VALUE_INVALID, $error->getMessage(), previous: $error); break; + case 'Utopia\Database\Exception\NotFound': + $error = new AppwriteException(AppwriteException::COLLECTION_NOT_FOUND, $error->getMessage(), previous: $error); + break; + case 'Utopia\Database\Exception\Dependency': + $error = new AppwriteException(AppwriteException::INDEX_DEPENDENCY, null, previous: $error); + break; } $code = $error->getCode(); @@ -798,7 +866,7 @@ App::error() $adapter = new Sentry($projectId, $key, $host); $logger = new Logger($adapter); - $logger->setSample(0.04); + $logger->setSample(0.01); $publish = true; } else { throw new \Exception('Invalid experimental logging provider'); @@ -838,6 +906,8 @@ App::error() if (isset($user) && !$user->isEmpty()) { $log->setUser(new User($user->getId())); + } else { + $log->setUser(new User('guest-' . hash('sha256', $request->getIP()))); } try { @@ -848,14 +918,14 @@ App::error() } $log->setNamespace("http"); - $log->setServer(\gethostname()); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); $log->setVersion($version); $log->setType(Log::TYPE_ERROR); $log->setMessage($error->getMessage()); $log->addTag('database', $dsn->getHost()); $log->addTag('method', $route->getMethod()); - $log->addTag('url', $route->getPath()); + $log->addTag('url', $request->getURI()); $log->addTag('verboseType', get_class($error)); $log->addTag('code', $error->getCode()); $log->addTag('projectId', $project->getId()); @@ -867,8 +937,14 @@ App::error() $log->addExtra('trace', $error->getTraceAsString()); $log->addExtra('roles', Authorization::getRoles()); - $action = $route->getLabel("sdk.namespace", "UNKNOWN_NAMESPACE") . '.' . $route->getLabel("sdk.method", "UNKNOWN_METHOD"); + $action = 'UNKNOWN_NAMESPACE.UNKNOWN.METHOD'; + if (!empty($sdk)) { + /** @var Appwrite\SDK\Method $sdk */ + $action = $sdk->getNamespace() . '.' . $sdk->getMethodName(); + } + $log->setAction($action); + $log->addTag('service', $action); $isProduction = System::getEnv('_APP_ENV', 'development') === 'production'; $log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING); @@ -963,21 +1039,23 @@ App::get('/robots.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('queueForFunctions') ->inject('geodb') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { + ->inject('isResourceBlocked') + ->inject('previewHostname') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) { $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if ($host === $mainDomain || $host === 'localhost') { + if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/robots.phtml'); $response->text($template->render(false)); } else { - router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb); + router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname); } }); @@ -989,21 +1067,23 @@ App::get('/humans.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('queueForFunctions') ->inject('geodb') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForConsole, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { + ->inject('isResourceBlocked') + ->inject('previewHostname') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname) { $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); - if ($host === $mainDomain || $host === 'localhost') { + if (($host === $mainDomain || $host === 'localhost') && empty($previewHostname)) { $template = new View(__DIR__ . '/../views/general/humans.phtml'); $response->text($template->render(false)); } else { - router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb); + router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked, $previewHostname); } }); @@ -1067,9 +1147,9 @@ App::get('/v1/ping') ->label('event', 'projects.[projectId].ping') ->inject('response') ->inject('project') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForEvents') - ->action(function (Response $response, Document $project, Database $dbForConsole, Event $queueForEvents) { + ->action(function (Response $response, Document $project, Database $dbForPlatform, Event $queueForEvents) { if ($project->isEmpty()) { throw new AppwriteException(AppwriteException::PROJECT_NOT_FOUND); } @@ -1081,8 +1161,8 @@ App::get('/v1/ping') ->setAttribute('pingCount', $pingCount) ->setAttribute('pingedAt', $pingedAt); - Authorization::skip(function () use ($dbForConsole, $project) { - $dbForConsole->updateDocument('projects', $project->getId(), $project); + Authorization::skip(function () use ($dbForPlatform, $project) { + $dbForPlatform->updateDocument('projects', $project->getId(), $project); }); $queueForEvents @@ -1103,5 +1183,10 @@ foreach (Config::getParam('services', []) as $service) { include_once $service['controller']; } +// Check for any errors found while we were initialising the SDK Methods. +if (!empty(Method::getErrors())) { + throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); +} + $platform = new Appwrite(); $platform->init(Service::TYPE_HTTP); diff --git a/app/controllers/mock.php b/app/controllers/mock.php index bc071fc885..16d8e03841 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -24,7 +24,7 @@ App::get('/v1/mock/tests/general/oauth2') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('redirect_uri', '', new Host(['localhost']), 'OAuth2 Redirect URI.') // Important to deny an open redirect attack ->param('scope', '', new Text(100), 'OAuth2 scope list.') @@ -40,7 +40,7 @@ App::get('/v1/mock/tests/general/oauth2/token') ->groups(['mock']) ->label('scope', 'public') ->label('docs', false) - ->label('sdk.mock', true) + ->label('mock', true) ->param('client_id', '', new Text(100), 'OAuth2 Client ID.') ->param('client_secret', '', new Text(100), 'OAuth2 scope list.') ->param('grant_type', 'authorization_code', new WhiteList(['refresh_token', 'authorization_code']), 'OAuth2 Grant Type.', true) @@ -162,15 +162,15 @@ App::post('/v1/mock/api-key-unprefixed') ->label('docs', false) ->param('projectId', '', new UID(), 'Project ID.') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $projectId, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $projectId, Response $response, Database $dbForPlatform) { $isDevelopment = System::getEnv('_APP_ENV', 'development') === 'development'; if (!$isDevelopment) { throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); } - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { throw new Exception(Exception::PROJECT_NOT_FOUND); @@ -195,9 +195,9 @@ App::post('/v1/mock/api-key-unprefixed') 'secret' => \bin2hex(\random_bytes(128)), ]); - $key = $dbForConsole->createDocument('keys', $key); + $key = $dbForPlatform->createDocument('keys', $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $response ->setStatusCode(Response::STATUS_CODE_CREATED) @@ -214,15 +214,15 @@ App::get('/v1/mock/github/callback') ->inject('gitHub') ->inject('project') ->inject('response') - ->inject('dbForConsole') - ->action(function (string $providerInstallationId, string $projectId, GitHub $github, Document $project, Response $response, Database $dbForConsole) { + ->inject('dbForPlatform') + ->action(function (string $providerInstallationId, string $projectId, GitHub $github, Document $project, Response $response, Database $dbForPlatform) { $isDevelopment = System::getEnv('_APP_ENV', 'development') === 'development'; if (!$isDevelopment) { throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); } - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { $error = 'Project with the ID from state could not be found.'; @@ -256,7 +256,7 @@ App::get('/v1/mock/github/callback') 'personal' => false ]); - $installation = $dbForConsole->createDocument('installations', $installation); + $installation = $dbForPlatform->createDocument('installations', $installation); } $response->json([ diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 342140a96a..b565e6be67 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -11,14 +11,14 @@ use Appwrite\Event\Delete; use Appwrite\Event\Event; use Appwrite\Event\Func; use Appwrite\Event\Messaging; +use Appwrite\Event\Realtime; use Appwrite\Event\Usage; +use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\Extend\Exception as AppwriteException; -use Appwrite\Messaging\Adapter\Realtime; use Appwrite\Utopia\Request; use Appwrite\Utopia\Response; use Utopia\Abuse\Abuse; -use Utopia\Abuse\Adapters\Database\TimeLimit; use Utopia\App; use Utopia\Cache\Adapter\Filesystem; use Utopia\Cache\Cache; @@ -28,6 +28,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\Role; use Utopia\Database\Validator\Authorization; +use Utopia\Queue\Connection; use Utopia\System\System; use Utopia\Validator\WhiteList; @@ -57,8 +58,39 @@ $parseLabel = function (string $label, array $responsePayload, array $requestPar return $label; }; -$databaseListener = function (string $event, Document $document, Document $project, Usage $queueForUsage, Database $dbForProject) { +$eventDatabaseListener = function (Document $project, Document $document, Response $response, Event $queueForEvents, Func $queueForFunctions, Webhook $queueForWebhooks, Realtime $queueForRealtime) { + // Only trigger events for user creation with the database listener. + if ($document->getCollection() !== 'users') { + return; + } + $queueForEvents + ->setEvent('users.[userId].create') + ->setParam('userId', $document->getId()) + ->setPayload($response->output($document, Response::MODEL_USER)); + + // Trigger functions, webhooks, and realtime events + $queueForFunctions + ->from($queueForEvents) + ->trigger(); + + + /** Trigger webhooks events only if a project has them enabled */ + if (!empty($project->getAttribute('webhooks'))) { + $queueForWebhooks + ->from($queueForEvents) + ->trigger(); + } + + /** Trigger realtime events only for non console events */ + if ($queueForEvents->getProject()->getId() !== 'console') { + $queueForRealtime + ->from($queueForEvents) + ->trigger(); + } +}; + +$usageDatabaseListener = function (string $event, Document $document, Usage $queueForUsage) { $value = 1; if ($event === Database::EVENT_DOCUMENT_DELETE) { $value = -1; @@ -154,14 +186,16 @@ App::init() ->groups(['api']) ->inject('utopia') ->inject('request') - ->inject('dbForConsole') + ->inject('dbForPlatform') + ->inject('dbForProject') + ->inject('queueForAudits') ->inject('project') ->inject('user') ->inject('session') ->inject('servers') ->inject('mode') ->inject('team') - ->action(function (App $utopia, Request $request, Database $dbForConsole, Document $project, Document $user, ?Document $session, array $servers, string $mode, Document $team) { + ->action(function (App $utopia, Request $request, Database $dbForPlatform, Database $dbForProject, Audit $queueForAudits, Document $project, Document $user, ?Document $session, array $servers, string $mode, Document $team) { $route = $utopia->getRoute(); if ($project->isEmpty()) { @@ -197,7 +231,7 @@ App::init() if ($keyType === API_KEY_DYNAMIC) { // Dynamic key - $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 3600, 0); + $jwtObj = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400, 0); try { $payload = $jwtObj->decode($authKey); @@ -213,9 +247,10 @@ App::init() $user = new Document([ '$id' => '', 'status' => true, + 'type' => Auth::ACTIVITY_TYPE_APP, 'email' => 'app.' . $project->getId() . '@service.' . $request->getHostname(), 'password' => '', - 'name' => $project->getAttribute('name', 'Untitled'), + 'name' => 'Dynamic Key', ]); $role = Auth::USER_ROLE_APPS; @@ -223,6 +258,8 @@ App::init() Authorization::setRole(Auth::USER_ROLE_APPS); Authorization::setDefaultStatus(false); // Cancel security segmentation for API keys. + + $queueForAudits->setUser($user); } } elseif ($keyType === API_KEY_STANDARD) { // No underline means no prefix. Backwards compatibility. @@ -234,9 +271,10 @@ App::init() $user = new Document([ '$id' => '', 'status' => true, + 'type' => Auth::ACTIVITY_TYPE_APP, 'email' => 'app.' . $project->getId() . '@service.' . $request->getHostname(), 'password' => '', - 'name' => $project->getAttribute('name', 'Untitled'), + 'name' => $key->getAttribute('name', 'UNKNOWN'), ]); $role = Auth::USER_ROLE_APPS; @@ -253,8 +291,8 @@ App::init() $accessedAt = $key->getAttribute('accessedAt', ''); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { $key->setAttribute('accessedAt', DateTime::now()); - $dbForConsole->updateDocument('keys', $key->getId(), $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('keys', $key->getId(), $key); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } $sdkValidator = new WhiteList($servers, true); @@ -267,10 +305,12 @@ App::init() /** Update access time as well */ $key->setAttribute('accessedAt', Datetime::now()); - $dbForConsole->updateDocument('keys', $key->getId(), $key); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('keys', $key->getId(), $key); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } } + + $queueForAudits->setUser($user); } } } @@ -305,12 +345,48 @@ App::init() Authorization::setRole($authRole); } + /** + * Update project last activity + */ + if (!$project->isEmpty() && $project->getId() !== 'console') { + $accessedAt = $project->getAttribute('accessedAt', ''); + 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)); + } + } + + /** + * Update user last activity + */ + if (!empty($user->getId())) { + $accessedAt = $user->getAttribute('accessedAt', ''); + if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_USER_ACCESS)) > $accessedAt) { + $user->setAttribute('accessedAt', DateTime::now()); + + if (APP_MODE_ADMIN !== $mode) { + $dbForProject->updateDocument('users', $user->getId(), $user); + } else { + $dbForPlatform->updateDocument('users', $user->getId(), $user); + } + } + } + /** Do not allow access to disabled services */ - $service = $route->getLabel('sdk.namespace', ''); - if (!empty($service)) { + /** + * @var ?\Appwrite\SDK\Method $method + */ + $method = $route->getLabel('sdk', false); + + if (is_array($method)) { + $method = $method[0]; + } + + if (!empty($method)) { + $namespace = $method->getNamespace(); if ( - array_key_exists($service, $project->getAttribute('services', [])) - && !$project->getAttribute('services', [])[$service] + array_key_exists($namespace, $project->getAttribute('services', [])) + && !$project->getAttribute('services', [])[$namespace] && !(Auth::isPrivilegedUser(Authorization::getRoles()) || Auth::isAppUser(Authorization::getRoles())) ) { throw new Exception(Exception::GENERAL_SERVICE_DISABLED); @@ -353,6 +429,7 @@ App::init() ->inject('response') ->inject('project') ->inject('user') + ->inject('queue') ->inject('queueForEvents') ->inject('queueForMessaging') ->inject('queueForAudits') @@ -361,9 +438,10 @@ App::init() ->inject('queueForBuilds') ->inject('queueForUsage') ->inject('dbForProject') + ->inject('timelimit') ->inject('resourceToken') ->inject('mode') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, Document $resourceToken, string $mode) use ($databaseListener) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Connection $queue, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, callable $timelimit, Document $resourceToken, string $mode) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); @@ -386,7 +464,7 @@ App::init() foreach ($abuseKeyLabel as $abuseKey) { $start = $request->getContentRangeStart(); $end = $request->getContentRangeEnd(); - $timeLimit = new TimeLimit($abuseKey, $route->getLabel('abuse-limit', 0), $route->getLabel('abuse-time', 3600), $dbForProject); + $timeLimit = $timelimit($abuseKey, $route->getLabel('abuse-limit', 0), $route->getLabel('abuse-time', 3600)); $timeLimit ->setParam('{projectId}', $project->getId()) ->setParam('{userId}', $user->getId()) @@ -414,7 +492,7 @@ App::init() $abuse = new Abuse($timeLimit); $remaining = $timeLimit->remaining(); $limit = $timeLimit->limit(); - $time = (new \DateTime($timeLimit->time()))->getTimestamp() + $route->getLabel('abuse-time', 3600); + $time = $timeLimit->time() + $route->getLabel('abuse-time', 3600); if ($limit && ($remaining < $closestLimit || is_null($closestLimit))) { $closestLimit = $remaining; @@ -448,18 +526,42 @@ App::init() ->setMode($mode) ->setUserAgent($request->getUserAgent('')) ->setIP($request->getIP()) + ->setHostname($request->getHostname()) ->setEvent($route->getLabel('audits.event', '')) - ->setProject($project) - ->setUser($user); + ->setProject($project); + + /* If a session exists, use the user associated with the session */ + if (!$user->isEmpty()) { + $userClone = clone $user; + // $user doesn't support `type` and can cause unintended effects. + $userClone->setAttribute('type', Auth::ACTIVITY_TYPE_USER); + $queueForAudits->setUser($userClone); + } $queueForDeletes->setProject($project); $queueForDatabase->setProject($project); $queueForBuilds->setProject($project); $queueForMessaging->setProject($project); + // Clone the queues, to prevent events triggered by the database listener + // from overwriting the events that are supposed to be triggered in the shutdown hook. + $queueForEventsClone = new Event($queue); + $queueForFunctions = new Func($queue); + $queueForWebhooks = new Webhook($queue); + $queueForRealtime = new Realtime(); + $dbForProject - ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $databaseListener($event, $document, $project, $queueForUsage, $dbForProject)) - ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $databaseListener($event, $document, $project, $queueForUsage, $dbForProject)); + ->on(Database::EVENT_DOCUMENT_CREATE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENT_DELETE, 'calculate-usage', fn ($event, $document) => $usageDatabaseListener($event, $document, $queueForUsage)) + ->on(Database::EVENT_DOCUMENT_CREATE, 'create-trigger-events', fn ($event, $document) => $eventDatabaseListener( + $project, + $document, + $response, + $queueForEventsClone->from($queueForEvents), + $queueForFunctions->from($queueForEvents), + $queueForWebhooks->from($queueForEvents), + $queueForRealtime->from($queueForEvents) + )); $useCache = $route->getLabel('cache', false); if ($useCache) { @@ -510,10 +612,16 @@ App::init() if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } + + $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)); + } } $response - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + $timestamp) . ' GMT') + ->addHeader('Cache-Control', sprintf('private, max-age=%d', $timestamp)) ->addHeader('X-Appwrite-Cache', 'hit') ->setContentType($cacheLog->getAttribute('mimeType')) ->send($data); @@ -521,7 +629,7 @@ App::init() $response ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') ->addHeader('Pragma', 'no-cache') - ->addHeader('Expires', 0) + ->addHeader('Expires', '0') ->addHeader('X-Appwrite-Cache', 'miss') ; } @@ -596,11 +704,11 @@ App::shutdown() ->inject('queueForDatabase') ->inject('queueForBuilds') ->inject('queueForMessaging') - ->inject('dbForProject') ->inject('queueForFunctions') - ->inject('mode') - ->inject('dbForConsole') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Audit $queueForAudits, Usage $queueForUsage, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Messaging $queueForMessaging, Database $dbForProject, Func $queueForFunctions, string $mode, Database $dbForConsole) use ($parseLabel) { + ->inject('queueForWebhooks') + ->inject('queueForRealtime') + ->inject('dbForProject') + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Event $queueForEvents, Audit $queueForAudits, Usage $queueForUsage, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Messaging $queueForMessaging, Func $queueForFunctions, Event $queueForWebhooks, Realtime $queueForRealtime, Database $dbForProject) use ($parseLabel) { $responsePayload = $response->getPayload(); @@ -609,54 +717,25 @@ App::shutdown() $queueForEvents->setPayload($responsePayload); } - /** - * Trigger functions. - */ - if (!$queueForEvents->isPaused()) { - $queueForFunctions + $queueForFunctions + ->from($queueForEvents) + ->trigger(); + + if ($project->getId() !== 'console') { + $queueForRealtime ->from($queueForEvents) ->trigger(); } - /** - * Trigger webhooks. - */ - $queueForEvents - ->setClass(Event::WEBHOOK_CLASS_NAME) - ->setQueue(Event::WEBHOOK_QUEUE_NAME) - ->trigger(); - /** - * Trigger realtime. - */ - if ($project->getId() !== 'console') { - $allEvents = Event::generateEvents($queueForEvents->getEvent(), $queueForEvents->getParams()); - $payload = new Document($queueForEvents->getPayload()); - - $db = $queueForEvents->getContext('database'); - $collection = $queueForEvents->getContext('collection'); - $bucket = $queueForEvents->getContext('bucket'); - - $target = Realtime::fromPayload( - // Pass first, most verbose event pattern - event: $allEvents[0], - payload: $payload, - project: $project, - database: $db, - collection: $collection, - bucket: $bucket, - ); - - Realtime::send( - projectId: $target['projectId'] ?? $project->getId(), - payload: $queueForEvents->getRealtimePayload(), - events: $allEvents, - channels: $target['channels'], - roles: $target['roles'], - options: [ - 'permissionsChanged' => $target['permissionsChanged'], - 'userId' => $queueForEvents->getParam('userId') - ] - ); + /** Trigger webhooks events only if a project has them enabled + * A future optimisation is to only trigger webhooks if the webhook is "enabled" + * But it might have performance implications on the API due to the number of webhooks etc. + * Some profiling is needed to see if this is a problem. + */ + if (!empty($project->getAttribute('webhooks'))) { + $queueForWebhooks + ->from($queueForEvents) + ->trigger(); } } @@ -675,10 +754,32 @@ App::shutdown() } if (!$user->isEmpty()) { + $userClone = clone $user; + // $user doesn't support `type` and can cause unintended effects. + $userClone->setAttribute('type', Auth::ACTIVITY_TYPE_USER); + $queueForAudits->setUser($userClone); + } elseif ($queueForAudits->getUser() === null || $queueForAudits->getUser()->isEmpty()) { + /** + * User in the request is empty, and no user was set for auditing previously. + * This indicates: + * - No API Key was used. + * - No active session exists. + * + * Therefore, we consider this an anonymous request and create a relevant user. + */ + $user = new Document([ + '$id' => '', + 'status' => true, + 'type' => Auth::ACTIVITY_TYPE_GUEST, + 'email' => 'guest.' . $project->getId() . '@service.' . $request->getHostname(), + 'password' => '', + 'name' => 'Guest', + ]); + $queueForAudits->setUser($user); } - if (!empty($queueForAudits->getResource()) && !empty($queueForAudits->getUser()->getId())) { + if (!empty($queueForAudits->getResource()) && !$queueForAudits->getUser()->isEmpty()) { /** * audits.payload is switched to default true * in order to auto audit payload for all endpoints @@ -756,8 +857,6 @@ App::shutdown() } } - - if ($project->getId() !== 'console') { if (!Auth::isPrivilegedUser(Authorization::getRoles())) { $fileSize = 0; @@ -776,33 +875,6 @@ App::shutdown() ->setProject($project) ->trigger(); } - - /** - * Update project last activity - */ - if (!$project->isEmpty() && $project->getId() !== 'console') { - $accessedAt = $project->getAttribute('accessedAt', ''); - if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $accessedAt) { - $project->setAttribute('accessedAt', DateTime::now()); - Authorization::skip(fn () => $dbForConsole->updateDocument('projects', $project->getId(), $project)); - } - } - - /** - * Update user last activity - */ - if (!$user->isEmpty()) { - $accessedAt = $user->getAttribute('accessedAt', ''); - if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_USER_ACCESS)) > $accessedAt) { - $user->setAttribute('accessedAt', DateTime::now()); - - if (APP_MODE_ADMIN !== $mode) { - $dbForProject->updateDocument('users', $user->getId(), $user); - } else { - $dbForConsole->updateDocument('users', $user->getId(), $user); - } - } - } }); App::init() diff --git a/app/controllers/shared/api/auth.php b/app/controllers/shared/api/auth.php index 53aacabe21..ecabc641ec 100644 --- a/app/controllers/shared/api/auth.php +++ b/app/controllers/shared/api/auth.php @@ -5,6 +5,7 @@ use Appwrite\Extend\Exception; use Appwrite\Utopia\Request; use MaxMind\Db\Reader; use Utopia\App; +use Utopia\Config\Config; use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; @@ -57,44 +58,44 @@ App::init() $auths = $project->getAttribute('auths', []); switch ($route->getLabel('auth.type', '')) { - case 'emailPassword': - if (($auths['emailPassword'] ?? true) === false) { + case 'email-password': + if (($auths[Config::getParam('auth')['email-password']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Email / Password authentication is disabled for this project'); } break; case 'magic-url': - if (($auths['usersAuthMagicURL'] ?? true) === false) { + if (($auths[Config::getParam('auth')['magic-url']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Magic URL authentication is disabled for this project'); } break; case 'anonymous': - if (($auths['anonymous'] ?? true) === false) { + if (($auths[Config::getParam('auth')['anonymous']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Anonymous authentication is disabled for this project'); } break; case 'phone': - if (($auths['phone'] ?? true) === false) { + if (($auths[Config::getParam('auth')['phone']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Phone authentication is disabled for this project'); } break; case 'invites': - if (($auths['invites'] ?? true) === false) { + if (($auths[Config::getParam('auth')['invites']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Invites authentication is disabled for this project'); } break; case 'jwt': - if (($auths['JWT'] ?? true) === false) { + if (($auths[Config::getParam('auth')['jwt']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'JWT authentication is disabled for this project'); } break; case 'email-otp': - if (($auths['emailOTP'] ?? true) === false) { + if (($auths[Config::getParam('auth')['email-otp']['key']] ?? true) === false) { throw new Exception(Exception::USER_AUTH_METHOD_UNSUPPORTED, 'Email OTP authentication is disabled for this project'); } break; diff --git a/app/http.php b/app/http.php index bec772c770..608ac2ec12 100644 --- a/app/http.php +++ b/app/http.php @@ -9,16 +9,19 @@ use Swoole\Http\Request as SwooleRequest; use Swoole\Http\Response as SwooleResponse; use Swoole\Http\Server; use Swoole\Process; -use Utopia\Abuse\Adapters\Database\TimeLimit; +use Swoole\Table; use Utopia\App; use Utopia\Audit\Audit; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; +use Utopia\Database\DateTime; use Utopia\Database\Document; +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\Logger\Log; use Utopia\Logger\Log\User; @@ -26,6 +29,12 @@ use Utopia\Pools\Group; use Utopia\Swoole\Files; use Utopia\System\System; +const DOMAIN_SYNC_TIMER = 30; // 30 seconds + +$domains = new Table(1_000_000); // 1 million rows +$domains->column('value', Table::TYPE_INT, 1); +$domains->create(); + $http = new Server( host: "0.0.0.0", port: System::getEnv('PORT', 80), @@ -33,16 +42,17 @@ $http = new Server( ); $payloadSize = 12 * (1024 * 1024); // 12MB - adding slight buffer for headers and other data that might be sent with the payload - update later with valid testing -$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); +$totalWorkers = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $http ->set([ - 'worker_num' => $workerNumber, + 'worker_num' => $totalWorkers, + 'dispatch_func' => 'dispatch', 'open_http2_protocol' => true, - 'http_compression' => true, - 'http_compression_level' => 6, + 'http_compression' => false, 'package_max_length' => $payloadSize, 'buffer_output_size' => $payloadSize, + 'task_worker_num' => 1, // required for the task to fetch domains background ]); $http->on(Constant::EVENT_WORKER_START, function ($server, $workerId) { @@ -57,6 +67,93 @@ $http->on(Constant::EVENT_AFTER_RELOAD, function ($server, $workerId) { Console::success('Reload completed...'); }); +/** + * Assigns HTTP requests to worker threads by analyzing its payload/content. + * + * Routes requests as 'safe' or 'risky' based on specific content patterns (like POST actions or certain domains) + * to optimize load distribution between the workers. Utilizes `$safeThreadsPercent` to manage risk by assigning + * riskier tasks to a dedicated worker subset. Prefers idle workers, with fallback to random selection if necessary. + * doc: https://openswoole.com/docs/modules/swoole-server/configuration#dispatch_func + * + * @param Server $server Swoole server instance. + * @param int $fd client ID + * @param int $type the type of data and its current state + * @param string|null $data Request content for categorization. + * @global int $totalThreads Total number of workers. + * @return int Chosen worker ID for the request. + */ +function dispatch(Server $server, int $fd, int $type, $data = null): int +{ + global $totalWorkers, $domains; + + // If data is not set we can send request to any worker + // first we try to pick idle worker, if not we randomly pick a worker + if ($data === null) { + for ($i = 0; $i < $totalWorkers; $i++) { + if ($server->getWorkerStatus($i) === SWOOLE_WORKER_IDLE) { + return $i; + } + } + return rand(0, $totalWorkers - 1); + } + + $riskyWorkersPercent = intval(System::getEnv('_APP_RISKY_WORKERS_PERCENT', 80)) / 100; // Decimal form 0 to 1 + + // Each worker has numeric ID, starting from 0 and incrementing + // From 0 to riskyWorkers, we consider safe workers + // From riskyWorkers to totalWorkers, we consider risky workers + $riskyWorkers = (int) floor($totalWorkers * $riskyWorkersPercent); // Absolute amount of risky workers + + $domain = ''; + // max up to 3 as first line has request details and second line has host + $lines = explode("\n", $data, 3); + $request = $lines[0]; + if (count($lines) > 1) { + $domain = trim(explode('Host: ', $lines[1])[1]); + } + + // Sync executions are considered risky + $risky = false; + if (str_starts_with($request, 'POST') && str_contains($request, '/executions')) { + $risky = true; + } elseif (str_ends_with($domain, System::getEnv('_APP_DOMAIN_FUNCTIONS'))) { + $risky = true; + } elseif ($domains->get(md5($domain), 'value') === 1) { + // executions request coming from custom domain + $risky = true; + } + + if ($risky) { + // If risky request, only consider risky workers + for ($j = $riskyWorkers; $j < $totalWorkers; $j++) { + /** Reference https://openswoole.com/docs/modules/swoole-server-getWorkerStatus#description */ + if ($server->getWorkerStatus($j) === SWOOLE_WORKER_IDLE) { + // If idle worker found, give to him + return $j; + } + } + + // If no idle workers, give to random risky worker + $worker = rand($riskyWorkers, $totalWorkers - 1); + Console::warning("swoole_dispatch: Risky branch: did not find a idle worker, picking random worker {$worker}"); + return $worker; + } + + // If safe request, give to any idle worker + // Its fine to pick risky worker here, because it's idle. Idle is never actually risky + for ($i = 0; $i < $totalWorkers; $i++) { + if ($server->getWorkerStatus($i) === SWOOLE_WORKER_IDLE) { + return $i; + } + } + + // If no idle worker found, give to random safe worker + // We avoid risky workers here, as it could be in work - not idle. Thats exactly when they are risky. + $worker = rand(0, $riskyWorkers - 1); + Console::warning("swoole_dispatch: Non-risky branch: did not find a idle worker, picking random worker {$worker}"); + return $worker; +} + include __DIR__ . '/controllers/general.php'; $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $register) { @@ -75,8 +172,8 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg do { try { $attempts++; - $dbForConsole = $app->getResource('dbForConsole'); - /** @var Utopia\Database\Database $dbForConsole */ + $dbForPlatform = $app->getResource('dbForPlatform'); + /** @var Utopia\Database\Database $dbForPlatform */ break; // leave the do-while if successful } catch (\Throwable $e) { Console::warning("Database not ready. Retrying connection ({$attempts})..."); @@ -90,22 +187,17 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg Console::success('[Setup] - Server database init started...'); try { - Console::success('[Setup] - Creating database: appwrite...'); - $dbForConsole->create(); - } catch (\Throwable $e) { + Console::success('[Setup] - Creating console database...'); + $dbForPlatform->create(); + } catch (Duplicate) { Console::success('[Setup] - Skip: metadata table already exists'); } - if ($dbForConsole->getCollection(Audit::COLLECTION)->isEmpty()) { - $audit = new Audit($dbForConsole); + if ($dbForPlatform->getCollection(Audit::COLLECTION)->isEmpty()) { + $audit = new Audit($dbForPlatform); $audit->setup(); } - if ($dbForConsole->getCollection(TimeLimit::COLLECTION)->isEmpty()) { - $adapter = new TimeLimit("", 0, 1, $dbForConsole); - $adapter->setup(); - } - /** @var array $collections */ $collections = Config::getParam('collections', []); $consoleCollections = $collections['console']; @@ -113,45 +205,21 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg if (($collection['$collection'] ?? '') !== Database::METADATA) { continue; } - if (!$dbForConsole->getCollection($key)->isEmpty()) { + if (!$dbForPlatform->getCollection($key)->isEmpty()) { continue; } - Console::success('[Setup] - Creating collection: ' . $collection['$id'] . '...'); + Console::success('[Setup] - Creating console collection: ' . $collection['$id'] . '...'); - $attributes = []; - $indexes = []; + $attributes = \array_map(fn ($attribute) => new Document($attribute), $collection['attributes']); + $indexes = \array_map(fn (array $index) => new Document($index), $collection['indexes']); - foreach ($collection['attributes'] as $attribute) { - $attributes[] = new Document([ - '$id' => ID::custom($attribute['$id']), - 'type' => $attribute['type'], - 'size' => $attribute['size'], - 'required' => $attribute['required'], - 'signed' => $attribute['signed'], - 'array' => $attribute['array'], - 'filters' => $attribute['filters'], - 'default' => $attribute['default'] ?? null, - 'format' => $attribute['format'] ?? '' - ]); - } - - foreach ($collection['indexes'] as $index) { - $indexes[] = new Document([ - '$id' => ID::custom($index['$id']), - 'type' => $index['type'], - 'attributes' => $index['attributes'], - 'lengths' => $index['lengths'], - 'orders' => $index['orders'], - ]); - } - - $dbForConsole->createCollection($key, $attributes, $indexes); + $dbForPlatform->createCollection($key, $attributes, $indexes); } - if ($dbForConsole->getDocument('buckets', 'default')->isEmpty() && !$dbForConsole->exists($dbForConsole->getDatabase(), 'bucket_1')) { + if ($dbForPlatform->getDocument('buckets', 'default')->isEmpty() && !$dbForPlatform->exists($dbForPlatform->getDatabase(), 'bucket_1')) { Console::success('[Setup] - Creating default bucket...'); - $dbForConsole->createDocument('buckets', new Document([ + $dbForPlatform->createDocument('buckets', new Document([ '$id' => ID::custom('default'), '$collection' => ID::custom('buckets'), 'name' => 'Default', @@ -171,7 +239,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg 'search' => 'buckets Default', ])); - $bucket = $dbForConsole->getDocument('buckets', 'default'); + $bucket = $dbForPlatform->getDocument('buckets', 'default'); Console::success('[Setup] - Creating files collection for default bucket...'); $files = $collections['buckets']['files'] ?? []; @@ -179,34 +247,53 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg throw new Exception('Files collection is not configured.'); } - $attributes = []; - $indexes = []; + $attributes = \array_map(fn ($attribute) => new Document($attribute), $files['attributes']); + $indexes = \array_map(fn (array $index) => new Document($index), $files['indexes']); - foreach ($files['attributes'] as $attribute) { - $attributes[] = new Document([ - '$id' => ID::custom($attribute['$id']), - 'type' => $attribute['type'], - 'size' => $attribute['size'], - 'required' => $attribute['required'], - 'signed' => $attribute['signed'], - 'array' => $attribute['array'], - 'filters' => $attribute['filters'], - 'default' => $attribute['default'] ?? null, - 'format' => $attribute['format'] ?? '' - ]); + $dbForPlatform->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes); + } + + $projectCollections = $collections['projects']; + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', '')); + $sharedTablesV2 = \array_diff($sharedTables, $sharedTablesV1); + + $cache = $app->getResource('cache'); + + foreach ($sharedTablesV2 as $hostname) { + $adapter = $pools + ->get($hostname) + ->pop() + ->getResource(); + + $dbForProject = (new Database($adapter, $cache)) + ->setDatabase('appwrite') + ->setSharedTables(true) + ->setTenant(null) + ->setNamespace(System::getEnv('_APP_DATABASE_SHARED_NAMESPACE', '')); + + try { + Console::success('[Setup] - Creating project database: ' . $hostname . '...'); + $dbForProject->create(); + } catch (Duplicate) { + Console::success('[Setup] - Skip: metadata table already exists'); } - foreach ($files['indexes'] as $index) { - $indexes[] = new Document([ - '$id' => ID::custom($index['$id']), - 'type' => $index['type'], - 'attributes' => $index['attributes'], - 'lengths' => $index['lengths'], - 'orders' => $index['orders'], - ]); - } + foreach ($projectCollections as $key => $collection) { + if (($collection['$collection'] ?? '') !== Database::METADATA) { + continue; + } + if (!$dbForProject->getCollection($key)->isEmpty()) { + continue; + } - $dbForConsole->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes); + $attributes = \array_map(fn ($attribute) => new Document($attribute), $collection['attributes']); + $indexes = \array_map(fn (array $index) => new Document($index), $collection['indexes']); + + Console::success('[Setup] - Creating project collection: ' . $collection['$id'] . '...'); + + $dbForProject->createCollection($key, $attributes, $indexes); + } } $pools->reclaim(); @@ -217,6 +304,9 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg Console::success('Server started successfully (max payload is ' . number_format($payloadSize) . ' bytes)'); Console::info("Master pid {$http->master_pid}, manager pid {$http->manager_pid}"); + // Start the task that starts fetching custom domains + $http->task([], 0); + // listen ctrl + c Process::signal(2, function () use ($http) { Console::log('Stop by Ctrl+C'); @@ -224,7 +314,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg }); }); -$http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) use ($register) { +$http->on(Constant::EVENT_REQUEST, function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) use ($register) { App::setResource('swooleRequest', fn () => $swooleRequest); App::setResource('swooleResponse', fn () => $swooleResponse); @@ -244,6 +334,8 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } $app = new App('UTC'); + $app->setCompression(System::getEnv('_APP_COMPRESSION_ENABLED', 'enabled') === 'enabled'); + $app->setCompressionMinSize(intval(System::getEnv('_APP_COMPRESSION_MIN_SIZE_BYTES', '1024'))); // 1KB $pools = $register->get('pools'); App::setResource('pools', fn () => $pools); @@ -271,10 +363,12 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo if (isset($user) && !$user->isEmpty()) { $log->setUser(new User($user->getId())); + } else { + $log->setUser(new User('guest-' . hash('sha256', $request->getIP()))); } $log->setNamespace("http"); - $log->setServer(\gethostname()); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); $log->setVersion($version); $log->setType(Log::TYPE_ERROR); $log->setMessage($th->getMessage()); @@ -292,8 +386,16 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo $log->addExtra('trace', $th->getTraceAsString()); $log->addExtra('roles', Authorization::getRoles()); - $action = $route->getLabel("sdk.namespace", "UNKNOWN_NAMESPACE") . '.' . $route->getLabel("sdk.method", "UNKNOWN_METHOD"); + $sdk = $route->getLabel("sdk", false); + + $action = 'UNKNOWN_NAMESPACE.UNKNOWN.METHOD'; + if (!empty($sdk)) { + /** @var Appwrite\SDK\Method $sdk */ + $action = $sdk->getNamespace() . '.' . $sdk->getMethodName(); + } + $log->setAction($action); + $log->addTag('service', $action); $isProduction = System::getEnv('_APP_ENV', 'development') === 'production'; $log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING); @@ -332,4 +434,59 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo } }); +// Fetch domains every `DOMAIN_SYNC_TIMER` seconds and update in the memory +$http->on('Task', function () use ($register, $domains) { + $lastSyncUpdate = null; + $pools = $register->get('pools'); + App::setResource('pools', fn () => $pools); + $app = new App('UTC'); + + /** @var Utopia\Database\Database $dbForPlatform */ + $dbForPlatform = $app->getResource('dbForPlatform'); + + Console::loop(function () use ($dbForPlatform, $domains, &$lastSyncUpdate) { + try { + $time = DateTime::now(); + $limit = 1000; + $sum = $limit; + $latestDocument = null; + + while ($sum === $limit) { + $queries = [Query::limit($limit)]; + if ($latestDocument !== null) { + $queries[] = Query::cursorAfter($latestDocument); + } + if ($lastSyncUpdate != null) { + $queries[] = Query::greaterThanEqual('$updatedAt', $lastSyncUpdate); + } + $queries[] = Query::equal('resourceType', ['function']); + $results = []; + try { + $results = Authorization::skip(fn () => $dbForPlatform->find('rules', $queries)); + } catch (Throwable $th) { + Console::error($th->getMessage()); + } + + $sum = count($results); + foreach ($results as $document) { + $domain = $document->getAttribute('domain'); + if (str_ends_with($domain, System::getEnv('_APP_DOMAIN_FUNCTIONS'))) { + continue; + } + $domains->set(md5($domain), ['value' => 1]); + } + $latestDocument = !empty(array_key_last($results)) ? $results[array_key_last($results)] : null; + } + $lastSyncUpdate = $time; + if ($sum > 0) { + Console::log("Sync domains tick: {$sum} domains were updated"); + } + } catch (Throwable $th) { + Console::error($th->getMessage()); + } + }, DOMAIN_SYNC_TIMER, 0, function ($error) { + Console::error($error); + }); +}); + $http->start(); diff --git a/app/init.php b/app/init.php index 3cb8084ece..680658cf39 100644 --- a/app/init.php +++ b/app/init.php @@ -31,7 +31,9 @@ use Appwrite\Event\Func; use Appwrite\Event\Mail; use Appwrite\Event\Messaging; use Appwrite\Event\Migration; +use Appwrite\Event\Realtime; use Appwrite\Event\Usage; +use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\Functions\Specification; use Appwrite\GraphQL\Promises\Adapter\Swoole; @@ -40,11 +42,13 @@ use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; use Appwrite\Network\Validator\Origin; use Appwrite\OpenSSL\OpenSSL; +use Appwrite\PubSub\Adapter\Redis as PubSub; use Appwrite\URL\URL as AppwriteURL; use Appwrite\Utopia\Request; use MaxMind\Db\Reader; use PHPMailer\PHPMailer\PHPMailer; use Swoole\Database\PDOProxy; +use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis; use Utopia\App; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Adapter\Sharding; @@ -118,9 +122,10 @@ const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours +const APP_FILE_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours const APP_CACHE_BUSTER = 4318; -const APP_VERSION_STABLE = '1.6.0'; +const APP_VERSION_STABLE = '1.6.1'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; const APP_DATABASE_ATTRIBUTE_IP = 'ip'; @@ -150,7 +155,7 @@ const APP_SOCIAL_DEV = 'https://dev.to/appwrite'; const APP_SOCIAL_STACKSHARE = 'https://stackshare.io/appwrite'; const APP_SOCIAL_YOUTUBE = 'https://www.youtube.com/c/appwrite?sub_confirmation=1'; const APP_HOSTNAME_INTERNAL = 'appwrite'; -const APP_FUNCTION_SPECIFICATION_DEFAULT = Specification::S_05VCPU_512MB; +const APP_FUNCTION_SPECIFICATION_DEFAULT = Specification::S_1VCPU_512MB; const APP_FUNCTION_CPUS_DEFAULT = 0.5; const APP_FUNCTION_MEMORY_DEFAULT = 512; const APP_PLATFORM_SERVER = 'server'; @@ -198,6 +203,7 @@ const DELETE_TYPE_TOPIC = 'topic'; const DELETE_TYPE_TARGET = 'target'; const DELETE_TYPE_EXPIRED_TARGETS = 'invalid_targets'; const DELETE_TYPE_SESSION_TARGETS = 'session_targets'; +const DELETE_TYPE_MAINTENANCE = 'maintenance'; // Message types const MESSAGE_SEND_TYPE_INTERNAL = 'internal'; @@ -228,6 +234,11 @@ const API_KEY_DYNAMIC = 'dynamic'; // Usage metrics const METRIC_TEAMS = 'teams'; const METRIC_USERS = 'users'; +const METRIC_WEBHOOKS_SENT = 'webhooks.events.sent'; +const METRIC_WEBHOOKS_FAILED = 'webhooks.events.failed'; +const METRIC_WEBHOOK_ID_SENT = '{webhookInternalId}.webhooks.events.sent'; +const METRIC_WEBHOOK_ID_FAILED = '{webhookInternalId}.webhooks.events.failed'; + const METRIC_AUTH_METHOD_PHONE = 'auth.method.phone'; const METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE = METRIC_AUTH_METHOD_PHONE . '.{countryCode}'; @@ -250,9 +261,15 @@ const METRIC_DOCUMENTS = 'documents'; const METRIC_DATABASE_ID_DOCUMENTS = '{databaseInternalId}.documents'; const METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS = '{databaseInternalId}.{collectionInternalId}.documents'; const METRIC_DATABASE_ID_COLLECTION_ID_STORAGE = '{databaseInternalId}.{collectionInternalId}.databases.storage'; +const METRIC_DATABASES_OPERATIONS_READS = 'databases.operations.reads'; +const METRIC_DATABASE_ID_OPERATIONS_READS = '{databaseInternalId}.databases.operations.reads'; +const METRIC_DATABASES_OPERATIONS_WRITES = 'databases.operations.writes'; +const METRIC_DATABASE_ID_OPERATIONS_WRITES = '{databaseInternalId}.databases.operations.writes'; const METRIC_BUCKETS = 'buckets'; const METRIC_FILES = 'files'; const METRIC_FILES_STORAGE = 'files.storage'; +const METRIC_FILES_TRANSFORMATIONS = 'files.transformations'; +const METRIC_BUCKET_ID_FILES_TRANSFORMATIONS = '{bucketInternalId}.files.transformations'; const METRIC_BUCKET_ID_FILES = '{bucketInternalId}.files'; const METRIC_BUCKET_ID_FILES_STORAGE = '{bucketInternalId}.files.storage'; const METRIC_FUNCTIONS = 'functions'; @@ -286,6 +303,17 @@ const METRIC_NETWORK_REQUESTS = 'network.requests'; const METRIC_NETWORK_INBOUND = 'network.inbound'; const METRIC_NETWORK_OUTBOUND = 'network.outbound'; +// Resource types + +const RESOURCE_TYPE_PROJECTS = 'projects'; +const RESOURCE_TYPE_FUNCTIONS = 'functions'; +const RESOURCE_TYPE_DATABASES = 'databases'; +const RESOURCE_TYPE_BUCKETS = 'buckets'; +const RESOURCE_TYPE_PROVIDERS = 'providers'; +const RESOURCE_TYPE_TOPICS = 'topics'; +const RESOURCE_TYPE_SUBSCRIBERS = 'subscribers'; +const RESOURCE_TYPE_MESSAGES = 'messages'; + $register = new Registry(); App::setMode(System::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); @@ -707,12 +735,19 @@ Database::addFilter( $data = \json_decode($message->getAttribute('data', []), true); $providerType = $message->getAttribute('providerType', ''); - if ($providerType === MESSAGE_TYPE_EMAIL) { - $searchValues = \array_merge($searchValues, [$data['subject'], MESSAGE_TYPE_EMAIL]); - } elseif ($providerType === MESSAGE_TYPE_SMS) { - $searchValues = \array_merge($searchValues, [$data['content'], MESSAGE_TYPE_SMS]); - } else { - $searchValues = \array_merge($searchValues, [$data['title'], MESSAGE_TYPE_PUSH]); + switch ($providerType) { + case MESSAGE_TYPE_EMAIL: + $searchValues[] = $data['subject']; + $searchValues[] = MESSAGE_TYPE_EMAIL; + break; + case MESSAGE_TYPE_SMS: + $searchValues[] = $data['content']; + $searchValues[] = MESSAGE_TYPE_SMS; + break; + case MESSAGE_TYPE_PUSH: + $searchValues[] = $data['title'] ?? ''; + $searchValues[] = MESSAGE_TYPE_PUSH; + break; } $search = \implode(' ', \array_filter($searchValues)); @@ -736,7 +771,7 @@ Structure::addFormat(APP_DATABASE_ATTRIBUTE_DATETIME, function () { }, Database::VAR_DATETIME); Structure::addFormat(APP_DATABASE_ATTRIBUTE_ENUM, function ($attribute) { - $elements = $attribute['formatOptions']['elements']; + $elements = $attribute['formatOptions']['elements'] ?? []; return new WhiteList($elements, true); }, Database::VAR_STRING); @@ -839,31 +874,37 @@ $register->set('pools', function () { $connections = [ 'console' => [ 'type' => 'database', - 'dsns' => System::getEnv('_APP_CONNECTIONS_DB_CONSOLE', $fallbackForDB), + 'dsns' => $fallbackForDB, 'multiple' => false, 'schemes' => ['mariadb', 'mysql'], ], 'database' => [ 'type' => 'database', - 'dsns' => System::getEnv('_APP_CONNECTIONS_DB_PROJECT', $fallbackForDB), + 'dsns' => $fallbackForDB, 'multiple' => true, 'schemes' => ['mariadb', 'mysql'], ], + 'logs' => [ + 'type' => 'database', + 'dsns' => System::getEnv('_APP_CONNECTIONS_DB_LOGS', $fallbackForDB), + 'multiple' => false, + 'schemes' => ['mariadb', 'mysql'], + ], 'queue' => [ 'type' => 'queue', - 'dsns' => System::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis), + 'dsns' => $fallbackForRedis, 'multiple' => false, 'schemes' => ['redis'], ], 'pubsub' => [ 'type' => 'pubsub', - 'dsns' => System::getEnv('_APP_CONNECTIONS_PUBSUB', $fallbackForRedis), + 'dsns' => $fallbackForRedis, 'multiple' => false, 'schemes' => ['redis'], ], 'cache' => [ 'type' => 'cache', - 'dsns' => System::getEnv('_APP_CONNECTIONS_CACHE', $fallbackForRedis), + 'dsns' => $fallbackForRedis, 'multiple' => true, 'schemes' => ['redis'], ], @@ -875,7 +916,7 @@ $register->set('pools', function () { $multiprocessing = System::getEnv('_APP_SERVER_MULTIPROCESS', 'disabled') === 'enabled'; if ($multiprocessing) { - $workerCount = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); + $workerCount = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); } else { $workerCount = 1; } @@ -935,12 +976,12 @@ $register->set('pools', function () { }); }, 'redis' => function () use ($dsnHost, $dsnPort, $dsnPass) { - $redis = new Redis(); + $redis = new \Redis(); @$redis->pconnect($dsnHost, (int)$dsnPort); if ($dsnPass) { $redis->auth($dsnPass); } - $redis->setOption(Redis::OPT_READ_TIMEOUT, -1); + $redis->setOption(\Redis::OPT_READ_TIMEOUT, -1); return $redis; }, @@ -960,7 +1001,10 @@ $register->set('pools', function () { $adapter->setDatabase($dsn->getPath()); break; case 'pubsub': - $adapter = $resource(); + $adapter = match ($dsn->getScheme()) { + 'redis' => new PubSub($resource()), + default => null + }; break; case 'queue': $adapter = match ($dsn->getScheme()) { @@ -1123,6 +1167,12 @@ App::setResource('queueForDeletes', function (Connection $queue) { App::setResource('queueForEvents', function (Connection $queue) { return new Event($queue); }, ['queue']); +App::setResource('queueForWebhooks', function (Connection $queue) { + return new Webhook($queue); +}, ['queue']); +App::setResource('queueForRealtime', function () { + return new Realtime(); +}, []); App::setResource('queueForAudits', function (Connection $queue) { return new Audit($queue); }, ['queue']); @@ -1233,12 +1283,12 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return new Document([]); }, ['project', 'dbForProject', 'request']); -App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForConsole) { +App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForPlatform) { /** @var Appwrite\Utopia\Request $request */ /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Database\Document $project */ /** @var Utopia\Database\Database $dbForProject */ - /** @var Utopia\Database\Database $dbForConsole */ + /** @var Utopia\Database\Database $dbForPlatform */ /** @var string $mode */ Authorization::setDefaultStatus(true); @@ -1287,13 +1337,13 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $user = new Document([]); } else { if ($project->getId() === 'console') { - $user = $dbForConsole->getDocument('users', Auth::$unique); + $user = $dbForPlatform->getDocument('users', Auth::$unique); } else { $user = $dbForProject->getDocument('users', Auth::$unique); } } } else { - $user = $dbForConsole->getDocument('users', Auth::$unique); + $user = $dbForPlatform->getDocument('users', Auth::$unique); } if ( @@ -1336,14 +1386,14 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons } $dbForProject->setMetadata('user', $user->getId()); - $dbForConsole->setMetadata('user', $user->getId()); + $dbForPlatform->setMetadata('user', $user->getId()); return $user; -}, ['mode', 'project', 'console', 'request', 'response', 'dbForProject', 'dbForConsole']); +}, ['mode', 'project', 'console', 'request', 'response', 'dbForProject', 'dbForPlatform']); -App::setResource('project', function ($dbForConsole, $request, $console) { +App::setResource('project', function ($dbForPlatform, $request, $console) { /** @var Appwrite\Utopia\Request $request */ - /** @var Utopia\Database\Database $dbForConsole */ + /** @var Utopia\Database\Database $dbForPlatform */ /** @var Utopia\Database\Document $console */ $projectId = $request->getParam('project', $request->getHeader('x-appwrite-project', '')); @@ -1352,10 +1402,10 @@ App::setResource('project', function ($dbForConsole, $request, $console) { return $console; } - $project = Authorization::skip(fn () => $dbForConsole->getDocument('projects', $projectId)); + $project = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $projectId)); return $project; -}, ['dbForConsole', 'request', 'console']); +}, ['dbForPlatform', 'request', 'console']); App::setResource('session', function (Document $user) { if ($user->isEmpty()) { @@ -1420,9 +1470,9 @@ App::setResource('console', function () { ]); }, []); -App::setResource('dbForProject', function (Group $pools, Database $dbForConsole, Cache $cache, Document $project) { +App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform, Cache $cache, Document $project) { if ($project->isEmpty() || $project->getId() === 'console') { - return $dbForConsole; + return $dbForPlatform; } try { @@ -1445,14 +1495,9 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForConsole, ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS) ->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES); - try { - $dsn = new DSN($project->getAttribute('database')); - } catch (\InvalidArgumentException) { - // TODO: Temporary until all projects are using shared tables - $dsn = new DSN('mysql://' . $project->getAttribute('database')); - } + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -1465,9 +1510,9 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForConsole, } return $database; -}, ['pools', 'dbForConsole', 'cache', 'project']); +}, ['pools', 'dbForPlatform', 'cache', 'project']); -App::setResource('dbForConsole', function (Group $pools, Cache $cache) { +App::setResource('dbForPlatform', function (Group $pools, Cache $cache) { $dbAdapter = $pools ->get('console') ->pop() @@ -1485,12 +1530,12 @@ App::setResource('dbForConsole', function (Group $pools, Cache $cache) { return $database; }, ['pools', 'cache']); -App::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, $cache) { +App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { $databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools - return function (Document $project) use ($pools, $dbForConsole, $cache, &$databases) { + return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) { if ($project->isEmpty() || $project->getId() === 'console') { - return $dbForConsole; + return $dbForPlatform; } try { @@ -1507,7 +1552,9 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS) ->setMaxQueryValues(APP_DATABASE_QUERY_MAX_VALUES); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -1537,7 +1584,7 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, return $database; }; -}, ['pools', 'dbForConsole', 'cache']); +}, ['pools', 'dbForPlatform', 'cache']); App::setResource('cache', function (Group $pools) { $list = Config::getParam('pools-cache', []); @@ -1554,6 +1601,27 @@ App::setResource('cache', function (Group $pools) { return new Cache(new Sharding($adapters)); }, ['pools']); +App::setResource('redis', function () { + $host = System::getEnv('_APP_REDIS_HOST', 'localhost'); + $port = System::getEnv('_APP_REDIS_PORT', 6379); + $pass = System::getEnv('_APP_REDIS_PASS', ''); + + $redis = new \Redis(); + @$redis->pconnect($host, (int)$port); + if ($pass) { + $redis->auth($pass); + } + $redis->setOption(\Redis::OPT_READ_TIMEOUT, -1); + + return $redis; +}); + +App::setResource('timelimit', function (\Redis $redis) { + return function (string $key, int $limit, int $time) use ($redis) { + return new TimeLimitRedis($key, $limit, $time, $redis); + }; +}, ['redis']); + App::setResource('deviceForLocal', function () { return new Local(); }); @@ -1814,12 +1882,16 @@ App::setResource('requestTimestamp', function ($request) { } return $requestTimestamp; }, ['request']); + App::setResource('plan', function (array $plan = []) { return []; }); +App::setResource('smsRates', function () { + return []; +}); -App::setResource('team', function (Document $project, Database $dbForConsole, App $utopia, Request $request) { +App::setResource('team', function (Document $project, Database $dbForPlatform, App $utopia, Request $request) { $teamInternalId = ''; if ($project->getId() !== 'console') { $teamInternalId = $project->getAttribute('teamInternalId', ''); @@ -1829,23 +1901,36 @@ App::setResource('team', function (Document $project, Database $dbForConsole, Ap if (str_starts_with($path, '/v1/projects/:projectId')) { $uri = $request->getURI(); $pid = explode('/', $uri)[3]; - $p = Authorization::skip(fn () => $dbForConsole->getDocument('projects', $pid)); + $p = Authorization::skip(fn () => $dbForPlatform->getDocument('projects', $pid)); $teamInternalId = $p->getAttribute('teamInternalId', ''); } elseif ($path === '/v1/projects') { $teamId = $request->getParam('teamId', ''); - $team = Authorization::skip(fn () => $dbForConsole->getDocument('teams', $teamId)); + $team = Authorization::skip(fn () => $dbForPlatform->getDocument('teams', $teamId)); return $team; } } - $team = Authorization::skip(function () use ($dbForConsole, $teamInternalId) { - return $dbForConsole->findOne('teams', [ + $team = Authorization::skip(function () use ($dbForPlatform, $teamInternalId) { + return $dbForPlatform->findOne('teams', [ Query::equal('$internalId', [$teamInternalId]), ]); }); - if (!$team) { - $team = new Document([]); - } return $team; -}, ['project', 'dbForConsole', 'utopia', 'request']); +}, ['project', 'dbForPlatform', 'utopia', 'request']); + +App::setResource( + 'isResourceBlocked', + fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false +); + +App::setResource('previewHostname', function (Request $request) { + if (App::isDevelopment()) { + $host = $request->getQuery('appwrite-hostname') ?? ''; + if (!empty($host)) { + return $host; + } + } + + return ''; +}, ['request']); diff --git a/app/realtime.php b/app/realtime.php index 1b59eb3bc7..86f9c85fdd 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -13,7 +13,7 @@ use Swoole\Runtime; use Swoole\Table; use Swoole\Timer; use Utopia\Abuse\Abuse; -use Utopia\Abuse\Adapters\Database\TimeLimit; +use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis; use Utopia\App; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; @@ -29,6 +29,7 @@ use Utopia\Database\Validator\Authorization; use Utopia\DSN\DSN; use Utopia\Logger\Log; use Utopia\System\System; +use Utopia\Telemetry\Adapter\None as NoTelemetry; use Utopia\WebSocket\Adapter; use Utopia\WebSocket\Server; @@ -92,7 +93,9 @@ if (!function_exists('getProjectDB')) { $database = new Database($adapter, getCache()); - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -135,6 +138,32 @@ if (!function_exists('getCache')) { } } +// Allows overriding +if (!function_exists('getRedis')) { + function getRedis(): \Redis + { + $host = System::getEnv('_APP_REDIS_HOST', 'localhost'); + $port = System::getEnv('_APP_REDIS_PORT', 6379); + $pass = System::getEnv('_APP_REDIS_PASS', ''); + + $redis = new \Redis(); + @$redis->pconnect($host, (int)$port); + if ($pass) { + $redis->auth($pass); + } + $redis->setOption(\Redis::OPT_READ_TIMEOUT, -1); + + return $redis; + } +} + +if (!function_exists('getTimelimit')) { + function getTimelimit(): TimeLimitRedis + { + return new TimeLimitRedis("", 0, 1, getRedis()); + } +} + if (!function_exists('getRealtime')) { function getRealtime(): Realtime { @@ -142,6 +171,13 @@ if (!function_exists('getRealtime')) { } } +if (!function_exists('getTelemetry')) { + function getTelemetry(int $workerId): Utopia\Telemetry\Adapter + { + return new NoTelemetry(); + } +} + $realtime = getRealtime(); /** @@ -157,7 +193,7 @@ $stats->create(); $containerId = uniqid(); $statsDocument = null; -$workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); +$workerNumber = intval(System::getEnv('_APP_CPU_NUM', swoole_cpu_num())) * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $adapter = new Adapter\Swoole(port: System::getEnv('PORT', 80)); $adapter @@ -174,7 +210,7 @@ $logError = function (Throwable $error, string $action) use ($register) { $log = new Log(); $log->setNamespace("realtime"); - $log->setServer(gethostname()); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); $log->setVersion($version); $log->setType(Log::TYPE_ERROR); $log->setMessage($error->getMessage()); @@ -274,6 +310,12 @@ $server->onStart(function () use ($stats, $register, $containerId, &$statsDocume $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $realtime, $logError) { Console::success('Worker ' . $workerId . ' started successfully'); + $telemetry = getTelemetry($workerId); + $register->set('telemetry', fn () => $telemetry); + $register->set('telemetry.connectionCounter', fn () => $telemetry->createUpDownCounter('realtime.server.open_connections')); + $register->set('telemetry.connectionCreatedCounter', fn () => $telemetry->createCounter('realtime.server.connection.created')); + $register->set('telemetry.messageSentCounter', fn () => $telemetry->createCounter('realtime.server.message.sent')); + $attempts = 0; $start = time(); @@ -365,17 +407,16 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, } $start = time(); - $redis = $register->get('pools')->get('pubsub')->pop()->getResource(); /** @var Redis $redis */ - $redis->setOption(Redis::OPT_READ_TIMEOUT, -1); - - if ($redis->ping(true)) { + /** @var \Appwrite\PubSub\Adapter $pubsub */ + $pubsub = $register->get('pools')->get('pubsub')->pop()->getResource(); + if ($pubsub->ping(true)) { $attempts = 0; Console::success('Pub/sub connection established (worker: ' . $workerId . ')'); } else { Console::error('Pub/sub failed (worker: ' . $workerId . ')'); } - $redis->subscribe(['realtime'], function (Redis $redis, string $channel, string $payload) use ($server, $workerId, $stats, $register, $realtime) { + $pubsub->subscribe(['realtime'], function (mixed $redis, string $channel, string $payload) use ($server, $workerId, $stats, $register, $realtime) { $event = json_decode($payload, true); if ($event['permissionsChanged'] && isset($event['userId'])) { @@ -417,6 +458,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, ); if (($num = count($receivers)) > 0) { + $register->get('telemetry.messageSentCounter')->add($num); $stats->incr($event['project'], 'messages', $num); } }); @@ -465,7 +507,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, throw new AppwriteException(AppwriteException::GENERAL_API_DISABLED); } - $dbForProject = getProjectDB($project); + $timelimit = $app->getResource('timelimit'); $console = $app->getResource('console'); /** @var Document $console */ $user = $app->getResource('user'); /** @var Document $user */ @@ -474,12 +516,12 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, * * Abuse limits are connecting 128 times per minute and ip address. */ - $timeLimit = new TimeLimit('url:{url},ip:{ip}', 128, 60, $dbForProject); - $timeLimit + $timelimit = $timelimit('url:{url},ip:{ip}', 128, 60); + $timelimit ->setParam('{ip}', $request->getIP()) ->setParam('{url}', $request->getURI()); - $abuse = new Abuse($timeLimit); + $abuse = new Abuse($timelimit); if (System::getEnv('_APP_OPTIONS_ABUSE', 'enabled') === 'enabled' && $abuse->check()) { throw new Exception(Exception::REALTIME_TOO_MANY_MESSAGES, 'Too many requests'); @@ -520,6 +562,9 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, ] ])); + $register->get('telemetry.connectionCounter')->add(1); + $register->get('telemetry.connectionCreatedCounter')->add(1); + $stats->set($project->getId(), [ 'projectId' => $project->getId(), 'teamId' => $project->getAttribute('teamId') @@ -574,7 +619,7 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re * * Abuse limits are sending 32 times per minute and connection. */ - $timeLimit = new TimeLimit('url:{url},connection:{connection}', 32, 60, $database); + $timeLimit = getTimelimit('url:{url},connection:{connection}', 32, 60); $timeLimit ->setParam('{connection}', $connection) @@ -593,9 +638,12 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re } switch ($message['type']) { - /** - * This type is used to authenticate. - */ + case 'ping': + $server->send([$connection], json_encode([ + 'type' => 'pong' + ])); + + break; case 'authentication': if (!array_key_exists('session', $message['data'])) { throw new Exception(Exception::REALTIME_MESSAGE_FORMAT_INVALID, 'Payload is not valid.'); @@ -653,9 +701,10 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re } }); -$server->onClose(function (int $connection) use ($realtime, $stats) { +$server->onClose(function (int $connection) use ($realtime, $stats, $register) { if (array_key_exists($connection, $realtime->connections)) { $stats->decr($realtime->connections[$connection]['projectId'], 'connectionsTotal'); + $register->get('telemetry.connectionCounter')->add(-1); } $realtime->unsubscribe($connection); diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index ad35135a6f..ad6d883c4c 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -73,6 +73,7 @@ $image = $this->getParam('image', ''); - _APP_ENV - _APP_WORKER_PER_CORE - _APP_LOCALE + - _APP_COMPRESSION_MIN_SIZE_BYTES - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS - _APP_CONSOLE_SESSION_ALERTS @@ -166,7 +167,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: <?php echo $organization; ?>/console:5.0.12 + image: <?php echo $organization; ?>/console:5.2.27 restart: unless-stopped networks: - appwrite diff --git a/app/worker.php b/app/worker.php index 2d59259284..6eb1363e9b 100644 --- a/app/worker.php +++ b/app/worker.php @@ -2,6 +2,7 @@ require_once __DIR__ . '/init.php'; +use Appwrite\Certificates\LetsEncrypt; use Appwrite\Event\Audit; use Appwrite\Event\Build; use Appwrite\Event\Certificate; @@ -16,7 +17,7 @@ use Appwrite\Event\Usage; use Appwrite\Event\UsageDump; use Appwrite\Platform\Appwrite; use Swoole\Runtime; -use Utopia\App; +use Utopia\Abuse\Adapters\TimeLimit\Redis as TimeLimitRedis; use Utopia\Cache\Adapter\Sharding; use Utopia\Cache\Cache; use Utopia\CLI\Console; @@ -41,7 +42,7 @@ Runtime::enableCoroutine(SWOOLE_HOOK_ALL); Server::setResource('register', fn () => $register); -Server::setResource('dbForConsole', function (Cache $cache, Registry $register) { +Server::setResource('dbForPlatform', function (Cache $cache, Registry $register) { $pools = $register->get('pools'); $database = $pools ->get('console') @@ -54,20 +55,20 @@ Server::setResource('dbForConsole', function (Cache $cache, Registry $register) return $adapter; }, ['cache', 'register']); -Server::setResource('project', function (Message $message, Database $dbForConsole) { +Server::setResource('project', function (Message $message, Database $dbForPlatform) { $payload = $message->getPayload() ?? []; $project = new Document($payload['project'] ?? []); - if ($project->getId() === 'console' || $project->isEmpty() || ! empty($project->getInternalId())) { + if ($project->getId() === 'console') { return $project; } - return $dbForConsole->getDocument('projects', $project->getId()); -}, ['message', 'dbForConsole']); + return $dbForPlatform->getDocument('projects', $project->getId()); +}, ['message', 'dbForPlatform']); -Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Document $project, Database $dbForConsole) { +Server::setResource('dbForProject', function (Cache $cache, Registry $register, Message $message, Document $project, Database $dbForPlatform) { if ($project->isEmpty() || $project->getId() === 'console') { - return $dbForConsole; + return $dbForPlatform; } $pools = $register->get('pools'); @@ -93,7 +94,9 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register, $dsn = new DSN('mysql://' . $project->getAttribute('database')); } - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -106,14 +109,14 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register, } return $database; -}, ['cache', 'register', 'message', 'project', 'dbForConsole']); +}, ['cache', 'register', 'message', 'project', 'dbForPlatform']); -Server::setResource('getProjectDB', function (Group $pools, Database $dbForConsole, $cache) { +Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) { $databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools - return function (Document $project) use ($pools, $dbForConsole, $cache, &$databases): Database { + return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases): Database { if ($project->isEmpty() || $project->getId() === 'console') { - return $dbForConsole; + return $dbForPlatform; } try { @@ -126,7 +129,9 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForConso if (isset($databases[$dsn->getHost()])) { $database = $databases[$dsn->getHost()]; - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -150,7 +155,9 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForConso $databases[$dsn->getHost()] = $database; - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + + if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) ->setTenant($project->getInternalId()) @@ -164,10 +171,10 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForConso return $database; }; -}, ['pools', 'dbForConsole', 'cache']); +}, ['pools', 'dbForPlatform', 'cache']); Server::setResource('abuseRetention', function () { - return DateTime::addSeconds(new \DateTime(), -1 * System::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', 86400)); + return time() - (int) System::getEnv('_APP_MAINTENANCE_RETENTION_ABUSE', 86400); }); Server::setResource('auditRetention', function () { @@ -194,6 +201,27 @@ Server::setResource('cache', function (Registry $register) { return new Cache(new Sharding($adapters)); }, ['register']); +Server::setResource('redis', function () { + $host = System::getEnv('_APP_REDIS_HOST', 'localhost'); + $port = System::getEnv('_APP_REDIS_PORT', 6379); + $pass = System::getEnv('_APP_REDIS_PASS', ''); + + $redis = new \Redis(); + @$redis->pconnect($host, (int)$port); + if ($pass) { + $redis->auth($pass); + } + $redis->setOption(\Redis::OPT_READ_TIMEOUT, -1); + + return $redis; +}); + +Server::setResource('timelimit', function (\Redis $redis) { + return function (string $key, int $limit, int $time) use ($redis) { + return new TimeLimitRedis($key, $limit, $time, $redis); + }; +}, ['redis']); + Server::setResource('log', fn () => new Log()); Server::setResource('queueForUsage', function (Connection $queue) { @@ -272,6 +300,64 @@ Server::setResource('deviceForCache', function (Document $project) { return getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId()); }, ['project']); +Server::setResource( + 'isResourceBlocked', + fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false +); + +Server::setResource('certificates', function () { + $email = System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS')); + if (empty($email)) { + throw new Exception('You must set a valid security email address (_APP_EMAIL_CERTIFICATES) to issue a LetsEncrypt SSL certificate.'); + } + + return new LetsEncrypt($email); +}); + +Server::setResource('logError', function (Registry $register, Document $project) { + return function (Throwable $error, string $namespace, string $action, ?array $extras) use ($register, $project) { + $logger = $register->get('logger'); + + if ($logger) { + $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); + + $log = new Log(); + $log->setNamespace($namespace); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); + $log->setVersion($version); + $log->setType(Log::TYPE_ERROR); + $log->setMessage($error->getMessage()); + + $log->addTag('code', $error->getCode()); + $log->addTag('verboseType', get_class($error)); + $log->addTag('projectId', $project->getId() ?? ''); + + $log->addExtra('file', $error->getFile()); + $log->addExtra('line', $error->getLine()); + $log->addExtra('trace', $error->getTraceAsString()); + + + foreach ($extras as $key => $value) { + $log->addExtra($key, $value); + } + + $log->setAction($action); + + $isProduction = System::getEnv('_APP_ENV', 'development') === 'production'; + $log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING); + + try { + $responseCode = $logger->addLog($log); + Console::info('Error log pushed with status code: ' . $responseCode); + } catch (Throwable $th) { + Console::error('Error pushing log: ' . $th->getMessage()); + } + } + + Console::warning("Failed: {$error->getMessage()}"); + Console::warning($error->getTraceAsString()); + }; +}, ['register', 'project']); $pools = $register->get('pools'); $platform = new Appwrite(); @@ -330,7 +416,7 @@ $worker if ($logger) { $log->setNamespace("appwrite-worker"); - $log->setServer(\gethostname()); + $log->setServer(System::getEnv('_APP_LOGGING_SERVICE_IDENTIFIER', \gethostname())); $log->setVersion($version); $log->setType(Log::TYPE_ERROR); $log->setMessage($error->getMessage()); diff --git a/composer.json b/composer.json index dd5472a0fa..8f5bb54f79 100644 --- a/composer.json +++ b/composer.json @@ -45,24 +45,24 @@ "ext-sockets": "*", "appwrite/php-runtimes": "0.16.*", "appwrite/php-clamav": "2.0.*", - "utopia-php/abuse": "0.43.0", + "utopia-php/abuse": "0.47.*", "utopia-php/analytics": "0.10.*", - "utopia-php/audit": "0.43.0", - "utopia-php/cache": "0.10.*", + "utopia-php/audit": "0.47.*", + "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.53.8", + "utopia-php/database": "0.56.4", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", - "utopia-php/fetch": "0.2.*", + "utopia-php/fetch": "0.3.*", "utopia-php/image": "0.7.*", "utopia-php/locale": "0.4.*", "utopia-php/logger": "0.6.*", - "utopia-php/messaging": "0.12.*", + "utopia-php/messaging": "0.14.*", "utopia-php/migration": "0.6.*", "utopia-php/orchestration": "0.9.*", - "utopia-php/platform": "0.7.*", + "utopia-php/platform": "0.7.1", "utopia-php/pools": "0.5.*", "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.7.*", @@ -70,6 +70,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.9.*", + "utopia-php/telemetry": "0.1.*", "utopia-php/vcs": "0.8.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", @@ -83,7 +84,7 @@ }, "require-dev": { "ext-fileinfo": "*", - "appwrite/sdk-generator": "0.39.*", + "appwrite/sdk-generator": "0.39.32", "phpunit/phpunit": "9.5.20", "swoole/ide-helper": "5.1.2", "textalk/websocket": "1.5.7", @@ -96,6 +97,10 @@ "config": { "platform": { "php": "8.3" + }, + "allow-plugins": { + "php-http/discovery": false, + "tbachert/spi": false } } } diff --git a/composer.lock b/composer.lock index 9079512e60..f3075c1801 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": "18505aa5baca1170e7cbdbb2a355b173", + "content-hash": "e8d26e7e836db255ba42cf55c3798c97", "packages": [ { "name": "adhocore/jwt", @@ -157,16 +157,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.16.2", + "version": "0.16.5", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "c33005e3eaaf2d427e9fd1077d5335e31f4d36f9" + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/c33005e3eaaf2d427e9fd1077d5335e31f4d36f9", - "reference": "c33005e3eaaf2d427e9fd1077d5335e31f4d36f9", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", + "reference": "1e430646fdf847a7caf3c611dcf3d6d5a28c3fd9", "shasum": "" }, "require": { @@ -206,22 +206,22 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.16.2" + "source": "https://github.com/appwrite/runtimes/tree/0.16.5" }, - "time": "2024-10-09T15:02:52+00:00" + "time": "2024-11-25T15:17:06+00:00" }, { "name": "beberlei/assert", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" + "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", + "url": "https://api.github.com/repos/beberlei/assert/zipball/b5fd8eacd8915a1b627b8bfc027803f1939734dd", + "reference": "b5fd8eacd8915a1b627b8bfc027803f1939734dd", "shasum": "" }, "require": { @@ -229,7 +229,7 @@ "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", - "php": "^7.0 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", @@ -273,9 +273,69 @@ ], "support": { "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.2" + "source": "https://github.com/beberlei/assert/tree/v3.3.3" }, - "time": "2021-12-16T21:41:27+00:00" + "time": "2024-07-15T13:18:35+00:00" + }, + { + "name": "brick/math", + "version": "0.12.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "bignumber", + "brick", + "decimal", + "integer", + "math", + "mathematics", + "rational" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.12.1" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "time": "2023-11-29T23:19:16+00:00" }, { "name": "chillerlan/php-qrcode", @@ -422,6 +482,87 @@ ], "time": "2024-07-17T01:04:28+00:00" }, + { + "name": "composer/semver", + "version": "3.4.3", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-09-19T14:15:21+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.3.2", @@ -567,29 +708,73 @@ "time": "2024-05-03T06:31:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "2.0.6", + "name": "google/protobuf", + "version": "v4.29.3", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" + "url": "https://github.com/protocolbuffers/protobuf-php.git", + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", - "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", + "reference": "ab5077c2cfdd1f415f42d11fdbdf903ba8e3d9b7", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "php": "^7.1|^8.0" + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": ">=5.0.0" + }, + "suggest": { + "ext-bcmath": "Need to support JSON deserialization" + }, + "type": "library", + "autoload": { + "psr-4": { + "Google\\Protobuf\\": "src/Google/Protobuf", + "GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "proto library for PHP", + "homepage": "https://developers.google.com/protocol-buffers/", + "keywords": [ + "proto" + ], + "support": { + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.3" + }, + "time": "2025-01-08T21:00:13+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "reference": "3c4e5f62ba8d7de1734312e4fff32f67a8daaf10", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "jean85/composer-provided-replaced-stub-package": "^1.0", "phpstan/phpstan": "^1.4", - "phpunit/phpunit": "^7.5|^8.5|^9.4", - "vimeo/psalm": "^4.3" + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "vimeo/psalm": "^4.3 || ^5.0" }, "type": "library", "extra": { @@ -621,9 +806,9 @@ ], "support": { "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.0" }, - "time": "2024-03-08T09:58:59+00:00" + "time": "2024-11-18T16:19:46+00:00" }, { "name": "league/csv", @@ -906,6 +1091,553 @@ }, "time": "2019-09-10T13:16:29+00:00" }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "nyholm/psr7-server", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7-server.git", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "nyholm/nsa": "^1.1", + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Nyholm\\Psr7Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "Helper classes to handle PSR-7 server requests", + "homepage": "http://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" + }, + { + "name": "open-telemetry/api", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/api.git", + "reference": "74b1a03263be8c5acb578f41da054b4bac3af4a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/74b1a03263be8c5acb578f41da054b4bac3af4a0", + "reference": "74b1a03263be8c5acb578f41da054b4bac3af4a0", + "shasum": "" + }, + "require": { + "open-telemetry/context": "^1.0", + "php": "^8.1", + "psr/log": "^1.1|^2.0|^3.0", + "symfony/polyfill-php82": "^1.26" + }, + "conflict": { + "open-telemetry/sdk": "<=1.0.8" + }, + "type": "library", + "extra": { + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + }, + "branch-alias": { + "dev-main": "1.1.x-dev" + } + }, + "autoload": { + "files": [ + "Trace/functions.php" + ], + "psr-4": { + "OpenTelemetry\\API\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "API for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "api", + "apm", + "logging", + "opentelemetry", + "otel", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-01-20T23:35:16+00:00" + }, + { + "name": "open-telemetry/context", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/context.git", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/context/zipball/0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "reference": "0cba875ea1953435f78aec7f1d75afa87bdbf7f3", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/polyfill-php82": "^1.26" + }, + "suggest": { + "ext-ffi": "To allow context switching in Fibers" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "fiber/initialize_fiber_handler.php" + ], + "psr-4": { + "OpenTelemetry\\Context\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Context implementation for OpenTelemetry PHP.", + "keywords": [ + "Context", + "opentelemetry", + "otel" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-21T00:29:20+00:00" + }, + { + "name": "open-telemetry/exporter-otlp", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/exporter-otlp.git", + "reference": "243d9657c44a06f740cf384f486afe954c2b725f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/243d9657c44a06f740cf384f486afe954c2b725f", + "reference": "243d9657c44a06f740cf384f486afe954c2b725f", + "shasum": "" + }, + "require": { + "open-telemetry/api": "^1.0", + "open-telemetry/gen-otlp-protobuf": "^1.1", + "open-telemetry/sdk": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "_register.php" + ], + "psr-4": { + "OpenTelemetry\\Contrib\\Otlp\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "OTLP exporter for OpenTelemetry.", + "keywords": [ + "Metrics", + "exporter", + "gRPC", + "http", + "opentelemetry", + "otel", + "otlp", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-01-08T23:50:03+00:00" + }, + { + "name": "open-telemetry/gen-otlp-protobuf", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/gen-otlp-protobuf.git", + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/gen-otlp-protobuf/zipball/585bafddd4ae6565de154610b10a787a455c9ba0", + "reference": "585bafddd4ae6565de154610b10a787a455c9ba0", + "shasum": "" + }, + "require": { + "google/protobuf": "^3.22 || ^4.0", + "php": "^8.0" + }, + "suggest": { + "ext-protobuf": "For better performance, when dealing with the protobuf format" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opentelemetry\\Proto\\": "Opentelemetry/Proto/", + "GPBMetadata\\Opentelemetry\\": "GPBMetadata/Opentelemetry/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.", + "keywords": [ + "Metrics", + "apm", + "gRPC", + "logging", + "opentelemetry", + "otel", + "otlp", + "protobuf", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-01-15T23:07:07+00:00" + }, + { + "name": "open-telemetry/sdk", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sdk.git", + "reference": "96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1", + "reference": "96aeaee5b7cb8c0bc4af7ff4717b429f2d9f67e1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "nyholm/psr7-server": "^1.1", + "open-telemetry/api": "~1.0 || ~1.1", + "open-telemetry/context": "^1.0", + "open-telemetry/sem-conv": "^1.0", + "php": "^8.1", + "php-http/discovery": "^1.14", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0.1|^2.0", + "psr/log": "^1.1|^2.0|^3.0", + "ramsey/uuid": "^3.0 || ^4.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php82": "^1.26", + "tbachert/spi": "^1.0.1" + }, + "suggest": { + "ext-gmp": "To support unlimited number of synchronous metric readers", + "ext-mbstring": "To increase performance of string operations", + "open-telemetry/sdk-configuration": "File-based OpenTelemetry SDK configuration" + }, + "type": "library", + "extra": { + "spi": { + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ + "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" + ] + }, + "branch-alias": { + "dev-main": "1.0.x-dev" + } + }, + "autoload": { + "files": [ + "Common/Util/functions.php", + "Logs/Exporter/_register.php", + "Metrics/MetricExporter/_register.php", + "Propagation/_register.php", + "Trace/SpanExporter/_register.php", + "Common/Dev/Compatibility/_load.php", + "_autoload.php" + ], + "psr-4": { + "OpenTelemetry\\SDK\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "SDK for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "sdk", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2025-01-09T23:17:14+00:00" + }, + { + "name": "open-telemetry/sem-conv", + "version": "1.27.1", + "source": { + "type": "git", + "url": "https://github.com/opentelemetry-php/sem-conv.git", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/1dba705fea74bc0718d04be26090e3697e56f4e6", + "reference": "1dba705fea74bc0718d04be26090e3697e56f4e6", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "OpenTelemetry\\SemConv\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "opentelemetry-php contributors", + "homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors" + } + ], + "description": "Semantic conventions for OpenTelemetry PHP.", + "keywords": [ + "Metrics", + "apm", + "logging", + "opentelemetry", + "otel", + "semantic conventions", + "semconv", + "tracing" + ], + "support": { + "chat": "https://app.slack.com/client/T08PSQ7BQ/C01NFPCV44V", + "docs": "https://opentelemetry.io/docs/php", + "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", + "source": "https://github.com/open-telemetry/opentelemetry-php" + }, + "time": "2024-08-28T09:20:31+00:00" + }, { "name": "paragonie/constant_time_encoding", "version": "v2.7.0", @@ -973,6 +1705,85 @@ }, "time": "2024-05-08T12:18:48+00:00" }, + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, { "name": "phpmailer/phpmailer", "version": "v6.9.1", @@ -1054,6 +1865,450 @@ ], "time": "2023-11-25T22:23:28+00:00" }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "time": "2022-12-31T21:50:55+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.7.6", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.6" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "time": "2024-04-27T21:32:50+00:00" + }, { "name": "spomky-labs/otphp", "version": "v10.0.3", @@ -1088,9 +2343,9 @@ "type": "library", "extra": { "branch-alias": { - "v10.0": "10.0.x-dev", + "v8.3": "8.3.x-dev", "v9.0": "9.0.x-dev", - "v8.3": "8.3.x-dev" + "v10.0": "10.0.x-dev" } }, "autoload": { @@ -1129,6 +2384,246 @@ }, "time": "2022-03-17T08:00:35+00:00" }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "symfony/http-client", + "version": "v7.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "339ba21476eb184290361542f732ad12c97591ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/339ba21476eb184290361542f732ad12c97591ec", + "reference": "339ba21476eb184290361542f732ad12c97591ec", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "amphp/amp": "<2.5", + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.2.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-30T18:35:15+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-07T08:49:48+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.31.0", @@ -1155,8 +2650,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1229,8 +2724,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1289,6 +2784,217 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-php82", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php82.git", + "reference": "5d2ed36f7734637dacc025f179698031951b1692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php82/zipball/5d2ed36f7734637dacc025f179698031951b1692", + "reference": "5d2ed36f7734637dacc025f179698031951b1692", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php82\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php82/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, + { + "name": "tbachert/spi", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/Nevay/spi.git", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nevay/spi/zipball/2ddfaf815dafb45791a61b08170de8d583c16062", + "reference": "2ddfaf815dafb45791a61b08170de8d583c16062", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "composer/semver": "^1.0 || ^2.0 || ^3.0", + "php": "^8.1" + }, + "require-dev": { + "composer/composer": "^2.0", + "infection/infection": "^0.27.9", + "phpunit/phpunit": "^10.5", + "psalm/phar": "^5.18" + }, + "type": "composer-plugin", + "extra": { + "class": "Nevay\\SPI\\Composer\\Plugin", + "branch-alias": { + "dev-main": "0.2.x-dev" + }, + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Nevay\\SPI\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Service provider loading facility", + "keywords": [ + "service provider" + ], + "support": { + "issues": "https://github.com/Nevay/spi/issues", + "source": "https://github.com/Nevay/spi/tree/v1.0.2" + }, + "time": "2024-10-04T16:36:12+00:00" + }, { "name": "thecodingmachine/safe", "version": "v2.5.0", @@ -1430,16 +3136,16 @@ }, { "name": "utopia-php/abuse", - "version": "0.43.0", + "version": "0.47.0", "source": { "type": "git", "url": "https://github.com/utopia-php/abuse.git", - "reference": "6346a3b4c5177a43160035a7289e30fdfb0790d6" + "reference": "2b52bb362234d4072b647ed57db1b3be030f57c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/abuse/zipball/6346a3b4c5177a43160035a7289e30fdfb0790d6", - "reference": "6346a3b4c5177a43160035a7289e30fdfb0790d6", + "url": "https://api.github.com/repos/utopia-php/abuse/zipball/2b52bb362234d4072b647ed57db1b3be030f57c2", + "reference": "2b52bb362234d4072b647ed57db1b3be030f57c2", "shasum": "" }, "require": { @@ -1447,7 +3153,7 @@ "ext-pdo": "*", "ext-redis": "*", "php": ">=8.0", - "utopia-php/database": "0.53.*" + "utopia-php/database": "0.56.*" }, "require-dev": { "laravel/pint": "1.5.*", @@ -1475,9 +3181,9 @@ ], "support": { "issues": "https://github.com/utopia-php/abuse/issues", - "source": "https://github.com/utopia-php/abuse/tree/0.43.0" + "source": "https://github.com/utopia-php/abuse/tree/0.47.0" }, - "time": "2024-08-30T05:17:23+00:00" + "time": "2025-01-15T02:41:02+00:00" }, { "name": "utopia-php/analytics", @@ -1527,21 +3233,21 @@ }, { "name": "utopia-php/audit", - "version": "0.43.0", + "version": "0.47.0", "source": { "type": "git", "url": "https://github.com/utopia-php/audit.git", - "reference": "cef22b5dc6a6d28fcd522f41c7bf7ded4a4dfd3e" + "reference": "1ebd5784ba68645073426f2f04a67726a1bde4d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/audit/zipball/cef22b5dc6a6d28fcd522f41c7bf7ded4a4dfd3e", - "reference": "cef22b5dc6a6d28fcd522f41c7bf7ded4a4dfd3e", + "url": "https://api.github.com/repos/utopia-php/audit/zipball/1ebd5784ba68645073426f2f04a67726a1bde4d7", + "reference": "1ebd5784ba68645073426f2f04a67726a1bde4d7", "shasum": "" }, "require": { "php": ">=8.0", - "utopia-php/database": "0.53.*" + "utopia-php/database": "0.56.*" }, "require-dev": { "laravel/pint": "1.5.*", @@ -1568,22 +3274,22 @@ ], "support": { "issues": "https://github.com/utopia-php/audit/issues", - "source": "https://github.com/utopia-php/audit/tree/0.43.0" + "source": "https://github.com/utopia-php/audit/tree/0.47.0" }, - "time": "2024-08-30T05:17:36+00:00" + "time": "2025-01-15T02:40:53+00:00" }, { "name": "utopia-php/cache", - "version": "0.10.2", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/cache.git", - "reference": "b22c6eb6d308de246b023efd0fc9758aee8b8247" + "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cache/zipball/b22c6eb6d308de246b023efd0fc9758aee8b8247", - "reference": "b22c6eb6d308de246b023efd0fc9758aee8b8247", + "url": "https://api.github.com/repos/utopia-php/cache/zipball/8ebcab5aac7606331cef69b0081f6c9eff2e58bc", + "reference": "8ebcab5aac7606331cef69b0081f6c9eff2e58bc", "shasum": "" }, "require": { @@ -1594,7 +3300,7 @@ }, "require-dev": { "laravel/pint": "1.2.*", - "phpstan/phpstan": "1.9.x-dev", + "phpstan/phpstan": "^1.12", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.13.1" }, @@ -1618,9 +3324,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cache/issues", - "source": "https://github.com/utopia-php/cache/tree/0.10.2" + "source": "https://github.com/utopia-php/cache/tree/0.11.0" }, - "time": "2024-06-25T20:36:35+00:00" + "time": "2024-11-05T16:53:58+00:00" }, { "name": "utopia-php/cli", @@ -1671,6 +3377,52 @@ }, "time": "2024-10-04T13:55:36+00:00" }, + { + "name": "utopia-php/compression", + "version": "0.1.3", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/compression.git", + "reference": "66f093557ba66d98245e562036182016c7dcfe8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/compression/zipball/66f093557ba66d98245e562036182016c7dcfe8a", + "reference": "66f093557ba66d98245e562036182016c7dcfe8a", + "shasum": "" + }, + "require": { + "php": ">=8.0" + }, + "require-dev": { + "laravel/pint": "1.2.*", + "phpunit/phpunit": "^9.3", + "vimeo/psalm": "4.0.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Compression\\": "src/Compression" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple Compression library to handle file compression", + "keywords": [ + "compression", + "framework", + "php", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/compression/issues", + "source": "https://github.com/utopia-php/compression/tree/0.1.3" + }, + "time": "2025-01-15T15:15:51+00:00" + }, { "name": "utopia-php/config", "version": "0.2.2", @@ -1724,32 +3476,32 @@ }, { "name": "utopia-php/database", - "version": "0.53.8", + "version": "0.56.4", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "f4f9297d633b9f8407c6261535549bfd6024a468" + "reference": "240478a60797124a885ceac40046fe47c22415b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/f4f9297d633b9f8407c6261535549bfd6024a468", - "reference": "f4f9297d633b9f8407c6261535549bfd6024a468", + "url": "https://api.github.com/repos/utopia-php/database/zipball/240478a60797124a885ceac40046fe47c22415b7", + "reference": "240478a60797124a885ceac40046fe47c22415b7", "shasum": "" }, "require": { "ext-mbstring": "*", "ext-pdo": "*", - "php": ">=8.0", - "utopia-php/cache": "0.10.*", + "php": ">=8.3", + "utopia-php/cache": "0.11.*", "utopia-php/framework": "0.33.*", "utopia-php/mongo": "0.3.*" }, "require-dev": { "fakerphp/faker": "1.23.*", - "laravel/pint": "1.17.*", - "pcov/clobber": "2.0.*", - "phpstan/phpstan": "1.11.*", - "phpunit/phpunit": "9.6.*", + "laravel/pint": "1.*", + "pcov/clobber": "2.*", + "phpstan/phpstan": "1.*", + "phpunit/phpunit": "9.*", "rregeer/phpunit-coverage-check": "0.3.*", "swoole/ide-helper": "5.1.3", "utopia-php/cli": "0.14.*" @@ -1774,9 +3526,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.53.8" + "source": "https://github.com/utopia-php/database/tree/0.56.4" }, - "time": "2024-10-16T08:16:33+00:00" + "time": "2025-01-20T09:22:08+00:00" }, { "name": "utopia-php/domains", @@ -1887,16 +3639,16 @@ }, { "name": "utopia-php/fetch", - "version": "0.2.1", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/fetch.git", - "reference": "1423c0ee3eef944d816ca6e31706895b585aea82" + "reference": "02b12c05aec13399dcc2da8d51f908e328ab63f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/fetch/zipball/1423c0ee3eef944d816ca6e31706895b585aea82", - "reference": "1423c0ee3eef944d816ca6e31706895b585aea82", + "url": "https://api.github.com/repos/utopia-php/fetch/zipball/02b12c05aec13399dcc2da8d51f908e328ab63f4", + "reference": "02b12c05aec13399dcc2da8d51f908e328ab63f4", "shasum": "" }, "require": { @@ -1920,26 +3672,28 @@ "description": "A simple library that provides an interface for making HTTP Requests.", "support": { "issues": "https://github.com/utopia-php/fetch/issues", - "source": "https://github.com/utopia-php/fetch/tree/0.2.1" + "source": "https://github.com/utopia-php/fetch/tree/0.3.0" }, - "time": "2024-03-18T11:50:59+00:00" + "time": "2025-01-17T06:11:10+00:00" }, { "name": "utopia-php/framework", - "version": "0.33.8", + "version": "0.33.16", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "a7f577540a25cb90896fef2b64767bf8d700f3c5" + "reference": "e91d4c560d1b809e25faa63d564fef034363b50f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/a7f577540a25cb90896fef2b64767bf8d700f3c5", - "reference": "a7f577540a25cb90896fef2b64767bf8d700f3c5", + "url": "https://api.github.com/repos/utopia-php/http/zipball/e91d4c560d1b809e25faa63d564fef034363b50f", + "reference": "e91d4c560d1b809e25faa63d564fef034363b50f", "shasum": "" }, "require": { - "php": ">=8.0" + "php": ">=8.1", + "utopia-php/compression": "0.1.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^1.2", @@ -1965,9 +3719,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.8" + "source": "https://github.com/utopia-php/http/tree/0.33.16" }, - "time": "2024-08-15T14:10:09+00:00" + "time": "2025-01-16T15:58:50+00:00" }, { "name": "utopia-php/image", @@ -2124,16 +3878,16 @@ }, { "name": "utopia-php/messaging", - "version": "0.12.1", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "b9dfafb5efc1d12cbee01d03dc98853ef026e35b" + "reference": "4ba356a3aa382802727f7e13e0f0152bcc1fc535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/b9dfafb5efc1d12cbee01d03dc98853ef026e35b", - "reference": "b9dfafb5efc1d12cbee01d03dc98853ef026e35b", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/4ba356a3aa382802727f7e13e0f0152bcc1fc535", + "reference": "4ba356a3aa382802727f7e13e0f0152bcc1fc535", "shasum": "" }, "require": { @@ -2144,9 +3898,9 @@ "phpmailer/phpmailer": "6.9.1" }, "require-dev": { - "laravel/pint": "1.13.11", - "phpstan/phpstan": "1.10.58", - "phpunit/phpunit": "10.5.10" + "laravel/pint": "1.*", + "phpstan/phpstan": "1.*", + "phpunit/phpunit": "11.*" }, "type": "library", "autoload": { @@ -2169,22 +3923,22 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.12.1" + "source": "https://github.com/utopia-php/messaging/tree/0.14.1" }, - "time": "2024-10-09T08:17:07+00:00" + "time": "2025-01-28T06:14:28+00:00" }, { "name": "utopia-php/migration", - "version": "0.6.9", + "version": "0.6.15", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "ce97cdf2ca82e7cec78e2ed484ef2c71ebe8744b" + "reference": "e849ec3e7ad38f5f5273ebb0132b112639cdf01c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/ce97cdf2ca82e7cec78e2ed484ef2c71ebe8744b", - "reference": "ce97cdf2ca82e7cec78e2ed484ef2c71ebe8744b", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/e849ec3e7ad38f5f5273ebb0132b112639cdf01c", + "reference": "e849ec3e7ad38f5f5273ebb0132b112639cdf01c", "shasum": "" }, "require": { @@ -2192,7 +3946,7 @@ "ext-curl": "*", "ext-openssl": "*", "php": "8.3.*", - "utopia-php/database": "0.53.*", + "utopia-php/database": "0.56.*", "utopia-php/dsn": "0.2.*", "utopia-php/framework": "0.33.*", "utopia-php/storage": "0.18.*" @@ -2225,9 +3979,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.6.9" + "source": "https://github.com/utopia-php/migration/tree/0.6.15" }, - "time": "2024-10-16T08:33:21+00:00" + "time": "2025-01-15T04:55:08+00:00" }, { "name": "utopia-php/mongo", @@ -2341,16 +4095,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.0", + "version": "0.7.1", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52" + "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", - "reference": "beeea0f2c9bce14a6869fc5c87a1047cdecb5c52", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/3433a0f1a54988f2a59c735f507745cb2c24638a", + "reference": "3433a0f1a54988f2a59c735f507745cb2c24638a", "shasum": "" }, "require": { @@ -2385,9 +4139,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.0" + "source": "https://github.com/utopia-php/platform/tree/0.7.1" }, - "time": "2024-05-08T17:00:55+00:00" + "time": "2024-10-22T10:27:49+00:00" }, { "name": "utopia-php/pools", @@ -2495,22 +4249,23 @@ }, { "name": "utopia-php/queue", - "version": "0.7.0", + "version": "0.7.3", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "917565256eb94bcab7246f7a746b1a486813761b" + "reference": "16074a98ee7d6212bc1228de200e13db470c098a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/917565256eb94bcab7246f7a746b1a486813761b", - "reference": "917565256eb94bcab7246f7a746b1a486813761b", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/16074a98ee7d6212bc1228de200e13db470c098a", + "reference": "16074a98ee7d6212bc1228de200e13db470c098a", "shasum": "" }, "require": { - "php": ">=8.0", + "php": ">=8.1", "utopia-php/cli": "0.15.*", - "utopia-php/framework": "0.*.*" + "utopia-php/framework": "0.*.*", + "utopia-php/telemetry": "0.1.*" }, "require-dev": { "laravel/pint": "^0.2.3", @@ -2550,9 +4305,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.7.0" + "source": "https://github.com/utopia-php/queue/tree/0.7.3" }, - "time": "2024-01-17T19:00:43+00:00" + "time": "2024-11-13T12:47:48+00:00" }, { "name": "utopia-php/registry", @@ -2608,16 +4363,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.5", + "version": "0.18.8", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919" + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/7d355c5e3ccc8ecebc0266f8ddd30088a43be919", - "reference": "7d355c5e3ccc8ecebc0266f8ddd30088a43be919", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/84737afa634e6a833fc4f8b0c967553234d3f215", + "reference": "84737afa634e6a833fc4f8b0c967553234d3f215", "shasum": "" }, "require": { @@ -2657,9 +4412,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.5" + "source": "https://github.com/utopia-php/storage/tree/0.18.8" }, - "time": "2024-09-04T08:57:27+00:00" + "time": "2024-12-04T08:30:35+00:00" }, { "name": "utopia-php/swoole", @@ -2769,23 +4524,73 @@ "time": "2024-10-09T14:44:01+00:00" }, { - "name": "utopia-php/vcs", - "version": "0.8.2", + "name": "utopia-php/telemetry", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/utopia-php/vcs.git", - "reference": "eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18" + "url": "https://github.com/utopia-php/telemetry.git", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18", - "reference": "eb9b7eade1a46a4f660e0d5a6304f7fa26ec9d18", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "reference": "d35f2f0632f4ee0be63fb7ace6a94a6adda71a80", + "shasum": "" + }, + "require": { + "ext-opentelemetry": "*", + "ext-protobuf": "*", + "nyholm/psr7": "^1.8", + "open-telemetry/exporter-otlp": "^1.1", + "open-telemetry/sdk": "^1.1", + "php": ">=8.0", + "symfony/http-client": "^7.1" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "keywords": [ + "framework", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/telemetry/issues", + "source": "https://github.com/utopia-php/telemetry/tree/0.1.0" + }, + "time": "2024-11-13T10:29:53+00:00" + }, + { + "name": "utopia-php/vcs", + "version": "0.8.6", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/vcs.git", + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b10225f54d5670f09f83e82e09de9d820ada6931", + "reference": "b10225f54d5670f09f83e82e09de9d820ada6931", "shasum": "" }, "require": { "adhocore/jwt": "^1.1", "php": ">=8.0", - "utopia-php/cache": "^0.10.0", + "utopia-php/cache": "^0.11.0", "utopia-php/framework": "0.*.*" }, "require-dev": { @@ -2813,9 +4618,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.8.2" + "source": "https://github.com/utopia-php/vcs/tree/0.8.6" }, - "time": "2024-08-13T14:36:30+00:00" + "time": "2024-12-10T13:13:23+00:00" }, { "name": "utopia-php/websocket", @@ -3002,16 +4807,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.39.24", + "version": "0.39.32", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8" + "reference": "2d02e1305ea5004fb0aec6b2618d6c597659b75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/412451c87f6ef17e24e9a5cf41721043d74c60c8", - "reference": "412451c87f6ef17e24e9a5cf41721043d74c60c8", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/2d02e1305ea5004fb0aec6b2618d6c597659b75c", + "reference": "2d02e1305ea5004fb0aec6b2618d6c597659b75c", "shasum": "" }, "require": { @@ -3019,7 +4824,7 @@ "ext-json": "*", "ext-mbstring": "*", "matthiasmullie/minify": "1.3.*", - "php": ">=8.0", + "php": ">=8.3", "twig/twig": "3.14.*" }, "require-dev": { @@ -3047,9 +4852,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.39.24" + "source": "https://github.com/appwrite/sdk-generator/tree/0.39.32" }, - "time": "2024-10-09T19:13:27+00:00" + "time": "2025-01-29T04:04:19+00:00" }, { "name": "doctrine/annotations", @@ -3129,29 +4934,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -3159,7 +4962,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -3170,9 +4973,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/instantiator", @@ -3323,16 +5126,16 @@ }, { "name": "laravel/pint", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "url": "https://api.github.com/repos/laravel/pint/zipball/53072e8ea22213a7ed168a8a15b96fbb8b82d44b", + "reference": "53072e8ea22213a7ed168a8a15b96fbb8b82d44b", "shasum": "" }, "require": { @@ -3343,13 +5146,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", - "laravel-zero/framework": "^10.4.0", + "friendsofphp/php-cs-fixer": "^3.66.0", + "illuminate/view": "^10.48.25", + "larastan/larastan": "^2.9.12", + "laravel-zero/framework": "^10.48.25", "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" + "nunomaduro/termwind": "^1.17.0", + "pestphp/pest": "^2.36.0" }, "bin": [ "builds/pint" @@ -3385,7 +5188,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-09-24T17:22:50+00:00" + "time": "2025-01-14T16:20:53+00:00" }, { "name": "matthiasmullie/minify", @@ -3513,16 +5316,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -3561,7 +5364,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -3569,20 +5372,20 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -3625,9 +5428,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", @@ -3798,70 +5601,18 @@ }, "time": "2023-10-30T13:38:26+00:00" }, - { - "name": "phpbench/dom", - "version": "0.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpbench/dom.git", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.3||^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.14", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.0||^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\Dom\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "DOM wrapper to simplify working with the PHP DOM implementation", - "support": { - "issues": "https://github.com/phpbench/dom/issues", - "source": "https://github.com/phpbench/dom/tree/0.3.3" - }, - "abandoned": true, - "time": "2023-03-06T23:46:57+00:00" - }, { "name": "phpbench/phpbench", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0" + "reference": "4248817222514421cba466bfa7adc7d8932345d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/4248817222514421cba466bfa7adc7d8932345d4", + "reference": "4248817222514421cba466bfa7adc7d8932345d4", "shasum": "" }, "require": { @@ -3874,7 +5625,6 @@ "ext-tokenizer": "*", "php": "^8.1", "phpbench/container": "^2.2", - "phpbench/dom": "~0.3.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "seld/jsonlint": "^1.1", "symfony/console": "^6.1 || ^7.0", @@ -3893,8 +5643,8 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.4", - "rector/rector": "^0.18.11 || ^1.0.0", + "phpunit/phpunit": "^10.4 || ^11.0", + "rector/rector": "^1.2", "symfony/error-handler": "^6.1 || ^7.0", "symfony/var-dumper": "^6.1 || ^7.0" }, @@ -3939,7 +5689,7 @@ ], "support": { "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.3.1" + "source": "https://github.com/phpbench/phpbench/tree/1.4.0" }, "funding": [ { @@ -3947,7 +5697,7 @@ "type": "github" } ], - "time": "2024-06-30T11:04:37+00:00" + "time": "2025-01-26T19:54:45+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -4004,16 +5754,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -4022,17 +5772,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -4062,29 +5812,29 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -4120,32 +5870,33 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.19.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", - "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/a0165c648cab6a80311c74ffc708a07bb53ecc93", + "reference": "a0165c648cab6a80311c74ffc708a07bb53ecc93", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.* || 8.4.*", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.40", "phpspec/phpspec": "^6.0 || ^7.0", "phpstan/phpstan": "^1.9", "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" @@ -4189,36 +5940,36 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.20.0" }, - "time": "2024-02-29T11:52:51+00:00" + "time": "2024-11-19T13:12:41+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/c00d78fb6b29658347f9d37ebe104bffadf36299", + "reference": "c00d78fb6b29658347f9d37ebe104bffadf36299", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -4236,9 +5987,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.0.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2024-10-13T11:29:49+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4711,109 +6462,6 @@ }, "time": "2021-02-03T23:26:27+00:00" }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.2", @@ -5875,16 +7523,16 @@ }, { "name": "symfony/console", - "version": "v7.1.5", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee", - "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -5948,7 +7596,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.5" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -5964,87 +7612,20 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:28:38+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.5", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/61fe0566189bf32e8cfee78335d8776f64a66f5a", - "reference": "61fe0566189bf32e8cfee78335d8776f64a66f5a", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -6081,7 +7662,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.5" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -6097,20 +7678,20 @@ "type": "tidelift" } ], - "time": "2024-09-17T09:16:35+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.4", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", - "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -6145,7 +7726,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.4" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -6161,20 +7742,20 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:28:19+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.1", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -6212,7 +7793,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -6228,7 +7809,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6256,8 +7837,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6332,8 +7913,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6410,8 +7991,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6488,8 +8069,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6546,16 +8127,16 @@ }, { "name": "symfony/process", - "version": "v7.1.5", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5c03ee6369281177f07f7c68252a280beccba847" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5c03ee6369281177f07f7c68252a280beccba847", - "reference": "5c03ee6369281177f07f7c68252a280beccba847", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -6587,7 +8168,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.5" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -6603,103 +8184,20 @@ "type": "tidelift" } ], - "time": "2024-09-19T21:48:23+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/string", - "version": "v7.1.5", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d66f9c343fa894ec2037cc928381df90a7ad4306", - "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -6757,7 +8255,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.5" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -6773,7 +8271,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:28:38+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "textalk/websocket", @@ -6876,16 +8374,16 @@ }, { "name": "twig/twig", - "version": "v3.14.0", + "version": "v3.14.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72" + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72", - "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", + "reference": "0b6f9d8370bb3b7f1ce5313ed8feb0fafd6e399a", "shasum": "" }, "require": { @@ -6939,7 +8437,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.14.0" + "source": "https://github.com/twigphp/Twig/tree/v3.14.2" }, "funding": [ { @@ -6951,7 +8449,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T17:55:12+00:00" + "time": "2024-11-07T12:36:22+00:00" }, { "name": "webmozart/glob", @@ -7005,7 +8503,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docker-compose.yml b/docker-compose.yml index 479ca38b8f..2fb19f7126 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -96,6 +96,7 @@ services: - _APP_EDITION - _APP_WORKER_PER_CORE - _APP_LOCALE + - _APP_COMPRESSION_MIN_SIZE_BYTES - _APP_CONSOLE_WHITELIST_ROOT - _APP_CONSOLE_WHITELIST_EMAILS - _APP_CONSOLE_SESSION_ALERTS @@ -192,11 +193,14 @@ services: - _APP_EXPERIMENT_LOGGING_PROVIDER - _APP_EXPERIMENT_LOGGING_CONFIG - _APP_DATABASE_SHARED_TABLES + - _APP_DATABASE_SHARED_TABLES_V1 + - _APP_DATABASE_SHARED_NAMESPACE + - _APP_FUNCTIONS_CREATION_ABUSE_LIMIT appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:5.0.12 + image: appwrite/console:5.2.27 restart: unless-stopped networks: - appwrite @@ -381,6 +385,8 @@ services: - _APP_EXECUTOR_SECRET - _APP_EXECUTOR_HOST - _APP_DATABASE_SHARED_TABLES + - _APP_DATABASE_SHARED_TABLES_V1 + - _APP_EMAIL_CERTIFICATES appwrite-worker-databases: entrypoint: worker-databases @@ -863,7 +869,7 @@ services: appwrite-assistant: container_name: appwrite-assistant - image: appwrite/assistant:0.5.0 + image: appwrite/assistant:0.7.0 networks: - appwrite environment: @@ -1053,4 +1059,4 @@ volumes: appwrite-certificates: appwrite-functions: appwrite-builds: - appwrite-config: + appwrite-config: \ No newline at end of file diff --git a/docs/examples/1.6.x/client-graphql/examples/account/create-push-target.md b/docs/examples/1.6.x/client-graphql/examples/account/create-push-target.md index 8a0fad387c..63802a782e 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/create-push-target.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/create-push-target.md @@ -12,5 +12,6 @@ mutation { providerId providerType identifier + expired } } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/create.md b/docs/examples/1.6.x/client-graphql/examples/account/create.md index 3f8e3c3cf7..0d39394a3d 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/create.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/create.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/get.md b/docs/examples/1.6.x/client-graphql/examples/account/get.md index e4db8f0e41..f4f07c187f 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/get.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/get.md @@ -28,6 +28,7 @@ query { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-email.md b/docs/examples/1.6.x/client-graphql/examples/account/update-email.md index b207bad4bb..c879e24a43 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-email.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-email.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-m-f-a.md b/docs/examples/1.6.x/client-graphql/examples/account/update-m-f-a.md index d2cd3d6ae5..787c2e0860 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-m-f-a.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-m-f-a.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-mfa-authenticator.md b/docs/examples/1.6.x/client-graphql/examples/account/update-mfa-authenticator.md index c74062c7d4..9cfe9150be 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-mfa-authenticator.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-mfa-authenticator.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-name.md b/docs/examples/1.6.x/client-graphql/examples/account/update-name.md index 850b5760a0..8ba2c99d9c 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-name.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-name.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-password.md b/docs/examples/1.6.x/client-graphql/examples/account/update-password.md index 5904da0842..f3619a10d2 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-password.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-password.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-phone.md b/docs/examples/1.6.x/client-graphql/examples/account/update-phone.md index 408a203300..adecb71168 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-phone.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-phone.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-prefs.md b/docs/examples/1.6.x/client-graphql/examples/account/update-prefs.md index 40db7b43db..57280247e4 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-prefs.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-prefs.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-push-target.md b/docs/examples/1.6.x/client-graphql/examples/account/update-push-target.md index 059702dc97..3c402cdf12 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-push-target.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-push-target.md @@ -11,5 +11,6 @@ mutation { providerId providerType identifier + expired } } diff --git a/docs/examples/1.6.x/client-graphql/examples/account/update-status.md b/docs/examples/1.6.x/client-graphql/examples/account/update-status.md index aca8c098e7..c17f556842 100644 --- a/docs/examples/1.6.x/client-graphql/examples/account/update-status.md +++ b/docs/examples/1.6.x/client-graphql/examples/account/update-status.md @@ -28,6 +28,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/client-graphql/examples/messaging/create-subscriber.md b/docs/examples/1.6.x/client-graphql/examples/messaging/create-subscriber.md index b2712ebb48..bab53612b7 100644 --- a/docs/examples/1.6.x/client-graphql/examples/messaging/create-subscriber.md +++ b/docs/examples/1.6.x/client-graphql/examples/messaging/create-subscriber.md @@ -17,6 +17,7 @@ mutation { providerId providerType identifier + expired } userId userName diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-boolean-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-boolean-attribute.md index d48c3470fe..f5adb497ec 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-boolean-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-boolean-attribute.md @@ -3,4 +3,5 @@ appwrite databases updateBooleanAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default false + --default false \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-datetime-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-datetime-attribute.md index 9fc56373ed..fe4a462664 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-datetime-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-datetime-attribute.md @@ -3,4 +3,5 @@ appwrite databases updateDatetimeAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default '' + --default '' \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-email-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-email-attribute.md index 9f7bffeb9c..58510a6f8e 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-email-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-email-attribute.md @@ -3,4 +3,5 @@ appwrite databases updateEmailAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default email@example.com + --default email@example.com \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-enum-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-enum-attribute.md index bf562a0a82..21d56d3e64 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-enum-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-enum-attribute.md @@ -4,4 +4,5 @@ appwrite databases updateEnumAttribute \ --key '' \ --elements one two three \ --required false \ - --default <DEFAULT> + --default <DEFAULT> \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-float-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-float-attribute.md index 097dfd310a..353320d78a 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-float-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-float-attribute.md @@ -5,4 +5,5 @@ appwrite databases updateFloatAttribute \ --required false \ --min null \ --max null \ - --default null + --default null \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-integer-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-integer-attribute.md index 6a6b0747a8..c170b7f6fa 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-integer-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-integer-attribute.md @@ -5,4 +5,5 @@ appwrite databases updateIntegerAttribute \ --required false \ --min null \ --max null \ - --default null + --default null \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-ip-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-ip-attribute.md index 2439b5a8de..a400eadc1e 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-ip-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-ip-attribute.md @@ -3,4 +3,5 @@ appwrite databases updateIpAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default '' + --default '' \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-relationship-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-relationship-attribute.md index be03a70736..6e2dbd927d 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-relationship-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-relationship-attribute.md @@ -3,3 +3,4 @@ appwrite databases updateRelationshipAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-string-attribute.md index ebf45253fa..526ece0b72 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-string-attribute.md @@ -3,4 +3,6 @@ appwrite databases updateStringAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default <DEFAULT> + --default <DEFAULT> \ + + diff --git a/docs/examples/1.6.x/console-cli/examples/databases/update-url-attribute.md b/docs/examples/1.6.x/console-cli/examples/databases/update-url-attribute.md index aa11a588db..e6f401b8ca 100644 --- a/docs/examples/1.6.x/console-cli/examples/databases/update-url-attribute.md +++ b/docs/examples/1.6.x/console-cli/examples/databases/update-url-attribute.md @@ -3,4 +3,5 @@ appwrite databases updateUrlAttribute \ --collectionId <COLLECTION_ID> \ --key '' \ --required false \ - --default https://example.com + --default https://example.com \ + diff --git a/docs/examples/1.6.x/console-cli/examples/messaging/create-push.md b/docs/examples/1.6.x/console-cli/examples/messaging/create-push.md index e187342503..18d8ec5aec 100644 --- a/docs/examples/1.6.x/console-cli/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/console-cli/examples/messaging/create-push.md @@ -1,7 +1,10 @@ appwrite messaging createPush \ --messageId <MESSAGE_ID> \ - --title <TITLE> \ - --body <BODY> \ + + + + + diff --git a/docs/examples/1.6.x/console-cli/examples/messaging/update-push.md b/docs/examples/1.6.x/console-cli/examples/messaging/update-push.md index 70f215c935..1f4427cee7 100644 --- a/docs/examples/1.6.x/console-cli/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/console-cli/examples/messaging/update-push.md @@ -15,3 +15,6 @@ appwrite messaging updatePush \ + + + diff --git a/docs/examples/1.6.x/console-cli/examples/projects/update-memberships-privacy.md b/docs/examples/1.6.x/console-cli/examples/projects/update-memberships-privacy.md new file mode 100644 index 0000000000..6c811ccfce --- /dev/null +++ b/docs/examples/1.6.x/console-cli/examples/projects/update-memberships-privacy.md @@ -0,0 +1,5 @@ +appwrite projects updateMembershipsPrivacy \ + --projectId <PROJECT_ID> \ + --userName false \ + --userEmail false \ + --mfa false diff --git a/docs/examples/1.6.x/console-web/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/console-web/examples/databases/update-string-attribute.md index 0ac1497d00..f652c304eb 100644 --- a/docs/examples/1.6.x/console-web/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/console-web/examples/databases/update-string-attribute.md @@ -12,7 +12,7 @@ const result = await databases.updateStringAttribute( '', // key false, // required '<DEFAULT>', // default - null, // size (optional) + 1, // size (optional) '' // newKey (optional) ); diff --git a/docs/examples/1.6.x/console-web/examples/messaging/create-push.md b/docs/examples/1.6.x/console-web/examples/messaging/create-push.md index fe8eac62ab..9a4fd4269a 100644 --- a/docs/examples/1.6.x/console-web/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/console-web/examples/messaging/create-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "@appwrite.io/console"; +import { Client, Messaging, MessagePriority } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -8,8 +8,8 @@ const messaging = new Messaging(client); const result = await messaging.createPush( '<MESSAGE_ID>', // messageId - '<TITLE>', // title - '<BODY>', // body + '<TITLE>', // title (optional) + '<BODY>', // body (optional) [], // topics (optional) [], // users (optional) [], // targets (optional) @@ -20,9 +20,12 @@ const result = await messaging.createPush( '<SOUND>', // sound (optional) '<COLOR>', // color (optional) '<TAG>', // tag (optional) - '<BADGE>', // badge (optional) + null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); console.log(result); diff --git a/docs/examples/1.6.x/console-web/examples/messaging/update-push.md b/docs/examples/1.6.x/console-web/examples/messaging/update-push.md index 9fbb230304..fa2220d3c6 100644 --- a/docs/examples/1.6.x/console-web/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/console-web/examples/messaging/update-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "@appwrite.io/console"; +import { Client, Messaging, MessagePriority } from "@appwrite.io/console"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -22,7 +22,10 @@ const result = await messaging.updatePush( '<TAG>', // tag (optional) null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); console.log(result); diff --git a/docs/examples/1.6.x/console-web/examples/projects/update-memberships-privacy.md b/docs/examples/1.6.x/console-web/examples/projects/update-memberships-privacy.md new file mode 100644 index 0000000000..2cde25faa5 --- /dev/null +++ b/docs/examples/1.6.x/console-web/examples/projects/update-memberships-privacy.md @@ -0,0 +1,16 @@ +import { Client, Projects } from "@appwrite.io/console"; + +const client = new Client() + .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>'); // Your project ID + +const projects = new Projects(client); + +const result = await projects.updateMembershipsPrivacy( + '<PROJECT_ID>', // projectId + false, // userName + false, // userEmail + false // mfa +); + +console.log(result); diff --git a/docs/examples/1.6.x/server-dart/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-dart/examples/databases/update-string-attribute.md index c2f3804c66..f9498aa36b 100644 --- a/docs/examples/1.6.x/server-dart/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-dart/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ AttributeString result = await databases.updateStringAttribute( key: '', xrequired: false, xdefault: '<DEFAULT>', - size: 0, // (optional) + size: 1, // (optional) newKey: '', // (optional) ); diff --git a/docs/examples/1.6.x/server-dart/examples/messaging/create-push.md b/docs/examples/1.6.x/server-dart/examples/messaging/create-push.md index c3c7d2ffc5..e496de9d27 100644 --- a/docs/examples/1.6.x/server-dart/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-dart/examples/messaging/create-push.md @@ -9,8 +9,8 @@ Messaging messaging = Messaging(client); Message result = await messaging.createPush( messageId: '<MESSAGE_ID>', - title: '<TITLE>', - body: '<BODY>', + title: '<TITLE>', // (optional) + body: '<BODY>', // (optional) topics: [], // (optional) users: [], // (optional) targets: [], // (optional) @@ -21,7 +21,10 @@ Message result = await messaging.createPush( sound: '<SOUND>', // (optional) color: '<COLOR>', // (optional) tag: '<TAG>', // (optional) - badge: '<BADGE>', // (optional) + badge: 0, // (optional) draft: false, // (optional) scheduledAt: '', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: MessagePriority.normal, // (optional) ); diff --git a/docs/examples/1.6.x/server-dart/examples/messaging/update-push.md b/docs/examples/1.6.x/server-dart/examples/messaging/update-push.md index dcec9b243f..f5d75332e2 100644 --- a/docs/examples/1.6.x/server-dart/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-dart/examples/messaging/update-push.md @@ -24,4 +24,7 @@ Message result = await messaging.updatePush( badge: 0, // (optional) draft: false, // (optional) scheduledAt: '', // (optional) + contentAvailable: false, // (optional) + critical: false, // (optional) + priority: MessagePriority.normal, // (optional) ); diff --git a/docs/examples/1.6.x/server-deno/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-deno/examples/databases/update-string-attribute.md index 6603c377cb..d57f8fd663 100644 --- a/docs/examples/1.6.x/server-deno/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-deno/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ const response = await databases.updateStringAttribute( '', // key false, // required '<DEFAULT>', // default - null, // size (optional) + 1, // size (optional) '' // newKey (optional) ); diff --git a/docs/examples/1.6.x/server-deno/examples/messaging/create-push.md b/docs/examples/1.6.x/server-deno/examples/messaging/create-push.md index 005cca1b77..7b41911918 100644 --- a/docs/examples/1.6.x/server-deno/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-deno/examples/messaging/create-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -9,8 +9,8 @@ const messaging = new Messaging(client); const response = await messaging.createPush( '<MESSAGE_ID>', // messageId - '<TITLE>', // title - '<BODY>', // body + '<TITLE>', // title (optional) + '<BODY>', // body (optional) [], // topics (optional) [], // users (optional) [], // targets (optional) @@ -21,7 +21,10 @@ const response = await messaging.createPush( '<SOUND>', // sound (optional) '<COLOR>', // color (optional) '<TAG>', // tag (optional) - '<BADGE>', // badge (optional) + null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); diff --git a/docs/examples/1.6.x/server-deno/examples/messaging/update-push.md b/docs/examples/1.6.x/server-deno/examples/messaging/update-push.md index 9c66ab6ab7..11437fabe1 100644 --- a/docs/examples/1.6.x/server-deno/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-deno/examples/messaging/update-push.md @@ -1,4 +1,4 @@ -import { Client, Messaging } from "https://deno.land/x/appwrite/mod.ts"; +import { Client, Messaging, MessagePriority } from "https://deno.land/x/appwrite/mod.ts"; const client = new Client() .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint @@ -23,5 +23,8 @@ const response = await messaging.updatePush( '<TAG>', // tag (optional) null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.Normal // priority (optional) ); diff --git a/docs/examples/1.6.x/server-dotnet/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-dotnet/examples/databases/update-string-attribute.md index e915d23f51..a180815a50 100644 --- a/docs/examples/1.6.x/server-dotnet/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-dotnet/examples/databases/update-string-attribute.md @@ -15,6 +15,6 @@ AttributeString result = await databases.UpdateStringAttribute( key: "", required: false, default: "<DEFAULT>", - size: 0, // optional + size: 1, // optional newKey: "" // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-dotnet/examples/messaging/create-push.md b/docs/examples/1.6.x/server-dotnet/examples/messaging/create-push.md index f83a0ed8df..588781b3a1 100644 --- a/docs/examples/1.6.x/server-dotnet/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-dotnet/examples/messaging/create-push.md @@ -1,4 +1,5 @@ using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -11,8 +12,8 @@ Messaging messaging = new Messaging(client); Message result = await messaging.CreatePush( messageId: "<MESSAGE_ID>", - title: "<TITLE>", - body: "<BODY>", + title: "<TITLE>", // optional + body: "<BODY>", // optional topics: new List<string>(), // optional users: new List<string>(), // optional targets: new List<string>(), // optional @@ -23,7 +24,10 @@ Message result = await messaging.CreatePush( sound: "<SOUND>", // optional color: "<COLOR>", // optional tag: "<TAG>", // optional - badge: "<BADGE>", // optional + badge: 0, // optional draft: false, // optional - scheduledAt: "" // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-dotnet/examples/messaging/update-push.md b/docs/examples/1.6.x/server-dotnet/examples/messaging/update-push.md index 0de09d570a..2b48d1827d 100644 --- a/docs/examples/1.6.x/server-dotnet/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-dotnet/examples/messaging/update-push.md @@ -1,4 +1,5 @@ using Appwrite; +using Appwrite.Enums; using Appwrite.Models; using Appwrite.Services; @@ -25,5 +26,8 @@ Message result = await messaging.UpdatePush( tag: "<TAG>", // optional badge: 0, // optional draft: false, // optional - scheduledAt: "" // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority.Normal // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-go/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-go/examples/databases/update-string-attribute.md index d662060f09..f3e6addb07 100644 --- a/docs/examples/1.6.x/server-go/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-go/examples/databases/update-string-attribute.md @@ -20,7 +20,7 @@ func main() { "", false, "<DEFAULT>", - databases.WithUpdateStringAttributeSize(0), + databases.WithUpdateStringAttributeSize(1), databases.WithUpdateStringAttributeNewKey(""), ) diff --git a/docs/examples/1.6.x/server-go/examples/messaging/create-push.md b/docs/examples/1.6.x/server-go/examples/messaging/create-push.md index 090e0cbca2..b40037472f 100644 --- a/docs/examples/1.6.x/server-go/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-go/examples/messaging/create-push.md @@ -16,8 +16,8 @@ func main() { service := messaging.NewMessaging(client) response, error := service.CreatePush( "<MESSAGE_ID>", - "<TITLE>", - "<BODY>", + messaging.WithCreatePushTitle("<TITLE>"), + messaging.WithCreatePushBody("<BODY>"), messaging.WithCreatePushTopics([]interface{}{}), messaging.WithCreatePushUsers([]interface{}{}), messaging.WithCreatePushTargets([]interface{}{}), @@ -28,9 +28,12 @@ func main() { messaging.WithCreatePushSound("<SOUND>"), messaging.WithCreatePushColor("<COLOR>"), messaging.WithCreatePushTag("<TAG>"), - messaging.WithCreatePushBadge("<BADGE>"), + messaging.WithCreatePushBadge(0), messaging.WithCreatePushDraft(false), messaging.WithCreatePushScheduledAt(""), + messaging.WithCreatePushContentAvailable(false), + messaging.WithCreatePushCritical(false), + messaging.WithCreatePushPriority("normal"), ) if error != nil { diff --git a/docs/examples/1.6.x/server-go/examples/messaging/update-push.md b/docs/examples/1.6.x/server-go/examples/messaging/update-push.md index af1b6095cd..d1b47256c0 100644 --- a/docs/examples/1.6.x/server-go/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-go/examples/messaging/update-push.md @@ -31,6 +31,9 @@ func main() { messaging.WithUpdatePushBadge(0), messaging.WithUpdatePushDraft(false), messaging.WithUpdatePushScheduledAt(""), + messaging.WithUpdatePushContentAvailable(false), + messaging.WithUpdatePushCritical(false), + messaging.WithUpdatePushPriority("normal"), ) if error != nil { diff --git a/docs/examples/1.6.x/server-graphql/examples/account/create.md b/docs/examples/1.6.x/server-graphql/examples/account/create.md index 3f8e3c3cf7..0d39394a3d 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/create.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/create.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/get.md b/docs/examples/1.6.x/server-graphql/examples/account/get.md index e4db8f0e41..f4f07c187f 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/get.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/get.md @@ -28,6 +28,7 @@ query { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-email.md b/docs/examples/1.6.x/server-graphql/examples/account/update-email.md index b207bad4bb..c879e24a43 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-email.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-email.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-m-f-a.md b/docs/examples/1.6.x/server-graphql/examples/account/update-m-f-a.md index d2cd3d6ae5..787c2e0860 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-m-f-a.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-m-f-a.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-mfa-authenticator.md b/docs/examples/1.6.x/server-graphql/examples/account/update-mfa-authenticator.md index c74062c7d4..9cfe9150be 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-mfa-authenticator.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-name.md b/docs/examples/1.6.x/server-graphql/examples/account/update-name.md index 850b5760a0..8ba2c99d9c 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-name.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-name.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-password.md b/docs/examples/1.6.x/server-graphql/examples/account/update-password.md index 5904da0842..f3619a10d2 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-password.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-password.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-phone.md b/docs/examples/1.6.x/server-graphql/examples/account/update-phone.md index 408a203300..adecb71168 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-phone.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-phone.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-prefs.md b/docs/examples/1.6.x/server-graphql/examples/account/update-prefs.md index 40db7b43db..57280247e4 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-prefs.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-prefs.md @@ -30,6 +30,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/account/update-status.md b/docs/examples/1.6.x/server-graphql/examples/account/update-status.md index aca8c098e7..c17f556842 100644 --- a/docs/examples/1.6.x/server-graphql/examples/account/update-status.md +++ b/docs/examples/1.6.x/server-graphql/examples/account/update-status.md @@ -28,6 +28,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-boolean-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-boolean-attribute.md index 6e969a587e..aa0bfa832e 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-boolean-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt default } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-collection.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-collection.md index 05175cc1e7..51eb51f410 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-collection.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-collection.md @@ -23,6 +23,8 @@ mutation { error attributes orders + _createdAt + _updatedAt } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-datetime-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-datetime-attribute.md index fcd5cb37a2..47601df0d8 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-datetime-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-email-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-email-attribute.md index 1f23a23ba7..e5845ccd47 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-email-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-email-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-enum-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-enum-attribute.md index 410a7983b4..d13c080e4a 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-enum-attribute.md @@ -14,6 +14,8 @@ mutation { error required array + _createdAt + _updatedAt elements format default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-float-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-float-attribute.md index ae6f9f72d6..2a270c3aff 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-float-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-float-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt min max default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-index.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-index.md index efc92a798c..2875a9b4b7 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-index.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-index.md @@ -13,5 +13,7 @@ mutation { error attributes orders + _createdAt + _updatedAt } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-integer-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-integer-attribute.md index 1dc43f6b0d..8c79706817 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-integer-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt min max default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-ip-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-ip-attribute.md index b2fd7215a0..0f4ad9e139 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-ip-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-relationship-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-relationship-attribute.md index ddca20b83a..f66b87d6af 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-relationship-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-relationship-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt relatedCollection relationType twoWay diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-string-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-string-attribute.md index 3c290712e9..62d97d6962 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-string-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-string-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt size default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/create-url-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/create-url-attribute.md index d2a39756c9..89ad873e52 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/create-url-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/create-url-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/get-collection.md b/docs/examples/1.6.x/server-graphql/examples/databases/get-collection.md index f76b71b6ba..ed27286b0d 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/get-collection.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/get-collection.md @@ -19,6 +19,8 @@ query { error attributes orders + _createdAt + _updatedAt } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/get-index.md b/docs/examples/1.6.x/server-graphql/examples/databases/get-index.md index de3c44ebe0..29de7a76f8 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/get-index.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/get-index.md @@ -10,5 +10,7 @@ query { error attributes orders + _createdAt + _updatedAt } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/list-collections.md b/docs/examples/1.6.x/server-graphql/examples/databases/list-collections.md index b821b6c4cf..8dafbf7042 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/list-collections.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/list-collections.md @@ -22,6 +22,8 @@ query { error attributes orders + _createdAt + _updatedAt } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/list-indexes.md b/docs/examples/1.6.x/server-graphql/examples/databases/list-indexes.md index e1c11b6c03..3cb67c6451 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/list-indexes.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/list-indexes.md @@ -12,6 +12,8 @@ query { error attributes orders + _createdAt + _updatedAt } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-boolean-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-boolean-attribute.md index e92b41a14e..d508e62139 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-boolean-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-boolean-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt default } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-collection.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-collection.md index fc78bb8efc..e918c058b8 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-collection.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-collection.md @@ -23,6 +23,8 @@ mutation { error attributes orders + _createdAt + _updatedAt } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-datetime-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-datetime-attribute.md index 46d9bbb728..a21b910edc 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-datetime-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-datetime-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-email-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-email-attribute.md index e05d365162..6c83d80e16 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-email-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-email-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-enum-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-enum-attribute.md index 619cbf817c..378e32f9b8 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-enum-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-enum-attribute.md @@ -14,6 +14,8 @@ mutation { error required array + _createdAt + _updatedAt elements format default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-float-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-float-attribute.md index 7641745a35..c5c7afca44 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-float-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-float-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt min max default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-integer-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-integer-attribute.md index 11b7a66014..e38ccaa88c 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-integer-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-integer-attribute.md @@ -15,6 +15,8 @@ mutation { error required array + _createdAt + _updatedAt min max default diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-ip-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-ip-attribute.md index 649fa881b5..7a26224200 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-ip-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-ip-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-relationship-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-relationship-attribute.md index 88ba2f9636..6694540d93 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-relationship-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-relationship-attribute.md @@ -12,6 +12,8 @@ mutation { error required array + _createdAt + _updatedAt relatedCollection relationType twoWay diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-string-attribute.md index 4d88462efb..afafb307f5 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-string-attribute.md @@ -5,7 +5,7 @@ mutation { key: "", required: false, default: "<DEFAULT>", - size: 0, + size: 1, newKey: "" ) { key @@ -14,6 +14,8 @@ mutation { error required array + _createdAt + _updatedAt size default } diff --git a/docs/examples/1.6.x/server-graphql/examples/databases/update-url-attribute.md b/docs/examples/1.6.x/server-graphql/examples/databases/update-url-attribute.md index 06838a9ed4..f9f14a04f6 100644 --- a/docs/examples/1.6.x/server-graphql/examples/databases/update-url-attribute.md +++ b/docs/examples/1.6.x/server-graphql/examples/databases/update-url-attribute.md @@ -13,6 +13,8 @@ mutation { error required array + _createdAt + _updatedAt format default } diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/create-push.md b/docs/examples/1.6.x/server-graphql/examples/messaging/create-push.md index 3084c97635..92264d1b67 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/create-push.md @@ -13,9 +13,12 @@ mutation { sound: "<SOUND>", color: "<COLOR>", tag: "<TAG>", - badge: "<BADGE>", + badge: 0, draft: false, - scheduledAt: "" + scheduledAt: "", + contentAvailable: false, + critical: false, + priority: "normal" ) { _id _createdAt diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/create-subscriber.md b/docs/examples/1.6.x/server-graphql/examples/messaging/create-subscriber.md index b2712ebb48..bab53612b7 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/create-subscriber.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/create-subscriber.md @@ -17,6 +17,7 @@ mutation { providerId providerType identifier + expired } userId userName diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/get-subscriber.md b/docs/examples/1.6.x/server-graphql/examples/messaging/get-subscriber.md index 54096dd70a..2e1672d010 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/get-subscriber.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/get-subscriber.md @@ -16,6 +16,7 @@ query { providerId providerType identifier + expired } userId userName diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/list-subscribers.md b/docs/examples/1.6.x/server-graphql/examples/messaging/list-subscribers.md index 5c48ae34bb..a5a4f91e56 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/list-subscribers.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/list-subscribers.md @@ -19,6 +19,7 @@ query { providerId providerType identifier + expired } userId userName diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/list-targets.md b/docs/examples/1.6.x/server-graphql/examples/messaging/list-targets.md index 8e356dce5f..aa82276de2 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/list-targets.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/list-targets.md @@ -13,6 +13,7 @@ query { providerId providerType identifier + expired } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/messaging/update-push.md b/docs/examples/1.6.x/server-graphql/examples/messaging/update-push.md index 9039792573..8ee2f57610 100644 --- a/docs/examples/1.6.x/server-graphql/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-graphql/examples/messaging/update-push.md @@ -15,7 +15,10 @@ mutation { tag: "<TAG>", badge: 0, draft: false, - scheduledAt: "" + scheduledAt: "", + contentAvailable: false, + critical: false, + priority: "normal" ) { _id _createdAt diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-argon2user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-argon2user.md index 464dc754c9..7f99622e52 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-argon2user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-argon2user.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-bcrypt-user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-bcrypt-user.md index 4d4bb09194..26659176eb 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-bcrypt-user.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-m-d5user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-m-d5user.md index e8e833e6de..7e642b8233 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-m-d5user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-m-d5user.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-p-h-pass-user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-p-h-pass-user.md index 53960e7890..4c06b007a2 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-p-h-pass-user.md @@ -33,6 +33,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-s-h-a-user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-s-h-a-user.md index 17e287f8b3..f99da2752d 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-s-h-a-user.md @@ -34,6 +34,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-modified-user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-modified-user.md index 6d51fb29ba..624ffcdd38 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-modified-user.md @@ -36,6 +36,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-user.md b/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-user.md index 0d4bac1db8..68a5f4c75f 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-user.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-scrypt-user.md @@ -38,6 +38,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create-target.md b/docs/examples/1.6.x/server-graphql/examples/users/create-target.md index a3a0696dec..7068c21aba 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create-target.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create-target.md @@ -15,5 +15,6 @@ mutation { providerId providerType identifier + expired } } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/create.md b/docs/examples/1.6.x/server-graphql/examples/users/create.md index 826a5168ef..465da80432 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/create.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/create.md @@ -34,6 +34,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/delete-mfa-authenticator.md b/docs/examples/1.6.x/server-graphql/examples/users/delete-mfa-authenticator.md index 227c340c68..26c9594a53 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/delete-mfa-authenticator.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/get-target.md b/docs/examples/1.6.x/server-graphql/examples/users/get-target.md index e4ba1a04a1..c84f947898 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/get-target.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/get-target.md @@ -11,5 +11,6 @@ query { providerId providerType identifier + expired } } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/get.md b/docs/examples/1.6.x/server-graphql/examples/users/get.md index f94a5818ed..9d0be685d9 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/get.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/get.md @@ -30,6 +30,7 @@ query { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/list-targets.md b/docs/examples/1.6.x/server-graphql/examples/users/list-targets.md index 05e796f167..408fd96f80 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/list-targets.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/list-targets.md @@ -13,6 +13,7 @@ query { providerId providerType identifier + expired } } } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/list.md b/docs/examples/1.6.x/server-graphql/examples/users/list.md index e2326dd1a2..a90121adf2 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/list.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/list.md @@ -33,6 +33,7 @@ query { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-email-verification.md b/docs/examples/1.6.x/server-graphql/examples/users/update-email-verification.md index 6bb2781854..cda7278ac0 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-email-verification.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-email-verification.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-email.md b/docs/examples/1.6.x/server-graphql/examples/users/update-email.md index 046937ac04..408a74972b 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-email.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-email.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-labels.md b/docs/examples/1.6.x/server-graphql/examples/users/update-labels.md index 93da33d805..cb3c5b6483 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-labels.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-labels.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-mfa.md b/docs/examples/1.6.x/server-graphql/examples/users/update-mfa.md index 9219aa1aea..ac09ea19a4 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-mfa.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-mfa.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-name.md b/docs/examples/1.6.x/server-graphql/examples/users/update-name.md index 01a53ce479..ec7e3dc27c 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-name.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-name.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-password.md b/docs/examples/1.6.x/server-graphql/examples/users/update-password.md index c95637c4ce..95ef74c83d 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-password.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-password.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-phone-verification.md b/docs/examples/1.6.x/server-graphql/examples/users/update-phone-verification.md index 58343ae365..c6afa54ba4 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-phone-verification.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-phone-verification.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-phone.md b/docs/examples/1.6.x/server-graphql/examples/users/update-phone.md index dbcb076c65..d3fc7d5f37 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-phone.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-phone.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-status.md b/docs/examples/1.6.x/server-graphql/examples/users/update-status.md index ad05bc75ff..2499c1c258 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-status.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-status.md @@ -31,6 +31,7 @@ mutation { providerId providerType identifier + expired } accessedAt } diff --git a/docs/examples/1.6.x/server-graphql/examples/users/update-target.md b/docs/examples/1.6.x/server-graphql/examples/users/update-target.md index fe3444ede7..1f7cc1147a 100644 --- a/docs/examples/1.6.x/server-graphql/examples/users/update-target.md +++ b/docs/examples/1.6.x/server-graphql/examples/users/update-target.md @@ -14,5 +14,6 @@ mutation { providerId providerType identifier + expired } } diff --git a/docs/examples/1.6.x/server-kotlin/java/databases/update-string-attribute.md b/docs/examples/1.6.x/server-kotlin/java/databases/update-string-attribute.md index 75be9e01f8..2d69006181 100644 --- a/docs/examples/1.6.x/server-kotlin/java/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-kotlin/java/databases/update-string-attribute.md @@ -15,7 +15,7 @@ databases.updateStringAttribute( "", // key false, // required "<DEFAULT>", // default - 0, // size (optional) + 1, // size (optional) "", // newKey (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/1.6.x/server-kotlin/java/messaging/create-push.md b/docs/examples/1.6.x/server-kotlin/java/messaging/create-push.md index 934f1faaa8..56c7a60795 100644 --- a/docs/examples/1.6.x/server-kotlin/java/messaging/create-push.md +++ b/docs/examples/1.6.x/server-kotlin/java/messaging/create-push.md @@ -11,8 +11,8 @@ Messaging messaging = new Messaging(client); messaging.createPush( "<MESSAGE_ID>", // messageId - "<TITLE>", // title - "<BODY>", // body + "<TITLE>", // title (optional) + "<BODY>", // body (optional) listOf(), // topics (optional) listOf(), // users (optional) listOf(), // targets (optional) @@ -23,9 +23,12 @@ messaging.createPush( "<SOUND>", // sound (optional) "<COLOR>", // color (optional) "<TAG>", // tag (optional) - "<BADGE>", // badge (optional) + 0, // badge (optional) false, // draft (optional) "", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/1.6.x/server-kotlin/java/messaging/update-push.md b/docs/examples/1.6.x/server-kotlin/java/messaging/update-push.md index ef04203c37..bb8c3c8c2e 100644 --- a/docs/examples/1.6.x/server-kotlin/java/messaging/update-push.md +++ b/docs/examples/1.6.x/server-kotlin/java/messaging/update-push.md @@ -26,6 +26,9 @@ messaging.updatePush( 0, // badge (optional) false, // draft (optional) "", // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + MessagePriority.NORMAL, // priority (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-string-attribute.md b/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-string-attribute.md index a37d4566ee..32e17beb9c 100644 --- a/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-kotlin/kotlin/databases/update-string-attribute.md @@ -15,6 +15,6 @@ val response = databases.updateStringAttribute( key = "", required = false, default = "<DEFAULT>", - size = 0, // optional + size = 1, // optional newKey = "" // optional ) diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/messaging/create-push.md b/docs/examples/1.6.x/server-kotlin/kotlin/messaging/create-push.md index 6a95f63992..f92a49d627 100644 --- a/docs/examples/1.6.x/server-kotlin/kotlin/messaging/create-push.md +++ b/docs/examples/1.6.x/server-kotlin/kotlin/messaging/create-push.md @@ -11,8 +11,8 @@ val messaging = Messaging(client) val response = messaging.createPush( messageId = "<MESSAGE_ID>", - title = "<TITLE>", - body = "<BODY>", + title = "<TITLE>", // optional + body = "<BODY>", // optional topics = listOf(), // optional users = listOf(), // optional targets = listOf(), // optional @@ -23,7 +23,10 @@ val response = messaging.createPush( sound = "<SOUND>", // optional color = "<COLOR>", // optional tag = "<TAG>", // optional - badge = "<BADGE>", // optional + badge = 0, // optional draft = false, // optional - scheduledAt = "" // optional + scheduledAt = "", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = "normal" // optional ) diff --git a/docs/examples/1.6.x/server-kotlin/kotlin/messaging/update-push.md b/docs/examples/1.6.x/server-kotlin/kotlin/messaging/update-push.md index d91694e1bc..0ba72c461c 100644 --- a/docs/examples/1.6.x/server-kotlin/kotlin/messaging/update-push.md +++ b/docs/examples/1.6.x/server-kotlin/kotlin/messaging/update-push.md @@ -25,5 +25,8 @@ val response = messaging.updatePush( tag = "<TAG>", // optional badge = 0, // optional draft = false, // optional - scheduledAt = "" // optional + scheduledAt = "", // optional + contentAvailable = false, // optional + critical = false, // optional + priority = "normal" // optional ) diff --git a/docs/examples/1.6.x/server-nodejs/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-nodejs/examples/databases/update-string-attribute.md index f379fdc0cf..6aecbb591e 100644 --- a/docs/examples/1.6.x/server-nodejs/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-nodejs/examples/databases/update-string-attribute.md @@ -13,6 +13,6 @@ const result = await databases.updateStringAttribute( '', // key false, // required '<DEFAULT>', // default - null, // size (optional) + 1, // size (optional) '' // newKey (optional) ); diff --git a/docs/examples/1.6.x/server-nodejs/examples/messaging/create-push.md b/docs/examples/1.6.x/server-nodejs/examples/messaging/create-push.md index 54103e11f7..bb98538748 100644 --- a/docs/examples/1.6.x/server-nodejs/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-nodejs/examples/messaging/create-push.md @@ -9,8 +9,8 @@ const messaging = new sdk.Messaging(client); const result = await messaging.createPush( '<MESSAGE_ID>', // messageId - '<TITLE>', // title - '<BODY>', // body + '<TITLE>', // title (optional) + '<BODY>', // body (optional) [], // topics (optional) [], // users (optional) [], // targets (optional) @@ -21,7 +21,10 @@ const result = await messaging.createPush( '<SOUND>', // sound (optional) '<COLOR>', // color (optional) '<TAG>', // tag (optional) - '<BADGE>', // badge (optional) + null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + sdk.MessagePriority.Normal // priority (optional) ); diff --git a/docs/examples/1.6.x/server-nodejs/examples/messaging/update-push.md b/docs/examples/1.6.x/server-nodejs/examples/messaging/update-push.md index ec87ecf7cf..700c3a99de 100644 --- a/docs/examples/1.6.x/server-nodejs/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-nodejs/examples/messaging/update-push.md @@ -23,5 +23,8 @@ const result = await messaging.updatePush( '<TAG>', // tag (optional) null, // badge (optional) false, // draft (optional) - '' // scheduledAt (optional) + '', // scheduledAt (optional) + false, // contentAvailable (optional) + false, // critical (optional) + sdk.MessagePriority.Normal // priority (optional) ); diff --git a/docs/examples/1.6.x/server-php/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-php/examples/databases/update-string-attribute.md index 9e821e4436..721ba324de 100644 --- a/docs/examples/1.6.x/server-php/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-php/examples/databases/update-string-attribute.md @@ -16,6 +16,6 @@ $result = $databases->updateStringAttribute( key: '', required: false, default: '<DEFAULT>', - size: null, // optional + size: 1, // optional newKey: '' // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-php/examples/messaging/create-push.md b/docs/examples/1.6.x/server-php/examples/messaging/create-push.md index 7838576df0..9aaf6ad4ad 100644 --- a/docs/examples/1.6.x/server-php/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-php/examples/messaging/create-push.md @@ -12,8 +12,8 @@ $messaging = new Messaging($client); $result = $messaging->createPush( messageId: '<MESSAGE_ID>', - title: '<TITLE>', - body: '<BODY>', + title: '<TITLE>', // optional + body: '<BODY>', // optional topics: [], // optional users: [], // optional targets: [], // optional @@ -24,7 +24,10 @@ $result = $messaging->createPush( sound: '<SOUND>', // optional color: '<COLOR>', // optional tag: '<TAG>', // optional - badge: '<BADGE>', // optional + badge: null, // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-php/examples/messaging/update-push.md b/docs/examples/1.6.x/server-php/examples/messaging/update-push.md index 09a4d96042..7546fc8668 100644 --- a/docs/examples/1.6.x/server-php/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-php/examples/messaging/update-push.md @@ -26,5 +26,8 @@ $result = $messaging->updatePush( tag: '<TAG>', // optional badge: null, // optional draft: false, // optional - scheduledAt: '' // optional + scheduledAt: '', // optional + contentAvailable: false, // optional + critical: false, // optional + priority: MessagePriority::NORMAL() // optional ); \ No newline at end of file diff --git a/docs/examples/1.6.x/server-python/examples/account/create-anonymous-session.md b/docs/examples/1.6.x/server-python/examples/account/create-anonymous-session.md index 36ed47de01..ce5a92ad18 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-anonymous-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-anonymous-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-email-password-session.md b/docs/examples/1.6.x/server-python/examples/account/create-email-password-session.md index b85cc3d365..5e869fd40c 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-email-password-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-email-password-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-email-token.md b/docs/examples/1.6.x/server-python/examples/account/create-email-token.md index 4c18324ef3..5cf2bfb085 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-email-token.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-email-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-j-w-t.md b/docs/examples/1.6.x/server-python/examples/account/create-j-w-t.md index 2121514562..c737f1b8e9 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-j-w-t.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-magic-u-r-l-token.md b/docs/examples/1.6.x/server-python/examples/account/create-magic-u-r-l-token.md index c0154182e6..00778172bb 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-magic-u-r-l-token.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-magic-u-r-l-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-mfa-authenticator.md b/docs/examples/1.6.x/server-python/examples/account/create-mfa-authenticator.md index 16a8e2ebae..a6f09eb4f0 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/account/create-mfa-challenge.md b/docs/examples/1.6.x/server-python/examples/account/create-mfa-challenge.md index 017fdd28cc..deb4c9c600 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-mfa-challenge.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticationFactor client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/account/create-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/account/create-mfa-recovery-codes.md index 452b47f72f..a149cb95b7 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-o-auth2token.md b/docs/examples/1.6.x/server-python/examples/account/create-o-auth2token.md index 0cc89df216..fa11d31c31 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-o-auth2token.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-o-auth2token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import OAuthProvider client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/account/create-phone-token.md b/docs/examples/1.6.x/server-python/examples/account/create-phone-token.md index 30c80df6be..d242d71bc1 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-phone-token.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-phone-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-phone-verification.md b/docs/examples/1.6.x/server-python/examples/account/create-phone-verification.md index fd0a2620aa..bb2058eb2a 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-phone-verification.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-recovery.md b/docs/examples/1.6.x/server-python/examples/account/create-recovery.md index e9613cd947..3d215a400e 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-recovery.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-session.md b/docs/examples/1.6.x/server-python/examples/account/create-session.md index d129e1000c..d00e8cb899 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create-verification.md b/docs/examples/1.6.x/server-python/examples/account/create-verification.md index 5ff238f674..329d19e6fd 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create-verification.md +++ b/docs/examples/1.6.x/server-python/examples/account/create-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/create.md b/docs/examples/1.6.x/server-python/examples/account/create.md index 33b6f3fe23..39b33c62ee 100644 --- a/docs/examples/1.6.x/server-python/examples/account/create.md +++ b/docs/examples/1.6.x/server-python/examples/account/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/delete-identity.md b/docs/examples/1.6.x/server-python/examples/account/delete-identity.md index ef57289443..3556122de8 100644 --- a/docs/examples/1.6.x/server-python/examples/account/delete-identity.md +++ b/docs/examples/1.6.x/server-python/examples/account/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/delete-mfa-authenticator.md b/docs/examples/1.6.x/server-python/examples/account/delete-mfa-authenticator.md index 0fbe8c7475..939ea718c7 100644 --- a/docs/examples/1.6.x/server-python/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-python/examples/account/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/account/delete-session.md b/docs/examples/1.6.x/server-python/examples/account/delete-session.md index fa0049c6e4..9ddb4431d3 100644 --- a/docs/examples/1.6.x/server-python/examples/account/delete-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/delete-sessions.md b/docs/examples/1.6.x/server-python/examples/account/delete-sessions.md index 6ebe286c89..751ab9bb2d 100644 --- a/docs/examples/1.6.x/server-python/examples/account/delete-sessions.md +++ b/docs/examples/1.6.x/server-python/examples/account/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/get-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/account/get-mfa-recovery-codes.md index ec705952b2..f70b968274 100644 --- a/docs/examples/1.6.x/server-python/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/account/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/get-prefs.md b/docs/examples/1.6.x/server-python/examples/account/get-prefs.md index 67d0741733..52df6450dc 100644 --- a/docs/examples/1.6.x/server-python/examples/account/get-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/account/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/get-session.md b/docs/examples/1.6.x/server-python/examples/account/get-session.md index f7ae72d69e..f38466fb34 100644 --- a/docs/examples/1.6.x/server-python/examples/account/get-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/get-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/get.md b/docs/examples/1.6.x/server-python/examples/account/get.md index 9ded8e96cb..b414047e2d 100644 --- a/docs/examples/1.6.x/server-python/examples/account/get.md +++ b/docs/examples/1.6.x/server-python/examples/account/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/list-identities.md b/docs/examples/1.6.x/server-python/examples/account/list-identities.md index c51da2cb67..4bf9beb1b2 100644 --- a/docs/examples/1.6.x/server-python/examples/account/list-identities.md +++ b/docs/examples/1.6.x/server-python/examples/account/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/list-logs.md b/docs/examples/1.6.x/server-python/examples/account/list-logs.md index 750f97716a..5d8c27aded 100644 --- a/docs/examples/1.6.x/server-python/examples/account/list-logs.md +++ b/docs/examples/1.6.x/server-python/examples/account/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/list-mfa-factors.md b/docs/examples/1.6.x/server-python/examples/account/list-mfa-factors.md index 2220475b9f..ba3796bf65 100644 --- a/docs/examples/1.6.x/server-python/examples/account/list-mfa-factors.md +++ b/docs/examples/1.6.x/server-python/examples/account/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/list-sessions.md b/docs/examples/1.6.x/server-python/examples/account/list-sessions.md index b3427c09ce..74733138cd 100644 --- a/docs/examples/1.6.x/server-python/examples/account/list-sessions.md +++ b/docs/examples/1.6.x/server-python/examples/account/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-email.md b/docs/examples/1.6.x/server-python/examples/account/update-email.md index b0a2a16002..004d071da1 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-email.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-m-f-a.md b/docs/examples/1.6.x/server-python/examples/account/update-m-f-a.md index 561e7cc431..2f9321c485 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-m-f-a.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-m-f-a.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-magic-u-r-l-session.md b/docs/examples/1.6.x/server-python/examples/account/update-magic-u-r-l-session.md index f6b69b03cc..ca8e8e51a3 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-magic-u-r-l-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-magic-u-r-l-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-mfa-authenticator.md b/docs/examples/1.6.x/server-python/examples/account/update-mfa-authenticator.md index 42b91f1d46..a5a951906c 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/account/update-mfa-challenge.md b/docs/examples/1.6.x/server-python/examples/account/update-mfa-challenge.md index 5964df42f8..d28a2518d7 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-mfa-challenge.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-mfa-challenge.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/account/update-mfa-recovery-codes.md index 4f0b1362a0..38cb41ca8d 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-name.md b/docs/examples/1.6.x/server-python/examples/account/update-name.md index d0027a8400..9b4bf8291d 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-name.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-password.md b/docs/examples/1.6.x/server-python/examples/account/update-password.md index 888349e207..ecb4228df0 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-password.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-phone-session.md b/docs/examples/1.6.x/server-python/examples/account/update-phone-session.md index 404d2b458c..d29ab28e39 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-phone-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-phone-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-phone-verification.md b/docs/examples/1.6.x/server-python/examples/account/update-phone-verification.md index 41ceb4bc05..e64d79f6bd 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-phone-verification.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-phone.md b/docs/examples/1.6.x/server-python/examples/account/update-phone.md index b7414e613e..65a6a387b3 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-phone.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-prefs.md b/docs/examples/1.6.x/server-python/examples/account/update-prefs.md index f69dc12b33..c3683007b7 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-recovery.md b/docs/examples/1.6.x/server-python/examples/account/update-recovery.md index a3314134e6..2493dc5e53 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-recovery.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-recovery.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-session.md b/docs/examples/1.6.x/server-python/examples/account/update-session.md index 3768326e98..ee3a2f7543 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-session.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-status.md b/docs/examples/1.6.x/server-python/examples/account/update-status.md index 4f9add80f7..c8318a43ce 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-status.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/account/update-verification.md b/docs/examples/1.6.x/server-python/examples/account/update-verification.md index 35faf53cb8..63a7f26322 100644 --- a/docs/examples/1.6.x/server-python/examples/account/update-verification.md +++ b/docs/examples/1.6.x/server-python/examples/account/update-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.account import Account client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-browser.md b/docs/examples/1.6.x/server-python/examples/avatars/get-browser.md index 91dde3bbb8..7ed831835f 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-browser.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-browser.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Browser client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-credit-card.md b/docs/examples/1.6.x/server-python/examples/avatars/get-credit-card.md index cec2f61a20..aa66b86b2d 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-credit-card.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-credit-card.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import CreditCard client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-favicon.md b/docs/examples/1.6.x/server-python/examples/avatars/get-favicon.md index 4aa0177a26..2c6a67e2f2 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-favicon.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-favicon.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-flag.md b/docs/examples/1.6.x/server-python/examples/avatars/get-flag.md index 6b12dac6be..435c8550f7 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-flag.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-flag.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars from appwrite.enums import Flag client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-image.md b/docs/examples/1.6.x/server-python/examples/avatars/get-image.md index 202955c2fc..ee9e0cb15e 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-image.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-image.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-initials.md b/docs/examples/1.6.x/server-python/examples/avatars/get-initials.md index 233da1b131..edcbbb33ec 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-initials.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-initials.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/avatars/get-q-r.md b/docs/examples/1.6.x/server-python/examples/avatars/get-q-r.md index 12963947d2..7f6da32ddf 100644 --- a/docs/examples/1.6.x/server-python/examples/avatars/get-q-r.md +++ b/docs/examples/1.6.x/server-python/examples/avatars/get-q-r.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.avatars import Avatars client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-boolean-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-boolean-attribute.md index 183a2b6487..2b4209db9d 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-boolean-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-collection.md b/docs/examples/1.6.x/server-python/examples/databases/create-collection.md index fd9e3a6c0c..99c44a2f9f 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-collection.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-datetime-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-datetime-attribute.md index 7435742e1c..db81c021e2 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-datetime-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-document.md b/docs/examples/1.6.x/server-python/examples/databases/create-document.md index bd3993f162..22f2c07396 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-document.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-email-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-email-attribute.md index f4b427e294..2e28e0bfff 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-email-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-enum-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-enum-attribute.md index dce63558da..b1efdc7dc3 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-enum-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-float-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-float-attribute.md index a658bd8f4c..b36863b8ee 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-float-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-index.md b/docs/examples/1.6.x/server-python/examples/databases/create-index.md index 015b762bbc..9885c06e95 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-index.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import IndexType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-integer-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-integer-attribute.md index 9f409e484e..8cb140a7b9 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-integer-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-ip-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-ip-attribute.md index ab4d357447..d4b4ab6528 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-ip-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-relationship-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-relationship-attribute.md index 76b5db1c45..4172c27249 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-relationship-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases from appwrite.enums import RelationshipType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-string-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-string-attribute.md index d6f7f94627..e69687124d 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-string-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create-url-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/create-url-attribute.md index 3b105d80e8..4ad03c4010 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create-url-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/create.md b/docs/examples/1.6.x/server-python/examples/databases/create.md index a4ddc92cc6..d5cbb99eed 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/create.md +++ b/docs/examples/1.6.x/server-python/examples/databases/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/delete-attribute.md index 7f490b2350..b317ba9dd4 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/delete-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/delete-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete-collection.md b/docs/examples/1.6.x/server-python/examples/databases/delete-collection.md index c3083a51bc..ab274c6bdf 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/delete-collection.md +++ b/docs/examples/1.6.x/server-python/examples/databases/delete-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete-document.md b/docs/examples/1.6.x/server-python/examples/databases/delete-document.md index c3e296aef2..69151aad9e 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/delete-document.md +++ b/docs/examples/1.6.x/server-python/examples/databases/delete-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete-index.md b/docs/examples/1.6.x/server-python/examples/databases/delete-index.md index d5a12c140e..2ed0165b36 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/delete-index.md +++ b/docs/examples/1.6.x/server-python/examples/databases/delete-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/delete.md b/docs/examples/1.6.x/server-python/examples/databases/delete.md index 41d5f18f8a..e7e988a9a5 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/delete.md +++ b/docs/examples/1.6.x/server-python/examples/databases/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/get-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/get-attribute.md index e505fe9a38..a717552659 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/get-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/get-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/get-collection.md b/docs/examples/1.6.x/server-python/examples/databases/get-collection.md index 7be57ea193..f63298ebed 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/get-collection.md +++ b/docs/examples/1.6.x/server-python/examples/databases/get-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/get-document.md b/docs/examples/1.6.x/server-python/examples/databases/get-document.md index 83faadec38..acdc25de7e 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/get-document.md +++ b/docs/examples/1.6.x/server-python/examples/databases/get-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/get-index.md b/docs/examples/1.6.x/server-python/examples/databases/get-index.md index 6038868b41..ca5a9958ad 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/get-index.md +++ b/docs/examples/1.6.x/server-python/examples/databases/get-index.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/get.md b/docs/examples/1.6.x/server-python/examples/databases/get.md index 8fe2358be7..deadf6ab41 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/get.md +++ b/docs/examples/1.6.x/server-python/examples/databases/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/list-attributes.md b/docs/examples/1.6.x/server-python/examples/databases/list-attributes.md index a29aefa015..245ec60c19 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/list-attributes.md +++ b/docs/examples/1.6.x/server-python/examples/databases/list-attributes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/list-collections.md b/docs/examples/1.6.x/server-python/examples/databases/list-collections.md index 0e613321c2..ca18267250 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/list-collections.md +++ b/docs/examples/1.6.x/server-python/examples/databases/list-collections.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/list-documents.md b/docs/examples/1.6.x/server-python/examples/databases/list-documents.md index dee130e65f..41f0380e15 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/list-documents.md +++ b/docs/examples/1.6.x/server-python/examples/databases/list-documents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/list-indexes.md b/docs/examples/1.6.x/server-python/examples/databases/list-indexes.md index 40578a14de..bf18bd1c95 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/list-indexes.md +++ b/docs/examples/1.6.x/server-python/examples/databases/list-indexes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/list.md b/docs/examples/1.6.x/server-python/examples/databases/list.md index aa934b2b12..11669b3453 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/list.md +++ b/docs/examples/1.6.x/server-python/examples/databases/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-boolean-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-boolean-attribute.md index 553d94b109..c9300ea57d 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-boolean-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-boolean-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-collection.md b/docs/examples/1.6.x/server-python/examples/databases/update-collection.md index 3432b6bf18..d9297285ee 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-collection.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-collection.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-datetime-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-datetime-attribute.md index f9056d2c39..96c7fb5439 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-datetime-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-datetime-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-document.md b/docs/examples/1.6.x/server-python/examples/databases/update-document.md index 07bba7678c..7b9cce9513 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-document.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-document.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-email-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-email-attribute.md index 45a8d0d9bc..5b042d4b72 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-email-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-email-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-enum-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-enum-attribute.md index c07f3754d8..caa1b4ecdb 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-enum-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-enum-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-float-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-float-attribute.md index fa1767e893..8f8a35a2c8 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-float-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-float-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-integer-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-integer-attribute.md index 0db97070ed..125cf825bf 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-integer-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-integer-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-ip-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-ip-attribute.md index 135dbd82ea..a2b8bad201 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-ip-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-ip-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-relationship-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-relationship-attribute.md index bc528f17dd..0aacc139a0 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-relationship-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-relationship-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-string-attribute.md index bbe7ddb19f..c85eb25f59 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-string-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -13,6 +14,6 @@ result = databases.update_string_attribute( key = '', required = False, default = '<DEFAULT>', - size = None, # optional + size = 1, # optional new_key = '' # optional ) diff --git a/docs/examples/1.6.x/server-python/examples/databases/update-url-attribute.md b/docs/examples/1.6.x/server-python/examples/databases/update-url-attribute.md index 8e3a28de1f..53da6ae45f 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update-url-attribute.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update-url-attribute.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/databases/update.md b/docs/examples/1.6.x/server-python/examples/databases/update.md index 765f28a3fc..da59776b3e 100644 --- a/docs/examples/1.6.x/server-python/examples/databases/update.md +++ b/docs/examples/1.6.x/server-python/examples/databases/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.databases import Databases client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/create-build.md b/docs/examples/1.6.x/server-python/examples/functions/create-build.md index c4eb9d0a20..ce2ffb72f5 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/create-build.md +++ b/docs/examples/1.6.x/server-python/examples/functions/create-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/create-deployment.md b/docs/examples/1.6.x/server-python/examples/functions/create-deployment.md index da9b559b2f..c86fdf679d 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/create-deployment.md +++ b/docs/examples/1.6.x/server-python/examples/functions/create-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/functions/create-execution.md b/docs/examples/1.6.x/server-python/examples/functions/create-execution.md index e1decb9755..cb3fddd02b 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/create-execution.md +++ b/docs/examples/1.6.x/server-python/examples/functions/create-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/create-variable.md b/docs/examples/1.6.x/server-python/examples/functions/create-variable.md index cd73e30c03..101ecdf315 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/create-variable.md +++ b/docs/examples/1.6.x/server-python/examples/functions/create-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/create.md b/docs/examples/1.6.x/server-python/examples/functions/create.md index a65b87dd4c..f10a953ca8 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/create.md +++ b/docs/examples/1.6.x/server-python/examples/functions/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions from appwrite.enums import client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/functions/delete-deployment.md b/docs/examples/1.6.x/server-python/examples/functions/delete-deployment.md index 780ce9d7c8..f98bd60a9b 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/delete-deployment.md +++ b/docs/examples/1.6.x/server-python/examples/functions/delete-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/delete-execution.md b/docs/examples/1.6.x/server-python/examples/functions/delete-execution.md index 7c3ea09a0f..b723fd6c47 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/delete-execution.md +++ b/docs/examples/1.6.x/server-python/examples/functions/delete-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/delete-variable.md b/docs/examples/1.6.x/server-python/examples/functions/delete-variable.md index 646a0f325b..e17afed363 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/delete-variable.md +++ b/docs/examples/1.6.x/server-python/examples/functions/delete-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/delete.md b/docs/examples/1.6.x/server-python/examples/functions/delete.md index 2950ed0235..a34d476744 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/delete.md +++ b/docs/examples/1.6.x/server-python/examples/functions/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/get-deployment-download.md b/docs/examples/1.6.x/server-python/examples/functions/get-deployment-download.md index 490d9521df..90f029aff5 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/get-deployment-download.md +++ b/docs/examples/1.6.x/server-python/examples/functions/get-deployment-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/get-deployment.md b/docs/examples/1.6.x/server-python/examples/functions/get-deployment.md index 8846888f0f..0617b0429c 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/get-deployment.md +++ b/docs/examples/1.6.x/server-python/examples/functions/get-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/get-execution.md b/docs/examples/1.6.x/server-python/examples/functions/get-execution.md index f3dfc0f4ee..0a9a347409 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/get-execution.md +++ b/docs/examples/1.6.x/server-python/examples/functions/get-execution.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/get-variable.md b/docs/examples/1.6.x/server-python/examples/functions/get-variable.md index fd903f3045..174c8b27bf 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/get-variable.md +++ b/docs/examples/1.6.x/server-python/examples/functions/get-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/get.md b/docs/examples/1.6.x/server-python/examples/functions/get.md index cb765e42a1..a463fa6b28 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/get.md +++ b/docs/examples/1.6.x/server-python/examples/functions/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list-deployments.md b/docs/examples/1.6.x/server-python/examples/functions/list-deployments.md index f776345f11..4d8feea927 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list-deployments.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list-deployments.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list-executions.md b/docs/examples/1.6.x/server-python/examples/functions/list-executions.md index 0012bafc8f..293bab047a 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list-executions.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list-executions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list-runtimes.md b/docs/examples/1.6.x/server-python/examples/functions/list-runtimes.md index edad1a9178..b6247330d0 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list-runtimes.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list-runtimes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list-specifications.md b/docs/examples/1.6.x/server-python/examples/functions/list-specifications.md index a9c7417654..5e1ec7fd61 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list-specifications.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list-specifications.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list-variables.md b/docs/examples/1.6.x/server-python/examples/functions/list-variables.md index 188c17bb6a..ee1a516c5e 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list-variables.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list-variables.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/list.md b/docs/examples/1.6.x/server-python/examples/functions/list.md index 5b315e18cc..0b5f18d70a 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/list.md +++ b/docs/examples/1.6.x/server-python/examples/functions/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/update-deployment-build.md b/docs/examples/1.6.x/server-python/examples/functions/update-deployment-build.md index a8d93b8416..c69cd7c181 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/update-deployment-build.md +++ b/docs/examples/1.6.x/server-python/examples/functions/update-deployment-build.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/update-deployment.md b/docs/examples/1.6.x/server-python/examples/functions/update-deployment.md index 9fce384715..0f4c96e85c 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/update-deployment.md +++ b/docs/examples/1.6.x/server-python/examples/functions/update-deployment.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/update-variable.md b/docs/examples/1.6.x/server-python/examples/functions/update-variable.md index 238fc91eff..bcab3685a2 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/update-variable.md +++ b/docs/examples/1.6.x/server-python/examples/functions/update-variable.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/functions/update.md b/docs/examples/1.6.x/server-python/examples/functions/update.md index 5f2a70baaa..a7282412cc 100644 --- a/docs/examples/1.6.x/server-python/examples/functions/update.md +++ b/docs/examples/1.6.x/server-python/examples/functions/update.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.functions import Functions client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/graphql/mutation.md b/docs/examples/1.6.x/server-python/examples/graphql/mutation.md index 0ec3d3eefc..e05f602719 100644 --- a/docs/examples/1.6.x/server-python/examples/graphql/mutation.md +++ b/docs/examples/1.6.x/server-python/examples/graphql/mutation.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/graphql/query.md b/docs/examples/1.6.x/server-python/examples/graphql/query.md index 95709fd694..c8f3c78a1a 100644 --- a/docs/examples/1.6.x/server-python/examples/graphql/query.md +++ b/docs/examples/1.6.x/server-python/examples/graphql/query.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.graphql import Graphql client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-antivirus.md b/docs/examples/1.6.x/server-python/examples/health/get-antivirus.md index ff93ceac76..7bc0475abf 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-antivirus.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-antivirus.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-cache.md b/docs/examples/1.6.x/server-python/examples/health/get-cache.md index fa2a6daa5c..7e69825ecf 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-cache.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-cache.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-certificate.md b/docs/examples/1.6.x/server-python/examples/health/get-certificate.md index 2a73583361..f6a713e2f3 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-certificate.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-certificate.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-d-b.md b/docs/examples/1.6.x/server-python/examples/health/get-d-b.md index 18e3968246..a23a073ac7 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-d-b.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-d-b.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-failed-jobs.md b/docs/examples/1.6.x/server-python/examples/health/get-failed-jobs.md index ce33c8c9bd..d0fe64f7f3 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-failed-jobs.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-failed-jobs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health from appwrite.enums import client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/health/get-pub-sub.md b/docs/examples/1.6.x/server-python/examples/health/get-pub-sub.md index db66c7f676..109b2889f6 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-pub-sub.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-pub-sub.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-builds.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-builds.md index 9daed589f8..b1d4d62116 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-builds.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-builds.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-certificates.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-certificates.md index a7d35bc9f4..99f52b8eda 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-certificates.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-certificates.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-databases.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-databases.md index 50f8943fa6..7d5e5a0c58 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-databases.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-databases.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-deletes.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-deletes.md index b6e6a4d4a4..d677af582e 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-deletes.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-deletes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-functions.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-functions.md index 5868b3cd68..3ffc4b8f52 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-functions.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-functions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-logs.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-logs.md index 254fe23331..0cb6417f4f 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-logs.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-mails.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-mails.md index c6ab409c9b..97a501cc1c 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-mails.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-mails.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-messaging.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-messaging.md index 1007913866..ea93eab6dc 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-messaging.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-messaging.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-migrations.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-migrations.md index db59028f37..09e35dfa9d 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-migrations.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-migrations.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-usage-dump.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-usage-dump.md index cc31b4f5af..dabb79ae96 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-usage-dump.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-usage-dump.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-usage.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-usage.md index 67d9e64c14..dbee75fce0 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-usage.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-usage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue-webhooks.md b/docs/examples/1.6.x/server-python/examples/health/get-queue-webhooks.md index 918846738d..1072a20def 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue-webhooks.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue-webhooks.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-queue.md b/docs/examples/1.6.x/server-python/examples/health/get-queue.md index 61e5a40caa..aafe7c7dd0 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-queue.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-queue.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-storage-local.md b/docs/examples/1.6.x/server-python/examples/health/get-storage-local.md index 276c3058f9..d3b94b2177 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-storage-local.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-storage-local.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-storage.md b/docs/examples/1.6.x/server-python/examples/health/get-storage.md index b2de63b72f..65af2f959d 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-storage.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-storage.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get-time.md b/docs/examples/1.6.x/server-python/examples/health/get-time.md index 40893057cb..d63beb988b 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get-time.md +++ b/docs/examples/1.6.x/server-python/examples/health/get-time.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/health/get.md b/docs/examples/1.6.x/server-python/examples/health/get.md index f41e0e3a9b..f5c494e12d 100644 --- a/docs/examples/1.6.x/server-python/examples/health/get.md +++ b/docs/examples/1.6.x/server-python/examples/health/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.health import Health client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/get.md b/docs/examples/1.6.x/server-python/examples/locale/get.md index fc048ddcc9..a44f4974ac 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/get.md +++ b/docs/examples/1.6.x/server-python/examples/locale/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-codes.md b/docs/examples/1.6.x/server-python/examples/locale/list-codes.md index d516538cb9..12cd12ee70 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-codes.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-continents.md b/docs/examples/1.6.x/server-python/examples/locale/list-continents.md index f6d8495527..ea4ac5312d 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-continents.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-continents.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-countries-e-u.md b/docs/examples/1.6.x/server-python/examples/locale/list-countries-e-u.md index 8bdac2e5e3..7fb6aaa59e 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-countries-e-u.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-countries-e-u.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-countries-phones.md b/docs/examples/1.6.x/server-python/examples/locale/list-countries-phones.md index 516d822b59..aafdb3d547 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-countries-phones.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-countries-phones.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-countries.md b/docs/examples/1.6.x/server-python/examples/locale/list-countries.md index 8fcbe1aeb9..a2f1ec458d 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-countries.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-countries.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-currencies.md b/docs/examples/1.6.x/server-python/examples/locale/list-currencies.md index 4708498efb..39267c663c 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-currencies.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-currencies.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/locale/list-languages.md b/docs/examples/1.6.x/server-python/examples/locale/list-languages.md index 9583cd8b3f..6dec1b9072 100644 --- a/docs/examples/1.6.x/server-python/examples/locale/list-languages.md +++ b/docs/examples/1.6.x/server-python/examples/locale/list-languages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.locale import Locale client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-apns-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-apns-provider.md index 022209d1e6..700e909c44 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-apns-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-email.md b/docs/examples/1.6.x/server-python/examples/messaging/create-email.md index 38005a3736..92353e22c2 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-email.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-fcm-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-fcm-provider.md index 84c38eae98..d13ba0213d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-fcm-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-mailgun-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-mailgun-provider.md index fa94da96c9..83899716d7 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-msg91provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-msg91provider.md index 0cffc4e491..117c46edca 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-msg91provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-push.md b/docs/examples/1.6.x/server-python/examples/messaging/create-push.md index ffed825a3d..d4051859df 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -9,8 +10,8 @@ messaging = Messaging(client) result = messaging.create_push( message_id = '<MESSAGE_ID>', - title = '<TITLE>', - body = '<BODY>', + title = '<TITLE>', # optional + body = '<BODY>', # optional topics = [], # optional users = [], # optional targets = [], # optional @@ -21,7 +22,10 @@ result = messaging.create_push( sound = '<SOUND>', # optional color = '<COLOR>', # optional tag = '<TAG>', # optional - badge = '<BADGE>', # optional + badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-sendgrid-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-sendgrid-provider.md index 6e9b812736..5d20cde78d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-sms.md b/docs/examples/1.6.x/server-python/examples/messaging/create-sms.md index c3e7fe70bf..c7e66d8c75 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-sms.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-smtp-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-smtp-provider.md index 24108d251f..85c58236c0 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-smtp-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-subscriber.md b/docs/examples/1.6.x/server-python/examples/messaging/create-subscriber.md index 81b0c5f468..cb8f4f748d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-subscriber.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-telesign-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-telesign-provider.md index b06033c5c5..b602213b78 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-telesign-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-textmagic-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-textmagic-provider.md index 6dc1030cd3..03287e8fac 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-topic.md b/docs/examples/1.6.x/server-python/examples/messaging/create-topic.md index b0184b53b4..4dd16da3f0 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-topic.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-twilio-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-twilio-provider.md index c73e941945..524348f085 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-twilio-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/create-vonage-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/create-vonage-provider.md index cfee0ad7a4..68416bd8c3 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/create-vonage-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/create-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/delete-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/delete-provider.md index 4d2bd6d015..2a1840d64d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/delete-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/delete-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/delete-subscriber.md b/docs/examples/1.6.x/server-python/examples/messaging/delete-subscriber.md index 5d404d1875..94085ef86b 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/delete-subscriber.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/delete-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/delete-topic.md b/docs/examples/1.6.x/server-python/examples/messaging/delete-topic.md index b270b2a708..1c2f5635da 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/delete-topic.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/delete-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/delete.md b/docs/examples/1.6.x/server-python/examples/messaging/delete.md index c62c8c0d21..aee928a792 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/delete.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/get-message.md b/docs/examples/1.6.x/server-python/examples/messaging/get-message.md index 4b4ef39203..9e32d80623 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/get-message.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/get-message.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/get-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/get-provider.md index fdf94f0304..6bc85f2710 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/get-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/get-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/get-subscriber.md b/docs/examples/1.6.x/server-python/examples/messaging/get-subscriber.md index 7f8284f874..43185d7eb3 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/get-subscriber.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/get-subscriber.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/get-topic.md b/docs/examples/1.6.x/server-python/examples/messaging/get-topic.md index 57c465b883..dea6cbfb6b 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/get-topic.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/get-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-message-logs.md b/docs/examples/1.6.x/server-python/examples/messaging/list-message-logs.md index 752e449806..1c2ab0b035 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-message-logs.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-message-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-messages.md b/docs/examples/1.6.x/server-python/examples/messaging/list-messages.md index 7219f0948e..8457f99ad5 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-messages.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-messages.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-provider-logs.md b/docs/examples/1.6.x/server-python/examples/messaging/list-provider-logs.md index 148814c46d..c8544fac1e 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-provider-logs.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-provider-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-providers.md b/docs/examples/1.6.x/server-python/examples/messaging/list-providers.md index 3e896954e4..258e7cd6e1 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-providers.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-providers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-subscriber-logs.md b/docs/examples/1.6.x/server-python/examples/messaging/list-subscriber-logs.md index 7efaeadedf..d2049bd560 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-subscriber-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-subscribers.md b/docs/examples/1.6.x/server-python/examples/messaging/list-subscribers.md index fe2442d806..ba9e09d8b9 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-subscribers.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-subscribers.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-targets.md b/docs/examples/1.6.x/server-python/examples/messaging/list-targets.md index 062257154c..b941ccbd31 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-targets.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-topic-logs.md b/docs/examples/1.6.x/server-python/examples/messaging/list-topic-logs.md index de72a76a27..57ba7f8d31 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-topic-logs.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-topic-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/list-topics.md b/docs/examples/1.6.x/server-python/examples/messaging/list-topics.md index 1379708965..cb21567d42 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/list-topics.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/list-topics.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-apns-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-apns-provider.md index 2bfd3edfc1..3f0205d4ce 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-apns-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-apns-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-email.md b/docs/examples/1.6.x/server-python/examples/messaging/update-email.md index 6cff0ae6d8..b8f9d719c1 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-email.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-fcm-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-fcm-provider.md index 7ca9f381e6..862e579f53 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-fcm-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-fcm-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-mailgun-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-mailgun-provider.md index a89338df92..aa1d4e922c 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-mailgun-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-msg91provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-msg91provider.md index 4c61950050..2d4efdbd78 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-msg91provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-msg91provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-push.md b/docs/examples/1.6.x/server-python/examples/messaging/update-push.md index 3c3965c3bd..12663533c3 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-push.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint @@ -23,5 +24,8 @@ result = messaging.update_push( tag = '<TAG>', # optional badge = None, # optional draft = False, # optional - scheduled_at = '' # optional + scheduled_at = '', # optional + content_available = False, # optional + critical = False, # optional + priority = MessagePriority.NORMAL # optional ) diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-sendgrid-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-sendgrid-provider.md index 8b67b7a44f..e528bd543d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-sendgrid-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-sms.md b/docs/examples/1.6.x/server-python/examples/messaging/update-sms.md index aadbd9aee8..7cb008736f 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-sms.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-sms.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-smtp-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-smtp-provider.md index 74232e983f..2d798d4e0e 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-smtp-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-smtp-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-telesign-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-telesign-provider.md index 264928178b..91de1f155c 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-telesign-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-telesign-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-textmagic-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-textmagic-provider.md index bbe4a93a50..c3031047c9 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-textmagic-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-topic.md b/docs/examples/1.6.x/server-python/examples/messaging/update-topic.md index ee4d00411e..160ac26b6b 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-topic.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-topic.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-twilio-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-twilio-provider.md index 52eed3bb7b..865fcb5c1d 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-twilio-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-twilio-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/messaging/update-vonage-provider.md b/docs/examples/1.6.x/server-python/examples/messaging/update-vonage-provider.md index 7cb1594a81..8e01128bf2 100644 --- a/docs/examples/1.6.x/server-python/examples/messaging/update-vonage-provider.md +++ b/docs/examples/1.6.x/server-python/examples/messaging/update-vonage-provider.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.messaging import Messaging client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/create-bucket.md b/docs/examples/1.6.x/server-python/examples/storage/create-bucket.md index c6e9e33e02..7e321f12a3 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/create-bucket.md +++ b/docs/examples/1.6.x/server-python/examples/storage/create-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/create-file.md b/docs/examples/1.6.x/server-python/examples/storage/create-file.md index d275070bac..fa0b117b01 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/create-file.md +++ b/docs/examples/1.6.x/server-python/examples/storage/create-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage from appwrite.input_file import InputFile client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/storage/delete-bucket.md b/docs/examples/1.6.x/server-python/examples/storage/delete-bucket.md index 77d72eb915..8cddfb9202 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/delete-bucket.md +++ b/docs/examples/1.6.x/server-python/examples/storage/delete-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/delete-file.md b/docs/examples/1.6.x/server-python/examples/storage/delete-file.md index 775065dc38..08bba5ca4b 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/delete-file.md +++ b/docs/examples/1.6.x/server-python/examples/storage/delete-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/get-bucket.md b/docs/examples/1.6.x/server-python/examples/storage/get-bucket.md index adb78e8b92..79f903f244 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/get-bucket.md +++ b/docs/examples/1.6.x/server-python/examples/storage/get-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/get-file-download.md b/docs/examples/1.6.x/server-python/examples/storage/get-file-download.md index b419ea0164..1a82b26c70 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/get-file-download.md +++ b/docs/examples/1.6.x/server-python/examples/storage/get-file-download.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/get-file-preview.md b/docs/examples/1.6.x/server-python/examples/storage/get-file-preview.md index 2e3b2acdc6..40f32f1f10 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/get-file-preview.md +++ b/docs/examples/1.6.x/server-python/examples/storage/get-file-preview.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/get-file-view.md b/docs/examples/1.6.x/server-python/examples/storage/get-file-view.md index 9ce04e2a49..3947c76761 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/get-file-view.md +++ b/docs/examples/1.6.x/server-python/examples/storage/get-file-view.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/get-file.md b/docs/examples/1.6.x/server-python/examples/storage/get-file.md index 9f04ef4740..0c2d5e3b2c 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/get-file.md +++ b/docs/examples/1.6.x/server-python/examples/storage/get-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/list-buckets.md b/docs/examples/1.6.x/server-python/examples/storage/list-buckets.md index 84eab54286..88540cd5ce 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/list-buckets.md +++ b/docs/examples/1.6.x/server-python/examples/storage/list-buckets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/list-files.md b/docs/examples/1.6.x/server-python/examples/storage/list-files.md index 8a2aa6d9a3..e26ac2e5f3 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/list-files.md +++ b/docs/examples/1.6.x/server-python/examples/storage/list-files.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/update-bucket.md b/docs/examples/1.6.x/server-python/examples/storage/update-bucket.md index 4eea2a9ccb..61388b0923 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/update-bucket.md +++ b/docs/examples/1.6.x/server-python/examples/storage/update-bucket.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/storage/update-file.md b/docs/examples/1.6.x/server-python/examples/storage/update-file.md index 0137af5849..336e8a0846 100644 --- a/docs/examples/1.6.x/server-python/examples/storage/update-file.md +++ b/docs/examples/1.6.x/server-python/examples/storage/update-file.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.storage import Storage client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/create-membership.md b/docs/examples/1.6.x/server-python/examples/teams/create-membership.md index 484629550d..1af9f252ab 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/create-membership.md +++ b/docs/examples/1.6.x/server-python/examples/teams/create-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/create.md b/docs/examples/1.6.x/server-python/examples/teams/create.md index 544ee3a706..7085d39642 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/create.md +++ b/docs/examples/1.6.x/server-python/examples/teams/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/delete-membership.md b/docs/examples/1.6.x/server-python/examples/teams/delete-membership.md index 7f0cbd4ed6..adf065cd3c 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/delete-membership.md +++ b/docs/examples/1.6.x/server-python/examples/teams/delete-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/delete.md b/docs/examples/1.6.x/server-python/examples/teams/delete.md index fc8415238e..762f532dbf 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/delete.md +++ b/docs/examples/1.6.x/server-python/examples/teams/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/get-membership.md b/docs/examples/1.6.x/server-python/examples/teams/get-membership.md index 6075cc70d1..17bacff1d3 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/get-membership.md +++ b/docs/examples/1.6.x/server-python/examples/teams/get-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/get-prefs.md b/docs/examples/1.6.x/server-python/examples/teams/get-prefs.md index d740e69e3b..035777d5cd 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/get-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/teams/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/get.md b/docs/examples/1.6.x/server-python/examples/teams/get.md index 6d44b80ee3..985924e10b 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/get.md +++ b/docs/examples/1.6.x/server-python/examples/teams/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/list-memberships.md b/docs/examples/1.6.x/server-python/examples/teams/list-memberships.md index f7a072a6d8..885a4c2822 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/list-memberships.md +++ b/docs/examples/1.6.x/server-python/examples/teams/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/list.md b/docs/examples/1.6.x/server-python/examples/teams/list.md index afb5de1241..c92d4c9c13 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/list.md +++ b/docs/examples/1.6.x/server-python/examples/teams/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/update-membership-status.md b/docs/examples/1.6.x/server-python/examples/teams/update-membership-status.md index ee6d211081..ae6e524da5 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/update-membership-status.md +++ b/docs/examples/1.6.x/server-python/examples/teams/update-membership-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/update-membership.md b/docs/examples/1.6.x/server-python/examples/teams/update-membership.md index 672615026e..c50f345b88 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/update-membership.md +++ b/docs/examples/1.6.x/server-python/examples/teams/update-membership.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/update-name.md b/docs/examples/1.6.x/server-python/examples/teams/update-name.md index 693654d3d7..d25c8db1f2 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/update-name.md +++ b/docs/examples/1.6.x/server-python/examples/teams/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/teams/update-prefs.md b/docs/examples/1.6.x/server-python/examples/teams/update-prefs.md index 46616011d6..9eca847a02 100644 --- a/docs/examples/1.6.x/server-python/examples/teams/update-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/teams/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.teams import Teams client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-argon2user.md b/docs/examples/1.6.x/server-python/examples/users/create-argon2user.md index 575aa42b30..3d65496573 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-argon2user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-argon2user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-bcrypt-user.md b/docs/examples/1.6.x/server-python/examples/users/create-bcrypt-user.md index f6cd2fe591..76532a98f0 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-bcrypt-user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-bcrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-j-w-t.md b/docs/examples/1.6.x/server-python/examples/users/create-j-w-t.md index a758d4e089..2e1fdf632f 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-j-w-t.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-j-w-t.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-m-d5user.md b/docs/examples/1.6.x/server-python/examples/users/create-m-d5user.md index cabf875938..da9d471fe2 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-m-d5user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-m-d5user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/users/create-mfa-recovery-codes.md index 606878f1e9..a4477b0406 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-p-h-pass-user.md b/docs/examples/1.6.x/server-python/examples/users/create-p-h-pass-user.md index 0d8f9907ac..363be4f92f 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-p-h-pass-user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-p-h-pass-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-s-h-a-user.md b/docs/examples/1.6.x/server-python/examples/users/create-s-h-a-user.md index b0ae799b64..bb78ff7b5c 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-s-h-a-user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-s-h-a-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-scrypt-modified-user.md b/docs/examples/1.6.x/server-python/examples/users/create-scrypt-modified-user.md index d7d17c4de0..1cfbcfc4b4 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-scrypt-user.md b/docs/examples/1.6.x/server-python/examples/users/create-scrypt-user.md index 507fb1f892..2d1e72bf77 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-scrypt-user.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-scrypt-user.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-session.md b/docs/examples/1.6.x/server-python/examples/users/create-session.md index a2ba12a580..bebd46b022 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-session.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create-target.md b/docs/examples/1.6.x/server-python/examples/users/create-target.md index 9ad8364ea3..c11c7ca233 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-target.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import MessagingProviderType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/users/create-token.md b/docs/examples/1.6.x/server-python/examples/users/create-token.md index e2ef2f6969..00a0e78610 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create-token.md +++ b/docs/examples/1.6.x/server-python/examples/users/create-token.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/create.md b/docs/examples/1.6.x/server-python/examples/users/create.md index c3e7fd5558..c8dac9feae 100644 --- a/docs/examples/1.6.x/server-python/examples/users/create.md +++ b/docs/examples/1.6.x/server-python/examples/users/create.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/delete-identity.md b/docs/examples/1.6.x/server-python/examples/users/delete-identity.md index 4c78038d11..85c5b6dee3 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete-identity.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete-identity.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/delete-mfa-authenticator.md b/docs/examples/1.6.x/server-python/examples/users/delete-mfa-authenticator.md index c7101d119f..b22d391879 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete-mfa-authenticator.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users from appwrite.enums import AuthenticatorType client = Client() diff --git a/docs/examples/1.6.x/server-python/examples/users/delete-session.md b/docs/examples/1.6.x/server-python/examples/users/delete-session.md index c0fabdb19c..dda5713a9e 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete-session.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete-session.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/delete-sessions.md b/docs/examples/1.6.x/server-python/examples/users/delete-sessions.md index 328a9eeb2f..268c311dd9 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete-sessions.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/delete-target.md b/docs/examples/1.6.x/server-python/examples/users/delete-target.md index 5c2d9df8d8..38cc5a9a23 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete-target.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/delete.md b/docs/examples/1.6.x/server-python/examples/users/delete.md index de8b35b513..090c20f5a9 100644 --- a/docs/examples/1.6.x/server-python/examples/users/delete.md +++ b/docs/examples/1.6.x/server-python/examples/users/delete.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/get-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/users/get-mfa-recovery-codes.md index b37739ccae..ec9986ce60 100644 --- a/docs/examples/1.6.x/server-python/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/users/get-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/get-prefs.md b/docs/examples/1.6.x/server-python/examples/users/get-prefs.md index 23109a9696..eb14d3acb9 100644 --- a/docs/examples/1.6.x/server-python/examples/users/get-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/users/get-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/get-target.md b/docs/examples/1.6.x/server-python/examples/users/get-target.md index d494460c5e..f549f08450 100644 --- a/docs/examples/1.6.x/server-python/examples/users/get-target.md +++ b/docs/examples/1.6.x/server-python/examples/users/get-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/get.md b/docs/examples/1.6.x/server-python/examples/users/get.md index d7dda45516..6e018c2b00 100644 --- a/docs/examples/1.6.x/server-python/examples/users/get.md +++ b/docs/examples/1.6.x/server-python/examples/users/get.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-identities.md b/docs/examples/1.6.x/server-python/examples/users/list-identities.md index 7764d74268..b10c320cdd 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-identities.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-identities.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-logs.md b/docs/examples/1.6.x/server-python/examples/users/list-logs.md index d1c6b0abb7..10d8ae0d03 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-logs.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-logs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-memberships.md b/docs/examples/1.6.x/server-python/examples/users/list-memberships.md index 27db71f0c7..fbb3b4c05e 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-memberships.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-memberships.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-mfa-factors.md b/docs/examples/1.6.x/server-python/examples/users/list-mfa-factors.md index 39aed0c173..1f40b1f538 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-mfa-factors.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-mfa-factors.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-sessions.md b/docs/examples/1.6.x/server-python/examples/users/list-sessions.md index fd091b9683..a9eead0d78 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-sessions.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-sessions.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list-targets.md b/docs/examples/1.6.x/server-python/examples/users/list-targets.md index b5b67b96e3..47666467ff 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list-targets.md +++ b/docs/examples/1.6.x/server-python/examples/users/list-targets.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/list.md b/docs/examples/1.6.x/server-python/examples/users/list.md index b191f8ae73..4b09ca5f85 100644 --- a/docs/examples/1.6.x/server-python/examples/users/list.md +++ b/docs/examples/1.6.x/server-python/examples/users/list.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-email-verification.md b/docs/examples/1.6.x/server-python/examples/users/update-email-verification.md index 72ddf7a9bd..4623bc34b1 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-email-verification.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-email-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-email.md b/docs/examples/1.6.x/server-python/examples/users/update-email.md index c977d95250..083715bbfa 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-email.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-email.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-labels.md b/docs/examples/1.6.x/server-python/examples/users/update-labels.md index 04c3999305..24c5b27034 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-labels.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-labels.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-mfa-recovery-codes.md b/docs/examples/1.6.x/server-python/examples/users/update-mfa-recovery-codes.md index ca3b96aa8b..d0e4da4e4a 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-mfa-recovery-codes.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-mfa.md b/docs/examples/1.6.x/server-python/examples/users/update-mfa.md index e145f9b259..efd6730a26 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-mfa.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-mfa.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-name.md b/docs/examples/1.6.x/server-python/examples/users/update-name.md index d546b95297..6014ef51a5 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-name.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-name.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-password.md b/docs/examples/1.6.x/server-python/examples/users/update-password.md index 0c7e7bf030..90ac15f565 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-password.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-password.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-phone-verification.md b/docs/examples/1.6.x/server-python/examples/users/update-phone-verification.md index b13c4fba33..a62e6a8ceb 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-phone-verification.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-phone-verification.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-phone.md b/docs/examples/1.6.x/server-python/examples/users/update-phone.md index ecb01728e8..f522730003 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-phone.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-phone.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-prefs.md b/docs/examples/1.6.x/server-python/examples/users/update-prefs.md index ca6999c950..64d9df39f8 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-prefs.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-prefs.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-status.md b/docs/examples/1.6.x/server-python/examples/users/update-status.md index ebec495c33..8943ef59f5 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-status.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-status.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-python/examples/users/update-target.md b/docs/examples/1.6.x/server-python/examples/users/update-target.md index f9bdfb43ef..89513850b0 100644 --- a/docs/examples/1.6.x/server-python/examples/users/update-target.md +++ b/docs/examples/1.6.x/server-python/examples/users/update-target.md @@ -1,4 +1,5 @@ from appwrite.client import Client +from appwrite.services.users import Users client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint diff --git a/docs/examples/1.6.x/server-rest/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-rest/examples/databases/update-string-attribute.md index 197ea2767d..71a5302e1a 100644 --- a/docs/examples/1.6.x/server-rest/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-rest/examples/databases/update-string-attribute.md @@ -8,6 +8,6 @@ X-Appwrite-Key: <YOUR_API_KEY> { "required": false, "default": "<DEFAULT>", - "size": 0, + "size": 1, "newKey": } diff --git a/docs/examples/1.6.x/server-rest/examples/messaging/create-push.md b/docs/examples/1.6.x/server-rest/examples/messaging/create-push.md index 1c7550950b..cf5256d921 100644 --- a/docs/examples/1.6.x/server-rest/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-rest/examples/messaging/create-push.md @@ -19,7 +19,10 @@ X-Appwrite-Key: <YOUR_API_KEY> "sound": "<SOUND>", "color": "<COLOR>", "tag": "<TAG>", - "badge": "<BADGE>", + "badge": 0, "draft": false, - "scheduledAt": + "scheduledAt": , + "contentAvailable": false, + "critical": false, + "priority": "normal" } diff --git a/docs/examples/1.6.x/server-rest/examples/messaging/update-push.md b/docs/examples/1.6.x/server-rest/examples/messaging/update-push.md index 7a0338c74b..2159bc8aa2 100644 --- a/docs/examples/1.6.x/server-rest/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-rest/examples/messaging/update-push.md @@ -20,5 +20,8 @@ X-Appwrite-Key: <YOUR_API_KEY> "tag": "<TAG>", "badge": 0, "draft": false, - "scheduledAt": + "scheduledAt": , + "contentAvailable": false, + "critical": false, + "priority": "normal" } diff --git a/docs/examples/1.6.x/server-ruby/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-ruby/examples/databases/update-string-attribute.md index 3b3c5eb644..5e4ac573dc 100644 --- a/docs/examples/1.6.x/server-ruby/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-ruby/examples/databases/update-string-attribute.md @@ -15,6 +15,6 @@ result = databases.update_string_attribute( key: '', required: false, default: '<DEFAULT>', - size: null, # optional + size: 1, # optional new_key: '' # optional ) diff --git a/docs/examples/1.6.x/server-ruby/examples/messaging/create-push.md b/docs/examples/1.6.x/server-ruby/examples/messaging/create-push.md index 1c6700db43..61663f4dc0 100644 --- a/docs/examples/1.6.x/server-ruby/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-ruby/examples/messaging/create-push.md @@ -11,8 +11,8 @@ messaging = Messaging.new(client) result = messaging.create_push( message_id: '<MESSAGE_ID>', - title: '<TITLE>', - body: '<BODY>', + title: '<TITLE>', # optional + body: '<BODY>', # optional topics: [], # optional users: [], # optional targets: [], # optional @@ -23,7 +23,10 @@ result = messaging.create_push( sound: '<SOUND>', # optional color: '<COLOR>', # optional tag: '<TAG>', # optional - badge: '<BADGE>', # optional + badge: null, # optional draft: false, # optional - scheduled_at: '' # optional + scheduled_at: '', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional ) diff --git a/docs/examples/1.6.x/server-ruby/examples/messaging/update-push.md b/docs/examples/1.6.x/server-ruby/examples/messaging/update-push.md index 54f6368eee..6bf9fcaa79 100644 --- a/docs/examples/1.6.x/server-ruby/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-ruby/examples/messaging/update-push.md @@ -25,5 +25,8 @@ result = messaging.update_push( tag: '<TAG>', # optional badge: null, # optional draft: false, # optional - scheduled_at: '' # optional + scheduled_at: '', # optional + content_available: false, # optional + critical: false, # optional + priority: MessagePriority::NORMAL # optional ) diff --git a/docs/examples/1.6.x/server-swift/examples/databases/update-string-attribute.md b/docs/examples/1.6.x/server-swift/examples/databases/update-string-attribute.md index 5fafd5e72e..d3129dcce2 100644 --- a/docs/examples/1.6.x/server-swift/examples/databases/update-string-attribute.md +++ b/docs/examples/1.6.x/server-swift/examples/databases/update-string-attribute.md @@ -13,7 +13,7 @@ let attributeString = try await databases.updateStringAttribute( key: "", required: false, default: "<DEFAULT>", - size: 0, // optional + size: 1, // optional newKey: "" // optional ) diff --git a/docs/examples/1.6.x/server-swift/examples/messaging/create-push.md b/docs/examples/1.6.x/server-swift/examples/messaging/create-push.md index dbc7bf0ca6..42f48ddd2e 100644 --- a/docs/examples/1.6.x/server-swift/examples/messaging/create-push.md +++ b/docs/examples/1.6.x/server-swift/examples/messaging/create-push.md @@ -1,4 +1,5 @@ import Appwrite +import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint @@ -9,8 +10,8 @@ let messaging = Messaging(client) let message = try await messaging.createPush( messageId: "<MESSAGE_ID>", - title: "<TITLE>", - body: "<BODY>", + title: "<TITLE>", // optional + body: "<BODY>", // optional topics: [], // optional users: [], // optional targets: [], // optional @@ -21,8 +22,11 @@ let message = try await messaging.createPush( sound: "<SOUND>", // optional color: "<COLOR>", // optional tag: "<TAG>", // optional - badge: "<BADGE>", // optional + badge: 0, // optional draft: false, // optional - scheduledAt: "" // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional ) diff --git a/docs/examples/1.6.x/server-swift/examples/messaging/update-push.md b/docs/examples/1.6.x/server-swift/examples/messaging/update-push.md index 40ce34bf66..02893a180a 100644 --- a/docs/examples/1.6.x/server-swift/examples/messaging/update-push.md +++ b/docs/examples/1.6.x/server-swift/examples/messaging/update-push.md @@ -1,4 +1,5 @@ import Appwrite +import AppwriteEnums let client = Client() .setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint @@ -23,6 +24,9 @@ let message = try await messaging.updatePush( tag: "<TAG>", // optional badge: 0, // optional draft: false, // optional - scheduledAt: "" // optional + scheduledAt: "", // optional + contentAvailable: false, // optional + critical: false, // optional + priority: .normal // optional ) diff --git a/docs/references/account/create-push-target.md b/docs/references/account/create-push-target.md new file mode 100644 index 0000000000..c54f180638 --- /dev/null +++ b/docs/references/account/create-push-target.md @@ -0,0 +1 @@ +Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model. \ No newline at end of file diff --git a/docs/references/account/create-token-magic-url.md b/docs/references/account/create-token-magic-url.md index 6ebe4154b8..99ad6dba5e 100644 --- a/docs/references/account/create-token-magic-url.md +++ b/docs/references/account/create-token-magic-url.md @@ -1,3 +1,3 @@ -Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default. +Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits). diff --git a/docs/references/account/delete-push-target.md b/docs/references/account/delete-push-target.md new file mode 100644 index 0000000000..5909a37b27 --- /dev/null +++ b/docs/references/account/delete-push-target.md @@ -0,0 +1 @@ +Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user. \ No newline at end of file diff --git a/docs/references/account/update-push-target.md b/docs/references/account/update-push-target.md new file mode 100644 index 0000000000..997ffaafea --- /dev/null +++ b/docs/references/account/update-push-target.md @@ -0,0 +1 @@ +Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead. \ No newline at end of file diff --git a/docs/references/assistant/chat.md b/docs/references/assistant/chat.md new file mode 100644 index 0000000000..5297d1c195 --- /dev/null +++ b/docs/references/assistant/chat.md @@ -0,0 +1 @@ +Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. \ No newline at end of file diff --git a/docs/references/databases/get-collection-usage.md b/docs/references/databases/get-collection-usage.md new file mode 100644 index 0000000000..48682a075f --- /dev/null +++ b/docs/references/databases/get-collection-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/databases/get-database-usage.md b/docs/references/databases/get-database-usage.md new file mode 100644 index 0000000000..2c2628a464 --- /dev/null +++ b/docs/references/databases/get-database-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/databases/get-usage.md b/docs/references/databases/get-usage.md new file mode 100644 index 0000000000..d41f8704c8 --- /dev/null +++ b/docs/references/databases/get-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. \ No newline at end of file diff --git a/docs/references/functions/create-build.md b/docs/references/functions/create-build.md new file mode 100644 index 0000000000..7a8ac750e8 --- /dev/null +++ b/docs/references/functions/create-build.md @@ -0,0 +1 @@ +Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build. \ No newline at end of file diff --git a/docs/references/functions/get-function-usage.md b/docs/references/functions/get-function-usage.md new file mode 100644 index 0000000000..4498abb05b --- /dev/null +++ b/docs/references/functions/get-function-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days. \ No newline at end of file diff --git a/docs/references/functions/get-functions-usage.md b/docs/references/functions/get-functions-usage.md new file mode 100644 index 0000000000..14427d335d --- /dev/null +++ b/docs/references/functions/get-functions-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for a for all functions. View statistics including total functions, deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days. \ No newline at end of file diff --git a/docs/references/functions/update-deployment-build.md b/docs/references/functions/update-deployment-build.md new file mode 100644 index 0000000000..d047990adf --- /dev/null +++ b/docs/references/functions/update-deployment-build.md @@ -0,0 +1 @@ +Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details. \ No newline at end of file diff --git a/docs/references/messaging/update-email.md b/docs/references/messaging/update-email.md index 89f01d7a11..1f0d4b61a4 100644 --- a/docs/references/messaging/update-email.md +++ b/docs/references/messaging/update-email.md @@ -1 +1 @@ -Update an email message by its unique ID. +Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. diff --git a/docs/references/messaging/update-push.md b/docs/references/messaging/update-push.md index dd200a9729..e84187116d 100644 --- a/docs/references/messaging/update-push.md +++ b/docs/references/messaging/update-push.md @@ -1 +1 @@ -Update a push notification by its unique ID. +Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. diff --git a/docs/references/messaging/update-sms.md b/docs/references/messaging/update-sms.md index 2f9b57a7a7..5a1cb3d67f 100644 --- a/docs/references/messaging/update-sms.md +++ b/docs/references/messaging/update-sms.md @@ -1 +1 @@ -Update an SMS message by its unique ID. +Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated. diff --git a/docs/references/migrations/delete-migration.md b/docs/references/migrations/delete-migration.md new file mode 100644 index 0000000000..9d361ac693 --- /dev/null +++ b/docs/references/migrations/delete-migration.md @@ -0,0 +1 @@ +Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. \ No newline at end of file diff --git a/docs/references/migrations/get-migration.md b/docs/references/migrations/get-migration.md new file mode 100644 index 0000000000..710bef6863 --- /dev/null +++ b/docs/references/migrations/get-migration.md @@ -0,0 +1 @@ +Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. \ No newline at end of file diff --git a/docs/references/migrations/list-migrations.md b/docs/references/migrations/list-migrations.md new file mode 100644 index 0000000000..b1acb3f7b3 --- /dev/null +++ b/docs/references/migrations/list-migrations.md @@ -0,0 +1 @@ +List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process. \ No newline at end of file diff --git a/docs/references/migrations/migration-appwrite-report.md b/docs/references/migrations/migration-appwrite-report.md new file mode 100644 index 0000000000..69d556f5f3 --- /dev/null +++ b/docs/references/migrations/migration-appwrite-report.md @@ -0,0 +1 @@ +Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. \ No newline at end of file diff --git a/docs/references/migrations/migration-appwrite.md b/docs/references/migrations/migration-appwrite.md new file mode 100644 index 0000000000..12ee742387 --- /dev/null +++ b/docs/references/migrations/migration-appwrite.md @@ -0,0 +1 @@ +Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. \ No newline at end of file diff --git a/docs/references/migrations/migration-firebase-report.md b/docs/references/migrations/migration-firebase-report.md new file mode 100644 index 0000000000..af27587331 --- /dev/null +++ b/docs/references/migrations/migration-firebase-report.md @@ -0,0 +1 @@ +Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. \ No newline at end of file diff --git a/docs/references/migrations/migration-firebase.md b/docs/references/migrations/migration-firebase.md new file mode 100644 index 0000000000..3a7f620a7c --- /dev/null +++ b/docs/references/migrations/migration-firebase.md @@ -0,0 +1 @@ +Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. \ No newline at end of file diff --git a/docs/references/migrations/migration-nhost-report.md b/docs/references/migrations/migration-nhost-report.md new file mode 100644 index 0000000000..895da51464 --- /dev/null +++ b/docs/references/migrations/migration-nhost-report.md @@ -0,0 +1 @@ +Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. \ No newline at end of file diff --git a/docs/references/migrations/migration-nhost.md b/docs/references/migrations/migration-nhost.md new file mode 100644 index 0000000000..b7a727dd2b --- /dev/null +++ b/docs/references/migrations/migration-nhost.md @@ -0,0 +1 @@ +Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. \ No newline at end of file diff --git a/docs/references/migrations/migration-supabase-report.md b/docs/references/migrations/migration-supabase-report.md new file mode 100644 index 0000000000..d9636b5f1d --- /dev/null +++ b/docs/references/migrations/migration-supabase-report.md @@ -0,0 +1 @@ +Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. \ No newline at end of file diff --git a/docs/references/migrations/migration-supabase.md b/docs/references/migrations/migration-supabase.md new file mode 100644 index 0000000000..34bbb1eece --- /dev/null +++ b/docs/references/migrations/migration-supabase.md @@ -0,0 +1 @@ +Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. \ No newline at end of file diff --git a/docs/references/migrations/retry-migration.md b/docs/references/migrations/retry-migration.md new file mode 100644 index 0000000000..49b80ad6d4 --- /dev/null +++ b/docs/references/migrations/retry-migration.md @@ -0,0 +1 @@ +Retry a failed migration. This endpoint allows you to retry a migration that has previously failed. \ No newline at end of file diff --git a/docs/references/project/get-usage.md b/docs/references/project/get-usage.md new file mode 100644 index 0000000000..d6802c5588 --- /dev/null +++ b/docs/references/project/get-usage.md @@ -0,0 +1 @@ +Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period. \ No newline at end of file diff --git a/docs/references/projects/create-jwt.md b/docs/references/projects/create-jwt.md new file mode 100644 index 0000000000..9a6f8ebf6b --- /dev/null +++ b/docs/references/projects/create-jwt.md @@ -0,0 +1 @@ +Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. \ No newline at end of file diff --git a/docs/references/projects/create-key.md b/docs/references/projects/create-key.md new file mode 100644 index 0000000000..d6633d936d --- /dev/null +++ b/docs/references/projects/create-key.md @@ -0,0 +1 @@ +Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project. \ No newline at end of file diff --git a/docs/references/projects/create-platform.md b/docs/references/projects/create-platform.md new file mode 100644 index 0000000000..b5d8be0ff9 --- /dev/null +++ b/docs/references/projects/create-platform.md @@ -0,0 +1 @@ +Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API. \ No newline at end of file diff --git a/docs/references/projects/create-smtp-test.md b/docs/references/projects/create-smtp-test.md new file mode 100644 index 0000000000..63cea9d21f --- /dev/null +++ b/docs/references/projects/create-smtp-test.md @@ -0,0 +1 @@ +Send a test email to verify SMTP configuration. \ No newline at end of file diff --git a/docs/references/projects/create-webhook.md b/docs/references/projects/create-webhook.md new file mode 100644 index 0000000000..cd0e93332b --- /dev/null +++ b/docs/references/projects/create-webhook.md @@ -0,0 +1 @@ +Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. \ No newline at end of file diff --git a/docs/references/projects/create.md b/docs/references/projects/create.md new file mode 100644 index 0000000000..d502c269ef --- /dev/null +++ b/docs/references/projects/create.md @@ -0,0 +1 @@ +Create a new project. You can create a maximum of 100 projects per account. \ No newline at end of file diff --git a/docs/references/projects/delete-email-template.md b/docs/references/projects/delete-email-template.md new file mode 100644 index 0000000000..332b1d6117 --- /dev/null +++ b/docs/references/projects/delete-email-template.md @@ -0,0 +1 @@ +Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. \ No newline at end of file diff --git a/docs/references/projects/delete-key.md b/docs/references/projects/delete-key.md new file mode 100644 index 0000000000..9f3774b419 --- /dev/null +++ b/docs/references/projects/delete-key.md @@ -0,0 +1 @@ +Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. \ No newline at end of file diff --git a/docs/references/projects/delete-platform.md b/docs/references/projects/delete-platform.md new file mode 100644 index 0000000000..7d538cac26 --- /dev/null +++ b/docs/references/projects/delete-platform.md @@ -0,0 +1 @@ +Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. \ No newline at end of file diff --git a/docs/references/projects/delete-sms-template.md b/docs/references/projects/delete-sms-template.md new file mode 100644 index 0000000000..c5a7e6cac9 --- /dev/null +++ b/docs/references/projects/delete-sms-template.md @@ -0,0 +1 @@ +Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. \ No newline at end of file diff --git a/docs/references/projects/delete-webhook.md b/docs/references/projects/delete-webhook.md new file mode 100644 index 0000000000..74fee2bcec --- /dev/null +++ b/docs/references/projects/delete-webhook.md @@ -0,0 +1 @@ +Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. \ No newline at end of file diff --git a/docs/references/projects/delete.md b/docs/references/projects/delete.md new file mode 100644 index 0000000000..4a8070c082 --- /dev/null +++ b/docs/references/projects/delete.md @@ -0,0 +1 @@ +Delete a project by its unique ID. \ No newline at end of file diff --git a/docs/references/projects/get-email-template.md b/docs/references/projects/get-email-template.md new file mode 100644 index 0000000000..6119a0a183 --- /dev/null +++ b/docs/references/projects/get-email-template.md @@ -0,0 +1 @@ +Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. \ No newline at end of file diff --git a/docs/references/projects/get-key.md b/docs/references/projects/get-key.md new file mode 100644 index 0000000000..bd6351f420 --- /dev/null +++ b/docs/references/projects/get-key.md @@ -0,0 +1 @@ +Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes. \ No newline at end of file diff --git a/docs/references/projects/get-platform.md b/docs/references/projects/get-platform.md new file mode 100644 index 0000000000..87129b829d --- /dev/null +++ b/docs/references/projects/get-platform.md @@ -0,0 +1 @@ +Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. \ No newline at end of file diff --git a/docs/references/projects/get-sms-template.md b/docs/references/projects/get-sms-template.md new file mode 100644 index 0000000000..6ef1d93029 --- /dev/null +++ b/docs/references/projects/get-sms-template.md @@ -0,0 +1 @@ +Get a custom SMS template for the specified locale and type returning it's contents. \ No newline at end of file diff --git a/docs/references/projects/get-webhook.md b/docs/references/projects/get-webhook.md new file mode 100644 index 0000000000..559c73c748 --- /dev/null +++ b/docs/references/projects/get-webhook.md @@ -0,0 +1 @@ +Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. \ No newline at end of file diff --git a/docs/references/projects/get.md b/docs/references/projects/get.md new file mode 100644 index 0000000000..b7a1165adc --- /dev/null +++ b/docs/references/projects/get.md @@ -0,0 +1 @@ +Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. \ No newline at end of file diff --git a/docs/references/projects/list-keys.md b/docs/references/projects/list-keys.md new file mode 100644 index 0000000000..a7b701b0d7 --- /dev/null +++ b/docs/references/projects/list-keys.md @@ -0,0 +1 @@ +Get a list of all API keys from the current project. \ No newline at end of file diff --git a/docs/references/projects/list-platforms.md b/docs/references/projects/list-platforms.md new file mode 100644 index 0000000000..ed9ade0852 --- /dev/null +++ b/docs/references/projects/list-platforms.md @@ -0,0 +1 @@ +Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. \ No newline at end of file diff --git a/docs/references/projects/list-webhooks.md b/docs/references/projects/list-webhooks.md new file mode 100644 index 0000000000..bbbf4c7376 --- /dev/null +++ b/docs/references/projects/list-webhooks.md @@ -0,0 +1 @@ +Get a list of all webhooks belonging to the project. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/projects/list.md b/docs/references/projects/list.md new file mode 100644 index 0000000000..576a4b79ae --- /dev/null +++ b/docs/references/projects/list.md @@ -0,0 +1 @@ +Get a list of all projects. You can use the query params to filter your results. \ No newline at end of file diff --git a/docs/references/projects/update-api-status-all.md b/docs/references/projects/update-api-status-all.md new file mode 100644 index 0000000000..654070759f --- /dev/null +++ b/docs/references/projects/update-api-status-all.md @@ -0,0 +1 @@ +Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once. \ No newline at end of file diff --git a/docs/references/projects/update-api-status.md b/docs/references/projects/update-api-status.md new file mode 100644 index 0000000000..af10a0d4f4 --- /dev/null +++ b/docs/references/projects/update-api-status.md @@ -0,0 +1 @@ +Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime. \ No newline at end of file diff --git a/docs/references/projects/update-auth-duration.md b/docs/references/projects/update-auth-duration.md new file mode 100644 index 0000000000..bdc75fa6f0 --- /dev/null +++ b/docs/references/projects/update-auth-duration.md @@ -0,0 +1 @@ +Update how long sessions created within a project should stay active for. \ No newline at end of file diff --git a/docs/references/projects/update-auth-limit.md b/docs/references/projects/update-auth-limit.md new file mode 100644 index 0000000000..c8faa3fe37 --- /dev/null +++ b/docs/references/projects/update-auth-limit.md @@ -0,0 +1 @@ +Update the maximum number of users allowed in this project. Set to 0 for unlimited users. \ No newline at end of file diff --git a/docs/references/projects/update-auth-password-dictionary.md b/docs/references/projects/update-auth-password-dictionary.md new file mode 100644 index 0000000000..1d47d30bb5 --- /dev/null +++ b/docs/references/projects/update-auth-password-dictionary.md @@ -0,0 +1 @@ +Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. \ No newline at end of file diff --git a/docs/references/projects/update-auth-password-history.md b/docs/references/projects/update-auth-password-history.md new file mode 100644 index 0000000000..3a892915d5 --- /dev/null +++ b/docs/references/projects/update-auth-password-history.md @@ -0,0 +1 @@ +Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones. \ No newline at end of file diff --git a/docs/references/projects/update-auth-sessions-limit.md b/docs/references/projects/update-auth-sessions-limit.md new file mode 100644 index 0000000000..7d5fdffae7 --- /dev/null +++ b/docs/references/projects/update-auth-sessions-limit.md @@ -0,0 +1 @@ +Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions. \ No newline at end of file diff --git a/docs/references/projects/update-auth-status.md b/docs/references/projects/update-auth-status.md new file mode 100644 index 0000000000..5d39ec29c4 --- /dev/null +++ b/docs/references/projects/update-auth-status.md @@ -0,0 +1 @@ +Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. \ No newline at end of file diff --git a/docs/references/projects/update-email-template.md b/docs/references/projects/update-email-template.md new file mode 100644 index 0000000000..d2bf124541 --- /dev/null +++ b/docs/references/projects/update-email-template.md @@ -0,0 +1 @@ +Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates. \ No newline at end of file diff --git a/docs/references/projects/update-key.md b/docs/references/projects/update-key.md new file mode 100644 index 0000000000..4934a51497 --- /dev/null +++ b/docs/references/projects/update-key.md @@ -0,0 +1 @@ +Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. \ No newline at end of file diff --git a/docs/references/projects/update-memberships-privacy.md b/docs/references/projects/update-memberships-privacy.md new file mode 100644 index 0000000000..a1affc1166 --- /dev/null +++ b/docs/references/projects/update-memberships-privacy.md @@ -0,0 +1 @@ +Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. \ No newline at end of file diff --git a/docs/references/projects/update-mock-numbers.md b/docs/references/projects/update-mock-numbers.md new file mode 100644 index 0000000000..7fa92455c1 --- /dev/null +++ b/docs/references/projects/update-mock-numbers.md @@ -0,0 +1 @@ +Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. \ No newline at end of file diff --git a/docs/references/projects/update-oauth2.md b/docs/references/projects/update-oauth2.md new file mode 100644 index 0000000000..2285135991 --- /dev/null +++ b/docs/references/projects/update-oauth2.md @@ -0,0 +1 @@ +Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers. \ No newline at end of file diff --git a/docs/references/projects/update-personal-data-check.md b/docs/references/projects/update-personal-data-check.md new file mode 100644 index 0000000000..42847fdbfc --- /dev/null +++ b/docs/references/projects/update-personal-data-check.md @@ -0,0 +1 @@ +Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. \ No newline at end of file diff --git a/docs/references/projects/update-platform.md b/docs/references/projects/update-platform.md new file mode 100644 index 0000000000..d04b07bafd --- /dev/null +++ b/docs/references/projects/update-platform.md @@ -0,0 +1 @@ +Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. \ No newline at end of file diff --git a/docs/references/projects/update-service-status-all.md b/docs/references/projects/update-service-status-all.md new file mode 100644 index 0000000000..f05e7d8c5c --- /dev/null +++ b/docs/references/projects/update-service-status-all.md @@ -0,0 +1 @@ +Update the status of all services. Use this endpoint to enable or disable all optional services at once. \ No newline at end of file diff --git a/docs/references/projects/update-service-status.md b/docs/references/projects/update-service-status.md new file mode 100644 index 0000000000..9d3b0743a8 --- /dev/null +++ b/docs/references/projects/update-service-status.md @@ -0,0 +1 @@ +Update the status of a specific service. Use this endpoint to enable or disable a service in your project. \ No newline at end of file diff --git a/docs/references/projects/update-session-alerts.md b/docs/references/projects/update-session-alerts.md new file mode 100644 index 0000000000..36859e0c1e --- /dev/null +++ b/docs/references/projects/update-session-alerts.md @@ -0,0 +1 @@ +Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created. \ No newline at end of file diff --git a/docs/references/projects/update-sms-template.md b/docs/references/projects/update-sms-template.md new file mode 100644 index 0000000000..3e67f613b7 --- /dev/null +++ b/docs/references/projects/update-sms-template.md @@ -0,0 +1 @@ +Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. \ No newline at end of file diff --git a/docs/references/projects/update-smtp.md b/docs/references/projects/update-smtp.md new file mode 100644 index 0000000000..7d898e1ed1 --- /dev/null +++ b/docs/references/projects/update-smtp.md @@ -0,0 +1 @@ +Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. \ No newline at end of file diff --git a/docs/references/projects/update-team.md b/docs/references/projects/update-team.md new file mode 100644 index 0000000000..fb02eda88c --- /dev/null +++ b/docs/references/projects/update-team.md @@ -0,0 +1 @@ +Update the team ID of a project allowing for it to be transferred to another team. \ No newline at end of file diff --git a/docs/references/projects/update-webhook-signature.md b/docs/references/projects/update-webhook-signature.md new file mode 100644 index 0000000000..8525a05777 --- /dev/null +++ b/docs/references/projects/update-webhook-signature.md @@ -0,0 +1 @@ +Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. \ No newline at end of file diff --git a/docs/references/projects/update-webhook.md b/docs/references/projects/update-webhook.md new file mode 100644 index 0000000000..745e4aebe1 --- /dev/null +++ b/docs/references/projects/update-webhook.md @@ -0,0 +1 @@ +Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. \ No newline at end of file diff --git a/docs/references/projects/update.md b/docs/references/projects/update.md new file mode 100644 index 0000000000..60c072c477 --- /dev/null +++ b/docs/references/projects/update.md @@ -0,0 +1 @@ +Update a project by its unique ID. \ No newline at end of file diff --git a/docs/references/proxy/update-rule-verification.md b/docs/references/proxy/update-rule-verification.md new file mode 100644 index 0000000000..c06994bc59 --- /dev/null +++ b/docs/references/proxy/update-rule-verification.md @@ -0,0 +1 @@ +Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain. \ No newline at end of file diff --git a/docs/references/storage/get-bucket-usage.md b/docs/references/storage/get-bucket-usage.md new file mode 100644 index 0000000000..98e9867831 --- /dev/null +++ b/docs/references/storage/get-bucket-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. diff --git a/docs/references/storage/get-usage.md b/docs/references/storage/get-usage.md new file mode 100644 index 0000000000..697c680001 --- /dev/null +++ b/docs/references/storage/get-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. diff --git a/docs/references/teams/get-team-member.md b/docs/references/teams/get-team-member.md index fab52c1a75..91bf44c73b 100644 --- a/docs/references/teams/get-team-member.md +++ b/docs/references/teams/get-team-member.md @@ -1 +1 @@ -Get a team member by the membership unique id. All team members have read access for this resource. \ No newline at end of file +Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console. \ No newline at end of file diff --git a/docs/references/teams/list-team-members.md b/docs/references/teams/list-team-members.md index d7dd04977f..540a665d98 100644 --- a/docs/references/teams/list-team-members.md +++ b/docs/references/teams/list-team-members.md @@ -1 +1 @@ -Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. \ No newline at end of file +Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console. \ No newline at end of file diff --git a/docs/references/users/get-usage.md b/docs/references/users/get-usage.md new file mode 100644 index 0000000000..2a9379c847 --- /dev/null +++ b/docs/references/users/get-usage.md @@ -0,0 +1 @@ +Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days. diff --git a/docs/references/vcs/create-github-installation.md b/docs/references/vcs/create-github-installation.md new file mode 100644 index 0000000000..60873faf6d --- /dev/null +++ b/docs/references/vcs/create-github-installation.md @@ -0,0 +1 @@ +Begin Appwrite's GitHub's app installation to set up version control integration. This endpoint responds with a redirect URL to the GitHub App's installation page. The GitHub App must be configured in your environment for this endpoint to work. \ No newline at end of file diff --git a/docs/references/vcs/create-repository-detection.md b/docs/references/vcs/create-repository-detection.md new file mode 100644 index 0000000000..d031cdc746 --- /dev/null +++ b/docs/references/vcs/create-repository-detection.md @@ -0,0 +1 @@ +Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. \ No newline at end of file diff --git a/docs/references/vcs/create-repository.md b/docs/references/vcs/create-repository.md new file mode 100644 index 0000000000..771265bd01 --- /dev/null +++ b/docs/references/vcs/create-repository.md @@ -0,0 +1 @@ +Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation. \ No newline at end of file diff --git a/docs/references/vcs/delete-installation.md b/docs/references/vcs/delete-installation.md new file mode 100644 index 0000000000..1f07de364d --- /dev/null +++ b/docs/references/vcs/delete-installation.md @@ -0,0 +1 @@ +Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project. \ No newline at end of file diff --git a/docs/references/vcs/get-installation.md b/docs/references/vcs/get-installation.md new file mode 100644 index 0000000000..0679d9a0e9 --- /dev/null +++ b/docs/references/vcs/get-installation.md @@ -0,0 +1 @@ +Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. \ No newline at end of file diff --git a/docs/references/vcs/get-repository-contents.md b/docs/references/vcs/get-repository-contents.md new file mode 100644 index 0000000000..ab5ef7f8da --- /dev/null +++ b/docs/references/vcs/get-repository-contents.md @@ -0,0 +1 @@ +Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. diff --git a/docs/references/vcs/get-repository.md b/docs/references/vcs/get-repository.md new file mode 100644 index 0000000000..ee57861114 --- /dev/null +++ b/docs/references/vcs/get-repository.md @@ -0,0 +1 @@ +Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. \ No newline at end of file diff --git a/docs/references/vcs/list-installations.md b/docs/references/vcs/list-installations.md new file mode 100644 index 0000000000..e77daf7db0 --- /dev/null +++ b/docs/references/vcs/list-installations.md @@ -0,0 +1 @@ +List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details. diff --git a/docs/references/vcs/list-repositories.md b/docs/references/vcs/list-repositories.md new file mode 100644 index 0000000000..f486e9b584 --- /dev/null +++ b/docs/references/vcs/list-repositories.md @@ -0,0 +1 @@ +Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work. \ No newline at end of file diff --git a/docs/references/vcs/list-repository-branches.md b/docs/references/vcs/list-repository-branches.md new file mode 100644 index 0000000000..eea1795a3e --- /dev/null +++ b/docs/references/vcs/list-repository-branches.md @@ -0,0 +1 @@ +Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work. diff --git a/docs/references/vcs/update-external-deployments.md b/docs/references/vcs/update-external-deployments.md new file mode 100644 index 0000000000..22d95da9a7 --- /dev/null +++ b/docs/references/vcs/update-external-deployments.md @@ -0,0 +1 @@ +Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work. \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 90ebd4225f..4c4e55ea4e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -33,6 +33,7 @@ <directory>./tests/e2e/Services/Storage</directory> <directory>./tests/e2e/Services/Webhooks</directory> <directory>./tests/e2e/Services/Messaging</directory> + <directory>./tests/e2e/Services/Migrations</directory> <file>./tests/e2e/Services/Functions/FunctionsBase.php</file> <file>./tests/e2e/Services/Functions/FunctionsCustomServerTest.php</file> <file>./tests/e2e/Services/Functions/FunctionsCustomClientTest.php</file> diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index 1e8109622e..8555d5cb00 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -43,6 +43,13 @@ class Auth public const USER_ROLE_APPS = 'apps'; public const USER_ROLE_SYSTEM = 'system'; + /** + * Activity associated with user or the app. + */ + public const ACTIVITY_TYPE_APP = 'app'; + public const ACTIVITY_TYPE_USER = 'user'; + public const ACTIVITY_TYPE_GUEST = 'guest'; + /** * Token Types. */ diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index d1d2cb5a38..2fa3f4cfe9 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -43,7 +43,7 @@ class Amazon extends OAuth2 */ public function parseState(string $state) { - return \json_decode(\html_entity_decode($state), true); + return \json_decode(\urldecode(\html_entity_decode($state)), true); } @@ -56,7 +56,7 @@ class Amazon extends OAuth2 'response_type' => 'code', 'client_id' => $this->appID, 'scope' => \implode(' ', $this->getScopes()), - 'state' => \json_encode($this->state), + 'state' => \urlencode(\json_encode($this->state)), 'redirect_uri' => $this->callback ]); } diff --git a/src/Appwrite/Auth/OAuth2/Firebase.php b/src/Appwrite/Auth/OAuth2/Firebase.php deleted file mode 100644 index 0e2859e32c..0000000000 --- a/src/Appwrite/Auth/OAuth2/Firebase.php +++ /dev/null @@ -1,389 +0,0 @@ -<?php - -namespace Appwrite\Auth\OAuth2; - -use Appwrite\Auth\OAuth2; - -class Firebase extends OAuth2 -{ - /** - * @var array - */ - protected array $user = []; - - /** - * @var array - */ - protected array $tokens = []; - - /** - * @var array - */ - protected array $scopes = [ - 'https://www.googleapis.com/auth/firebase', - 'https://www.googleapis.com/auth/datastore', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/identitytoolkit', - 'https://www.googleapis.com/auth/userinfo.profile' - ]; - - /** - * @var array - */ - protected array $iamPermissions = [ - // Database - 'datastore.databases.get', - 'datastore.databases.list', - 'datastore.entities.get', - 'datastore.entities.list', - 'datastore.indexes.get', - 'datastore.indexes.list', - // Generic Firebase permissions - 'firebase.projects.get', - - // Auth - 'firebaseauth.configs.get', - 'firebaseauth.configs.getHashConfig', - 'firebaseauth.configs.getSecret', - 'firebaseauth.users.get', - 'identitytoolkit.tenants.get', - 'identitytoolkit.tenants.list', - - // IAM Assignment - 'iam.serviceAccounts.list', - - // Storage - 'storage.buckets.get', - 'storage.buckets.list', - 'storage.objects.get', - 'storage.objects.list' - ]; - - /** - * @return string - */ - public function getName(): string - { - return 'firebase'; - } - - /** - * @return string - */ - public function getLoginURL(): string - { - return 'https://accounts.google.com/o/oauth2/v2/auth?' . \http_build_query([ - 'access_type' => 'offline', - 'client_id' => $this->appID, - 'redirect_uri' => $this->callback, - 'scope' => \implode(' ', $this->getScopes()), - 'state' => \json_encode($this->state), - 'response_type' => 'code', - 'prompt' => 'consent', - ]); - } - - /** - * @param string $code - * - * @return array - */ - protected function getTokens(string $code): array - { - if (empty($this->tokens)) { - $response = $this->request( - 'POST', - 'https://oauth2.googleapis.com/token', - [], - \http_build_query([ - 'client_id' => $this->appID, - 'redirect_uri' => $this->callback, - 'client_secret' => $this->appSecret, - 'code' => $code, - 'grant_type' => 'authorization_code' - ]) - ); - - $this->tokens = \json_decode($response, true); - } - - return $this->tokens; - } - - /** - * @param string $refreshToken - * - * @return array - */ - public function refreshTokens(string $refreshToken): array - { - $response = $this->request( - 'POST', - 'https://oauth2.googleapis.com/token', - [], - \http_build_query([ - 'client_id' => $this->appID, - 'client_secret' => $this->appSecret, - 'grant_type' => 'refresh_token', - 'refresh_token' => $refreshToken - ]) - ); - - $output = []; - \parse_str($response, $output); - $this->tokens = $output; - - if (empty($this->tokens['refresh_token'])) { - $this->tokens['refresh_token'] = $refreshToken; - } - - return $this->tokens; - } - - - /** - * @param string $accessToken - * - * @return string - */ - public function getUserID(string $accessToken): string - { - $user = $this->getUser($accessToken); - - return $user['id'] ?? ''; - } - - /** - * @param string $accessToken - * - * @return string - */ - public function getUserEmail(string $accessToken): string - { - $user = $this->getUser($accessToken); - - return $user['email'] ?? ''; - } - - - /** - * Check if the OAuth email is verified - * - * @link https://docs.github.com/en/rest/users/emails#list-email-addresses-for-the-authenticated-user - * - * @param string $accessToken - * - * @return bool - */ - public function isEmailVerified(string $accessToken): bool - { - $user = $this->getUser($accessToken); - - if ($user['verified'] ?? false) { - return true; - } - - return false; - } - - /** - * @param string $accessToken - * - * @return string - */ - public function getUserName(string $accessToken): string - { - $user = $this->getUser($accessToken); - - return $user['name'] ?? ''; - } - - /** - * @param string $accessToken - * - * @return array - */ - protected function getUser(string $accessToken) - { - if (empty($this->user)) { - $response = $this->request( - 'GET', - 'https://www.googleapis.com/oauth2/v1/userinfo?access_token=' . \urlencode($accessToken), - [], - ); - - $this->user = \json_decode($response, true); - } - - return $this->user; - } - - public function getProjects(string $accessToken): array - { - $projects = $this->request('GET', 'https://firebase.googleapis.com/v1beta1/projects', ['Authorization: Bearer ' . \urlencode($accessToken)]); - - $projects = \json_decode($projects, true); - - return $projects['results']; - } - - /* - Be careful with the setIAMPolicy method, it will overwrite all existing policies - **/ - public function assignIAMRole(string $accessToken, string $email, string $projectId, array $role) - { - // Get IAM Roles - $iamRoles = $this->request('POST', 'https://cloudresourcemanager.googleapis.com/v1/projects/' . $projectId . ':getIamPolicy', [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ]); - - $iamRoles = \json_decode($iamRoles, true); - - $iamRoles['bindings'][] = [ - 'role' => $role['name'], - 'members' => [ - 'serviceAccount:' . $email - ] - ]; - - // Set IAM Roles - $this->request('POST', 'https://cloudresourcemanager.googleapis.com/v1/projects/' . $projectId . ':setIamPolicy', [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ], \json_encode([ - 'policy' => $iamRoles - ])); - } - - private function generateRandomString($length = 10): string - { - $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - $charactersLength = strlen($characters); - $randomString = ''; - for ($i = 0; $i < $length; $i++) { - $randomString .= $characters[random_int(0, $charactersLength - 1)]; - } - return $randomString; - } - - private function createCustomRole(string $accessToken, string $projectId): array - { - // Check if role already exists - try { - $role = $this->request('GET', 'https://iam.googleapis.com/v1/projects/' . $projectId . '/roles/appwriteMigrations', [ - 'Content-Type: application/json', - 'Authorization: Bearer ' . \urlencode($accessToken), - ]); - - $role = \json_decode($role, true); - - return $role; - } catch (\Throwable $e) { - if ($e->getCode() !== 404) { - throw $e; - } - } - - // Create role if doesn't exist or isn't correct - $role = $this->request( - 'POST', - 'https://iam.googleapis.com/v1/projects/' . $projectId . '/roles/', - [ - 'Content-Type: application/json', - 'Authorization: Bearer ' . \urlencode($accessToken), - ], - \json_encode( - [ - 'roleId' => 'appwriteMigrations', - 'role' => [ - 'title' => 'Appwrite Migrations', - 'description' => 'A helper role for Appwrite Migrations', - 'includedPermissions' => $this->iamPermissions, - 'stage' => 'GA' - ] - ] - ) - ); - - return json_decode($role, true); - } - - public function createServiceAccount(string $accessToken, string $projectId): array - { - // Create Service Account - $uid = $this->generateRandomString(); - - $response = $this->request( - 'POST', - 'https://iam.googleapis.com/v1/projects/' . $projectId . '/serviceAccounts', - [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ], - \json_encode([ - 'accountId' => 'appwrite-' . $uid, - 'serviceAccount' => [ - 'displayName' => 'Appwrite Migrations ' . $uid - ] - ]) - ); - - $response = json_decode($response, true); - - // Create and assign IAM Roles - $role = $this->createCustomRole($accessToken, $projectId); - - \sleep(1); // Wait for IAM to propagate changes. - - $this->assignIAMRole($accessToken, $response['email'], $projectId, $role); - - // Create Service Account Key - $responseKey = $this->request( - 'POST', - 'https://iam.googleapis.com/v1/projects/' . $projectId . '/serviceAccounts/' . $response['email'] . '/keys', - [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ] - ); - - $responseKey = json_decode($responseKey, true); - - return json_decode(base64_decode($responseKey['privateKeyData']), true); - } - - public function cleanupServiceAccounts(string $accessToken, string $projectId) - { - // List Service Accounts - $response = $this->request( - 'GET', - 'https://iam.googleapis.com/v1/projects/' . $projectId . '/serviceAccounts', - [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ] - ); - - $response = json_decode($response, true); - - if (empty($response['accounts'])) { - return false; - } - - foreach ($response['accounts'] as $account) { - if (strpos($account['email'], 'appwrite-') !== false) { - $this->request( - 'DELETE', - 'https://iam.googleapis.com/v1/projects/' . $projectId . '/serviceAccounts/' . $account['email'], - [ - 'Authorization: Bearer ' . \urlencode($accessToken), - 'Content-Type: application/json' - ] - ); - } - } - - return true; - } -} diff --git a/src/Appwrite/Auth/Validator/Phone.php b/src/Appwrite/Auth/Validator/Phone.php index 26aa687278..e74a78d265 100644 --- a/src/Appwrite/Auth/Validator/Phone.php +++ b/src/Appwrite/Auth/Validator/Phone.php @@ -2,6 +2,8 @@ namespace Appwrite\Auth\Validator; +use libphonenumber\NumberParseException; +use libphonenumber\PhoneNumberUtil; use Utopia\Validator; /** @@ -12,10 +14,12 @@ use Utopia\Validator; class Phone extends Validator { protected bool $allowEmpty; + protected PhoneNumberUtil $helper; public function __construct(bool $allowEmpty = false) { $this->allowEmpty = $allowEmpty; + $this->helper = PhoneNumberUtil::getInstance(); } /** @@ -47,6 +51,12 @@ class Phone extends Validator return true; } + try { + $this->helper->parse($value); + } catch (NumberParseException $e) { + return false; + } + return !!\preg_match('/^\+[1-9]\d{6,14}$/', $value); } diff --git a/src/Appwrite/Certificates/Adapter.php b/src/Appwrite/Certificates/Adapter.php new file mode 100644 index 0000000000..711e4c09b9 --- /dev/null +++ b/src/Appwrite/Certificates/Adapter.php @@ -0,0 +1,14 @@ +<?php + +namespace Appwrite\Certificates; + +use Utopia\Logger\Log; + +interface Adapter +{ + public function issueCertificate(string $certName, string $domain): ?string; + + public function isRenewRequired(string $domain, Log $log): bool; + + public function deleteCertificate(string $domain): void; +} diff --git a/src/Appwrite/Certificates/LetsEncrypt.php b/src/Appwrite/Certificates/LetsEncrypt.php new file mode 100644 index 0000000000..3896eab022 --- /dev/null +++ b/src/Appwrite/Certificates/LetsEncrypt.php @@ -0,0 +1,125 @@ +<?php + +namespace Appwrite\Certificates; + +use Exception; +use Utopia\App; +use Utopia\CLI\Console; +use Utopia\Database\DateTime; +use Utopia\Logger\Log; + +class LetsEncrypt implements Adapter +{ + private string $email; + + public function __construct(string $email) + { + $this->email = $email; + } + + + public function issueCertificate(string $certName, string $domain): ?string + { + $stdout = ''; + $stderr = ''; + + $staging = (App::isProduction()) ? '' : ' --dry-run'; + $exit = Console::execute( + "certbot certonly -v --webroot --noninteractive --agree-tos{$staging}" + . " --email " . $this->email + . " --cert-name " . $certName + . " -w " . APP_STORAGE_CERTIFICATES + . " -d {$domain}", + '', + $stdout, + $stderr + ); + + // Unexpected error, usually 5XX, API limits, ... + if ($exit !== 0) { + throw new Exception('Failed to issue a certificate with message: ' . $stderr); + } + + // Prepare folder in storage for domain + $path = APP_STORAGE_CERTIFICATES . '/' . $domain; + if (!\is_readable($path)) { + if (!\mkdir($path, 0755, true)) { + throw new Exception('Failed to create path for certificate.'); + } + } + + // Move generated files + if (!@\rename('/etc/letsencrypt/live/' . $certName . '/cert.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem')) { + throw new Exception('Failed to rename certificate cert.pem. Let\'s Encrypt log: ' . $stderr . ' ; ' . $stdout); + } + + if (!@\rename('/etc/letsencrypt/live/' . $certName . '/chain.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/chain.pem')) { + throw new Exception('Failed to rename certificate chain.pem. Let\'s Encrypt log: ' . $stderr . ' ; ' . $stdout); + } + + if (!@\rename('/etc/letsencrypt/live/' . $certName . '/fullchain.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/fullchain.pem')) { + throw new Exception('Failed to rename certificate fullchain.pem. Let\'s Encrypt log: ' . $stderr . ' ; ' . $stdout); + } + + if (!@\rename('/etc/letsencrypt/live/' . $certName . '/privkey.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/privkey.pem')) { + throw new Exception('Failed to rename certificate privkey.pem. Let\'s Encrypt log: ' . $stderr . ' ; ' . $stdout); + } + + $config = \implode(PHP_EOL, [ + "tls:", + " certificates:", + " - certFile: /storage/certificates/{$domain}/fullchain.pem", + " keyFile: /storage/certificates/{$domain}/privkey.pem" + ]); + + // Save configuration into Traefik using our new cert files + if (!\file_put_contents(APP_STORAGE_CONFIG . '/' . $domain . '.yml', $config)) { + throw new Exception('Failed to save Traefik configuration.'); + } + + $certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem'; + $certData = openssl_x509_parse(file_get_contents($certPath)); + $validTo = $certData['validTo_time_t'] ?? null; + $dt = (new \DateTime())->setTimestamp($validTo); + return DateTime::addSeconds($dt, -60 * 60 * 24 * 30); + } + + public function isRenewRequired(string $domain, Log $log): bool + { + $certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem'; + if (\file_exists($certPath)) { + $certData = openssl_x509_parse(file_get_contents($certPath)); + $validTo = $certData['validTo_time_t'] ?? 0; + + if (empty($validTo)) { + $log->addTag('certificateDomain', $domain); + throw new Exception('Unable to read certificate file (cert.pem).'); + } + + // LetsEncrypt allows renewal 30 days before expiry + $expiryInAdvance = (60 * 60 * 24 * 30); + if ($validTo - $expiryInAdvance > \time()) { + $log->addTag('certificateDomain', $domain); + $log->addExtra('certificateData', \is_array($certData) ? \json_encode($certData) : \strval($certData)); + return false; + } + } + + return true; + } + + public function deleteCertificate(string $domain): void + { + $directory = APP_STORAGE_CERTIFICATES . '/' . $domain; + $checkTraversal = realpath($directory) === $directory; + + if ($checkTraversal && is_dir($directory)) { + // Delete files, so Traefik is aware of change + array_map('unlink', glob($directory . '/*.*')); + rmdir($directory); + Console::info("Deleted certificate files for {$domain}"); + } else { + Console::info("No certificate files found for {$domain}"); + } + } +} diff --git a/src/Appwrite/Event/Audit.php b/src/Appwrite/Event/Audit.php index 4b02849970..4b9aa9f5c5 100644 --- a/src/Appwrite/Event/Audit.php +++ b/src/Appwrite/Event/Audit.php @@ -2,7 +2,6 @@ namespace Appwrite\Event; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Audit extends Event @@ -11,6 +10,7 @@ class Audit extends Event protected string $mode = ''; protected string $userAgent = ''; protected string $ip = ''; + protected string $hostname = ''; public function __construct(protected Connection $connection) { @@ -114,16 +114,37 @@ class Audit extends Event } /** - * Executes the event and sends it to the audit worker. + * Set the hostname. * - * @return string|bool - * @throws \InvalidArgumentException + * @param string $hostname + * + * @return self */ - public function trigger(): string|bool + public function setHostname(string $hostname): self { - $client = new Client($this->queue, $this->connection); + $this->hostname = $hostname; - return $client->enqueue([ + return $this; + } + + /** + * Get the hostname. + * + * @return string + */ + public function getHostname(): string + { + return $this->hostname; + } + + /** + * Prepare payload for queue. + * + * @return array + */ + protected function preparePayload(): array + { + return [ 'project' => $this->project, 'user' => $this->user, 'payload' => $this->payload, @@ -132,6 +153,7 @@ class Audit extends Event 'ip' => $this->ip, 'userAgent' => $this->userAgent, 'event' => $this->event, - ]); + 'hostname' => $this->hostname + ]; } } diff --git a/src/Appwrite/Event/Build.php b/src/Appwrite/Event/Build.php index b8cb62a6f8..831adf8e41 100644 --- a/src/Appwrite/Event/Build.php +++ b/src/Appwrite/Event/Build.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Build extends Event @@ -105,22 +104,19 @@ class Build extends Event } /** - * Executes the function event and sends it to the functions worker. + * Prepare payload for queue. * - * @return string|bool - * @throws \InvalidArgumentException + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'project' => $this->project, 'resource' => $this->resource, 'deployment' => $this->deployment, 'type' => $this->type, 'template' => $this->template - ]); + ]; } /** diff --git a/src/Appwrite/Event/Certificate.php b/src/Appwrite/Event/Certificate.php index 85058c96fe..6a395417ed 100644 --- a/src/Appwrite/Event/Certificate.php +++ b/src/Appwrite/Event/Certificate.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Certificate extends Event @@ -67,19 +66,16 @@ class Certificate extends Event } /** - * Executes the event and sends it to the certificates worker. + * Prepare the payload for the event * - * @return string|bool - * @throws \InvalidArgumentException + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'project' => $this->project, 'domain' => $this->domain, 'skipRenewCheck' => $this->skipRenewCheck - ]); + ]; } } diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index f9eb7d9a7d..24123de6c1 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -4,7 +4,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; use Utopia\DSN\DSN; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Database extends Event @@ -100,13 +99,7 @@ class Database extends Event return $this->document; } - /** - * Executes the event and send it to the database worker. - * - * @return string|bool - * @throws \InvalidArgumentException - */ - public function trigger(): string|bool + public function getQueue(): string { try { $dsn = new DSN($this->getProject()->getAttribute('database')); @@ -115,23 +108,25 @@ class Database extends Event $dsn = new DSN('mysql://' . $this->getProject()->getAttribute('database')); } - $this->setQueue($dsn->getHost()); + $this->queue = $dsn->getHost(); + return $this->queue; + } - $client = new Client($this->queue, $this->connection); - - try { - $result = $client->enqueue([ - 'project' => $this->project, - 'user' => $this->user, - 'type' => $this->type, - 'collection' => $this->collection, - 'document' => $this->document, - 'database' => $this->database, - 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) - ]); - return $result; - } catch (\Throwable $th) { - return false; - } + /** + * Prepare the payload for the event + * + * @return array + */ + protected function preparePayload(): array + { + return [ + 'project' => $this->project, + 'user' => $this->user, + 'type' => $this->type, + 'collection' => $this->collection, + 'document' => $this->document, + 'database' => $this->database, + 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) + ]; } } diff --git a/src/Appwrite/Event/Delete.php b/src/Appwrite/Event/Delete.php index 064fbcefa9..f0af20f21b 100644 --- a/src/Appwrite/Event/Delete.php +++ b/src/Appwrite/Event/Delete.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Delete extends Event @@ -131,18 +130,14 @@ class Delete extends Event return $this->document; } - /** - * Executes this event and sends it to the deletes worker. + * Prepare the payload for the event * - * @return string|bool - * @throws \InvalidArgumentException + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'project' => $this->project, 'type' => $this->type, 'document' => $this->document, @@ -150,6 +145,6 @@ class Delete extends Event 'resourceType' => $this->resourceType, 'datetime' => $this->datetime, 'hourlyUsageRetentionDatetime' => $this->hourlyUsageRetentionDatetime - ]); + ]; } } diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 43eda511df..5cd5f8e7d6 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -65,6 +65,24 @@ class Event { } + /** + * Set paused state for this event. + */ + public function setPaused(bool $paused): self + { + $this->paused = $paused; + + return $this; + } + + /** + * Get paused state for this event. + */ + public function getPaused(): bool + { + return $this->paused; + } + /** * Set queue used for this event. * @@ -119,7 +137,6 @@ class Event public function setProject(Document $project): self { $this->project = $project; - return $this; } @@ -204,19 +221,6 @@ class Event return $this->payload; } - public function getRealtimePayload(): array - { - $payload = []; - - foreach ($this->payload as $key => $value) { - if (!isset($this->sensitive[$key])) { - $payload[$key] = $value; - } - } - - return $payload; - } - /** * Set context for this event. * @@ -307,6 +311,27 @@ class Event return $this->params; } + /** + * Get trimmed values for sensitive/large payload fields. + * Override this method in child classes to add more fields to trim. + * + * @return array + */ + protected function trimPayload(): array + { + $trimmed = []; + + if ($this->project) { + $trimmed['project'] = new Document([ + '$id' => $this->project->getId(), + '$internalId' => $this->project->getInternalId(), + 'database' => $this->project->getAttribute('database') + ]); + } + + return $trimmed; + } + /** * Execute Event. * @@ -319,16 +344,30 @@ class Event return false; } - $client = new Client($this->queue, $this->connection); + /** The getter is required since events like Databases need to override the queue name depending on the project */ + $client = new Client($this->getQueue(), $this->connection); - return $client->enqueue([ + // Merge the base payload with any trimmed values + $payload = array_merge($this->preparePayload(), $this->trimPayload()); + + return $client->enqueue($payload); + } + + /** + * Prepare payload for queue. Can be overridden by child classes to customize payload. + * + * @return array + */ + protected function preparePayload(): array + { + return [ 'project' => $this->project, 'user' => $this->user, 'userId' => $this->userId, 'payload' => $this->payload, 'context' => $this->context, 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) - ]); + ]; } /** @@ -530,20 +569,21 @@ class Event } /** - * Get the value of paused + * Generate a function event from a base event + * + * @param Event $event + * + * @return self + * */ - public function isPaused(): bool + public function from(Event $event): self { - return $this->paused; - } - - /** - * Set the value of paused - */ - public function setPaused(bool $paused): self - { - $this->paused = $paused; - + $this->project = $event->getProject(); + $this->user = $event->getUser(); + $this->payload = $event->getPayload(); + $this->event = $event->getEvent(); + $this->params = $event->getParams(); + $this->context = $event->context; return $this; } } diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index 4dad5802f7..b3945fccb8 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Func extends Event @@ -173,13 +172,13 @@ class Func extends Event } /** - * Returns set custom data for the function event. + * Returns set JWT for the function event. * * @return string */ - public function getData(): string + public function getJWT(): string { - return $this->data; + return $this->jwt; } /** @@ -191,37 +190,19 @@ class Func extends Event public function setJWT(string $jwt): self { $this->jwt = $jwt; - return $this; } /** - * Returns set JWT for the function event. + * Prepare payload for the function event. * - * @return string + * @return array */ - public function getJWT(): string + protected function preparePayload(): array { - return $this->jwt; - } - - /** - * Executes the function event and sends it to the functions worker. - * - * @return string|bool - * @throws \InvalidArgumentException - */ - public function trigger(): string|bool - { - if ($this->paused) { - return false; - } - - $client = new Client($this->queue, $this->connection); - $events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null; - return $client->enqueue([ + return [ 'project' => $this->project, 'user' => $this->user, 'userId' => $this->userId, @@ -236,24 +217,6 @@ class Func extends Event 'path' => $this->path, 'headers' => $this->headers, 'method' => $this->method, - ]); - } - - /** - * Generate a function event from a base event - * - * @param Event $event - * - * @return self - * - */ - public function from(Event $event): self - { - $this->project = $event->getProject(); - $this->user = $event->getUser(); - $this->payload = $event->getPayload(); - $this->event = $event->getEvent(); - $this->params = $event->getParams(); - return $this; + ]; } } diff --git a/src/Appwrite/Event/Mail.php b/src/Appwrite/Event/Mail.php index 9bdbf6044d..1c9e539cdb 100644 --- a/src/Appwrite/Event/Mail.php +++ b/src/Appwrite/Event/Mail.php @@ -2,7 +2,6 @@ namespace Appwrite\Event; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Mail extends Event @@ -397,16 +396,13 @@ class Mail extends Event } /** - * Executes the event and sends it to the mails worker. + * Prepare the payload for the event * - * @return string|bool - * @throws \InvalidArgumentException + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'project' => $this->project, 'recipient' => $this->recipient, 'name' => $this->name, @@ -417,6 +413,6 @@ class Mail extends Event 'variables' => $this->variables, 'attachment' => $this->attachment, 'events' => Event::generateEvents($this->getEvent(), $this->getParams()) - ]); + ]; } } diff --git a/src/Appwrite/Event/Messaging.php b/src/Appwrite/Event/Messaging.php index f97ff02d21..61dbe9c427 100644 --- a/src/Appwrite/Event/Messaging.php +++ b/src/Appwrite/Event/Messaging.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Messaging extends Event @@ -27,7 +26,7 @@ class Messaging extends Event /** * Sets type for the build event. * - * @param string $type Can be `MESSAGE_TYPE_INTERNAL` or `MESSAGE_TYPE_EXTERNAL`. + * @param string $type Can be `MESSAGE_SEND_TYPE_INTERNAL` or `MESSAGE_SEND_TYPE_EXTERNAL`. * @return self */ public function setType(string $type): self @@ -176,15 +175,13 @@ class Messaging extends Event } /** - * Executes the event and sends it to the messaging worker. - * @return string|bool - * @throws \InvalidArgumentException + * Prepare the payload for the event + * + * @return array */ - public function trigger(): string | bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'type' => $this->type, 'project' => $this->project, 'user' => $this->user, @@ -192,6 +189,6 @@ class Messaging extends Event 'message' => $this->message, 'recipients' => $this->recipients, 'providerType' => $this->providerType, - ]); + ]; } } diff --git a/src/Appwrite/Event/Migration.php b/src/Appwrite/Event/Migration.php index e57ac3c87c..5fb2d5a106 100644 --- a/src/Appwrite/Event/Migration.php +++ b/src/Appwrite/Event/Migration.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Migration extends Event @@ -68,20 +67,16 @@ class Migration extends Event } /** - * Executes the migration event and sends it to the migrations worker. + * Prepare the payload for the migration event. * - * @return string|bool - * @throws \InvalidArgumentException + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'project' => $this->project, 'user' => $this->user, 'migration' => $this->migration, - ]); + ]; } } diff --git a/src/Appwrite/Event/Realtime.php b/src/Appwrite/Event/Realtime.php new file mode 100644 index 0000000000..f4f00b59d4 --- /dev/null +++ b/src/Appwrite/Event/Realtime.php @@ -0,0 +1,70 @@ +<?php + +namespace Appwrite\Event; + +use Appwrite\Messaging\Adapter\Realtime as RealtimeAdapter; +use Utopia\Database\Document; + +class Realtime extends Event +{ + public function __construct() + { + } + + public function getRealtimePayload(): array + { + $payload = []; + + foreach ($this->payload as $key => $value) { + if (!isset($this->sensitive[$key])) { + $payload[$key] = $value; + } + } + + return $payload; + } + + /** + * Execute Event. + * + * @return string|bool + * @throws InvalidArgumentException + */ + public function trigger(): string|bool + { + if ($this->paused || empty($this->event)) { + return false; + } + + $allEvents = Event::generateEvents($this->getEvent(), $this->getParams()); + $payload = new Document($this->getPayload()); + + $db = $this->getContext('database'); + $collection = $this->getContext('collection'); + $bucket = $this->getContext('bucket'); + + $target = RealtimeAdapter::fromPayload( + // Pass first, most verbose event pattern + event: $allEvents[0], + payload: $payload, + project: $this->getProject(), + database: $db, + collection: $collection, + bucket: $bucket, + ); + + RealtimeAdapter::send( + projectId: $target['projectId'] ?? $this->getProject()->getId(), + payload: $this->getRealtimePayload(), + events: $allEvents, + channels: $target['channels'], + roles: $target['roles'], + options: [ + 'permissionsChanged' => $target['permissionsChanged'], + 'userId' => $this->getParam('userId') + ] + ); + + return true; + } +} diff --git a/src/Appwrite/Event/Usage.php b/src/Appwrite/Event/Usage.php index 4426f4ab1b..5609859f37 100644 --- a/src/Appwrite/Event/Usage.php +++ b/src/Appwrite/Event/Usage.php @@ -3,7 +3,6 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class Usage extends Event @@ -42,6 +41,7 @@ class Usage extends Event */ public function addMetric(string $key, int $value): self { + $this->metrics[] = [ 'key' => $key, 'value' => $value, @@ -50,6 +50,20 @@ class Usage extends Event return $this; } + /** + * Prepare the payload for the usage event. + * + * @return array + */ + protected function preparePayload(): array + { + return [ + 'project' => $this->project, + 'reduce' => $this->reduce, + 'metrics' => $this->metrics, + ]; + } + /** * Sends metrics to the usage worker. * @@ -57,11 +71,8 @@ class Usage extends Event */ public function trigger(): string|bool { - $client = new Client($this->queue, $this->connection); - return $client->enqueue([ - 'project' => $this->getProject(), - 'reduce' => $this->reduce, - 'metrics' => $this->metrics, - ]); + parent::trigger(); + $this->metrics = []; + return true; } } diff --git a/src/Appwrite/Event/UsageDump.php b/src/Appwrite/Event/UsageDump.php index 8f87908849..6f44de4eda 100644 --- a/src/Appwrite/Event/UsageDump.php +++ b/src/Appwrite/Event/UsageDump.php @@ -2,7 +2,6 @@ namespace Appwrite\Event; -use Utopia\Queue\Client; use Utopia\Queue\Connection; class UsageDump extends Event @@ -32,16 +31,14 @@ class UsageDump extends Event } /** - * Sends metrics to the usage worker. + * Prepare the payload for the usage dump event. * - * @return string|bool + * @return array */ - public function trigger(): string|bool + protected function preparePayload(): array { - $client = new Client($this->queue, $this->connection); - - return $client->enqueue([ + return [ 'stats' => $this->stats, - ]); + ]; } } diff --git a/src/Appwrite/Event/Webhook.php b/src/Appwrite/Event/Webhook.php new file mode 100644 index 0000000000..3e0dbe446f --- /dev/null +++ b/src/Appwrite/Event/Webhook.php @@ -0,0 +1,31 @@ +<?php + +namespace Appwrite\Event; + +use Utopia\Queue\Connection; + +class Webhook extends Event +{ + public function __construct(protected Connection $connection) + { + parent::__construct($connection); + + $this + ->setQueue(Event::WEBHOOK_QUEUE_NAME) + ->setClass(Event::WEBHOOK_CLASS_NAME); + } + + /** + * Trim the payload for the webhook event. + * + * @return array + */ + public function trimPayload(): array + { + $trimmed = parent::trimPayload(); + if (isset($this->context)) { + $trimmed['context'] = []; + } + return $trimmed; + } +} diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 9de85eec8a..d49a3c6ba3 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -39,6 +39,7 @@ class Exception extends \Exception public const GENERAL_UNKNOWN = 'general_unknown'; public const GENERAL_MOCK = 'general_mock'; public const GENERAL_ACCESS_FORBIDDEN = 'general_access_forbidden'; + public const GENERAL_RESOURCE_BLOCKED = 'general_resource_blocked'; public const GENERAL_UNKNOWN_ORIGIN = 'general_unknown_origin'; public const GENERAL_API_DISABLED = 'general_api_disabled'; public const GENERAL_SERVICE_DISABLED = 'general_service_disabled'; @@ -111,7 +112,6 @@ class Exception extends \Exception /** Teams */ public const TEAM_NOT_FOUND = 'team_not_found'; - public const TEAM_INVITE_ALREADY_EXISTS = 'team_invite_already_exists'; public const TEAM_INVITE_NOT_FOUND = 'team_invite_not_found'; public const TEAM_INVALID_SECRET = 'team_invalid_secret'; public const TEAM_MEMBERSHIP_MISMATCH = 'team_membership_mismatch'; @@ -210,6 +210,7 @@ class Exception extends \Exception public const INDEX_LIMIT_EXCEEDED = 'index_limit_exceeded'; public const INDEX_ALREADY_EXISTS = 'index_already_exists'; public const INDEX_INVALID = 'index_invalid'; + public const INDEX_DEPENDENCY = 'index_dependency'; /** Projects */ public const PROJECT_NOT_FOUND = 'project_not_found'; diff --git a/src/Appwrite/GraphQL/Schema.php b/src/Appwrite/GraphQL/Schema.php index 833ea9d032..a0d93de45c 100644 --- a/src/Appwrite/GraphQL/Schema.php +++ b/src/Appwrite/GraphQL/Schema.php @@ -98,27 +98,36 @@ class Schema foreach ($routes as $route) { /** @var Route $route */ - $namespace = $route->getLabel('sdk.namespace', ''); - $method = $route->getLabel('sdk.method', ''); - $name = $namespace . \ucfirst($method); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); - if (empty($name)) { + if (empty($sdk)) { continue; } - foreach (Mapper::route($utopia, $route, $complexity) as $field) { - switch ($route->getMethod()) { - case 'GET': - $queries[$name] = $field; - break; - case 'POST': - case 'PUT': - case 'PATCH': - case 'DELETE': - $mutations[$name] = $field; - break; - default: - throw new \Exception("Unsupported method: {$route->getMethod()}"); + if (!\is_array($sdk)) { + $sdk = [$sdk]; + } + + foreach ($sdk as $method) { + $namespace = $method->getNamespace(); + $methodName = $method->getMethodName(); + $name = $namespace . \ucfirst($methodName); + + foreach (Mapper::route($utopia, $route, $method, $complexity) as $field) { + switch ($route->getMethod()) { + case 'GET': + $queries[$name] = $field; + break; + case 'POST': + case 'PUT': + case 'PATCH': + case 'DELETE': + $mutations[$name] = $field; + break; + default: + throw new \Exception("Unsupported method: {$route->getMethod()}"); + } } } } diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index d8f1d7da09..e5056d0abc 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -4,6 +4,7 @@ namespace Appwrite\GraphQL\Types; use Appwrite\GraphQL\Resolvers; use Appwrite\GraphQL\Types; +use Appwrite\SDK\Method; use Exception; use GraphQL\Type\Definition\ObjectType; use GraphQL\Type\Definition\Type; @@ -78,6 +79,7 @@ class Mapper public static function route( App $utopia, Route $route, + Method $method, callable $complexity ): iterable { foreach (self::$blacklist as $blacklist) { @@ -86,10 +88,27 @@ class Mapper } } - $names = $route->getLabel('sdk.response.model', 'none'); - $models = \is_array($names) - ? \array_map(static fn ($m) => static::$models[$m], $names) - : [static::$models[$names]]; + $responses = $method->getResponses() ?? []; + + // If responses is an array, map each response to its model + if (\is_array($responses)) { + $models = []; + foreach ($responses as $response) { + $modelName = $response->getModel(); + + if (\is_array($modelName)) { + foreach ($modelName as $name) { + $models[] = static::$models[$name]; + } + } else { + $models[] = static::$models[$modelName]; + } + } + } else { + // If single response, get its model and wrap in array + $modelName = $responses->getModel(); + $models = [static::$models[$modelName]]; + } foreach ($models as $model) { $type = Mapper::model(\ucfirst($model->getType())); @@ -98,13 +117,25 @@ class Mapper $list = false; foreach ($route->getParams() as $name => $parameter) { + $methodParameters = $method->getParameters(); + + if (!empty($methodParameters)) { + if (!array_key_exists($name, $methodParameters)) { + continue; + } + $optional = $methodParameters[$name]['optional']; + } else { + $optional = $parameter['optional']; + } + if ($name === 'queries') { $list = true; } + $parameterType = Mapper::param( $utopia, $parameter['validator'], - !$parameter['optional'], + !$optional, $parameter['injections'] ); $params[$name] = [ diff --git a/src/Appwrite/Messaging/Adapter/Realtime.php b/src/Appwrite/Messaging/Adapter/Realtime.php index c437d4d487..dceafacf6e 100644 --- a/src/Appwrite/Messaging/Adapter/Realtime.php +++ b/src/Appwrite/Messaging/Adapter/Realtime.php @@ -7,7 +7,6 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Role; -use Utopia\System\System; class Realtime extends Adapter { @@ -139,20 +138,26 @@ class Realtime extends Adapter $permissionsChanged = array_key_exists('permissionsChanged', $options) && $options['permissionsChanged']; $userId = array_key_exists('userId', $options) ? $options['userId'] : null; - $redis = new \Redis(); //TODO: make this part of the constructor - $redis->connect(System::getEnv('_APP_REDIS_HOST', ''), System::getEnv('_APP_REDIS_PORT', '')); - $redis->publish('realtime', json_encode([ - 'project' => $projectId, - 'roles' => $roles, - 'permissionsChanged' => $permissionsChanged, - 'userId' => $userId, - 'data' => [ - 'events' => $events, - 'channels' => $channels, - 'timestamp' => DateTime::formatTz(DateTime::now()), - 'payload' => $payload - ] - ])); + global $register; + $pubsub = $register->get('pools')->get('pubsub')->pop(); + try { + /** @var \Appwrite\PubSub\Adapter $redis */ + $redis = $pubsub->getResource(); + $redis->publish('realtime', json_encode([ + 'project' => $projectId, + 'roles' => $roles, + 'permissionsChanged' => $permissionsChanged, + 'userId' => $userId, + 'data' => [ + 'events' => $events, + 'channels' => $channels, + 'timestamp' => DateTime::formatTz(DateTime::now()), + 'payload' => $payload + ] + ])); + } finally { + $pubsub->reclaim(); + } } /** diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index cee1b2d263..19f69b1a4f 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -91,6 +91,7 @@ abstract class Migration '1.5.10' => 'V20', '1.5.11' => 'V20', '1.6.0' => 'V21', + '1.6.1' => 'V21', ]; /** diff --git a/src/Appwrite/Platform/Tasks/Doctor.php b/src/Appwrite/Platform/Tasks/Doctor.php index 82d1ca2d59..c43afea527 100644 --- a/src/Appwrite/Platform/Tasks/Doctor.php +++ b/src/Appwrite/Platform/Tasks/Doctor.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Tasks; use Appwrite\ClamAV\Network; +use Appwrite\PubSub\Adapter; use Utopia\App; use Utopia\CLI\Console; use Utopia\Config\Config; @@ -158,6 +159,7 @@ class Doctor extends Action foreach ($configs as $key => $config) { foreach ($config as $pool) { try { + /** @var Adapter $adapter */ $adapter = $pools->get($pool)->pop()->getResource(); if ($adapter->ping()) { diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index afb38f35fc..2d37bdbf70 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -23,13 +23,13 @@ class Maintenance extends Action { $this ->desc('Schedules maintenance tasks and publishes them to our queues') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForCertificates') ->inject('queueForDeletes') - ->callback(fn (Database $dbForConsole, Certificate $queueForCertificates, Delete $queueForDeletes) => $this->action($dbForConsole, $queueForCertificates, $queueForDeletes)); + ->callback(fn (Database $dbForPlatform, Certificate $queueForCertificates, Delete $queueForDeletes) => $this->action($dbForPlatform, $queueForCertificates, $queueForDeletes)); } - public function action(Database $dbForConsole, Certificate $queueForCertificates, Delete $queueForDeletes): void + public function action(Database $dbForPlatform, Certificate $queueForCertificates, Delete $queueForDeletes): void { Console::title('Maintenance V1'); Console::success(APP_NAME . ' maintenance process v1 has started'); @@ -41,38 +41,28 @@ class Maintenance extends Action $cacheRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_CACHE', '2592000'); // 30 days $schedulesDeletionRetention = (int) System::getEnv('_APP_MAINTENANCE_RETENTION_SCHEDULES', '86400'); // 1 Day - Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForConsole, $queueForDeletes, $queueForCertificates) { + Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $queueForDeletes, $queueForCertificates) { $time = DateTime::now(); Console::info("[{$time}] Notifying workers with maintenance tasks every {$interval} seconds"); - $this->foreachProject($dbForConsole, function (Document $project) use ($queueForDeletes, $usageStatsRetentionHourly) { - $queueForDeletes->setProject($project); + $this->foreachProject($dbForPlatform, function (Document $project) use ($queueForDeletes, $usageStatsRetentionHourly) { + $queueForDeletes + ->setType(DELETE_TYPE_MAINTENANCE) + ->setProject($project) + ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) + ->trigger(); - $this->notifyProjects($queueForDeletes, $usageStatsRetentionHourly); }); $this->notifyDeleteConnections($queueForDeletes); - $this->renewCertificates($dbForConsole, $queueForCertificates); + $this->renewCertificates($dbForPlatform, $queueForCertificates); $this->notifyDeleteCache($cacheRetention, $queueForDeletes); $this->notifyDeleteSchedules($schedulesDeletionRetention, $queueForDeletes); }, $interval, $delay); } - /** - * Hook to allow sub-classes to extend project-level maintenance functionality. - */ - protected function notifyProjects(Delete $queueForDeletes, int $usageStatsRetentionHourly): void - { - $this->notifyDeleteTargets($queueForDeletes); - $this->notifyDeleteExecutionLogs($queueForDeletes); - $this->notifyDeleteAbuseLogs($queueForDeletes); - $this->notifyDeleteAuditLogs($queueForDeletes); - $this->notifyDeleteUsageStats($usageStatsRetentionHourly, $queueForDeletes); - $this->notifyDeleteExpiredSessions($queueForDeletes); - } - - protected function foreachProject(Database $dbForConsole, callable $callback): void + protected function foreachProject(Database $dbForPlatform, callable $callback): void { // TODO: @Meldiron name of this method no longer matches. It does not delete, and it gives whole document $count = 0; @@ -82,7 +72,7 @@ class Maintenance extends Action $executionStart = \microtime(true); while ($sum === $limit) { - $projects = $dbForConsole->find('projects', [Query::limit($limit), Query::offset($chunk * $limit)]); + $projects = $dbForPlatform->find('projects', [Query::limit($limit), Query::offset($chunk * $limit)]); $chunk++; @@ -99,35 +89,6 @@ class Maintenance extends Action Console::info("Found {$count} projects " . ($executionEnd - $executionStart) . " seconds"); } - private function notifyDeleteExecutionLogs(Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_EXECUTIONS) - ->trigger(); - } - - private function notifyDeleteAbuseLogs(Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_ABUSE) - ->trigger(); - } - - private function notifyDeleteAuditLogs(Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_AUDIT) - ->trigger(); - } - - private function notifyDeleteUsageStats(int $usageStatsRetentionHourly, Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_USAGE) - ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) - ->trigger(); - } - private function notifyDeleteConnections(Delete $queueForDeletes): void { $queueForDeletes @@ -136,19 +97,13 @@ class Maintenance extends Action ->trigger(); } - private function notifyDeleteExpiredSessions(Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_SESSIONS) - ->trigger(); - } - - private function renewCertificates(Database $dbForConsole, Certificate $queueForCertificate): void + private function renewCertificates(Database $dbForPlatform, Certificate $queueForCertificate): void { $time = DateTime::now(); - $certificates = $dbForConsole->find('certificates', [ + $certificates = $dbForPlatform->find('certificates', [ Query::lessThan('attempts', 5), // Maximum 5 attempts + Query::isNotNull('renewDate'), Query::lessThanEqual('renewDate', $time), // includes 60 days cooldown (we have 30 days to renew) Query::limit(200), // Limit 200 comes from LetsEncrypt (300 orders per 3 hours, keeping some for new domains) ]); @@ -184,11 +139,4 @@ class Maintenance extends Action ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * $interval)) ->trigger(); } - - private function notifyDeleteTargets(Delete $queueForDeletes): void - { - $queueForDeletes - ->setType(DELETE_TYPE_EXPIRED_TARGETS) - ->trigger(); - } } diff --git a/src/Appwrite/Platform/Tasks/Migrate.php b/src/Appwrite/Platform/Tasks/Migrate.php index dcba59bb1d..4efa78ed4b 100644 --- a/src/Appwrite/Platform/Tasks/Migrate.php +++ b/src/Appwrite/Platform/Tasks/Migrate.php @@ -30,12 +30,12 @@ class Migrate extends Action ->desc('Migrate Appwrite to new version') /** @TODO APP_VERSION_STABLE needs to be defined */ ->param('version', APP_VERSION_STABLE, new Text(8), 'Version to migrate to.', true) - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('register') - ->callback(function ($version, $dbForConsole, $getProjectDB, Registry $register) { - \Co\run(function () use ($version, $dbForConsole, $getProjectDB, $register) { - $this->action($version, $dbForConsole, $getProjectDB, $register); + ->callback(function ($version, $dbForPlatform, $getProjectDB, Registry $register) { + \Co\run(function () use ($version, $dbForPlatform, $getProjectDB, $register) { + $this->action($version, $dbForPlatform, $getProjectDB, $register); }); }); } @@ -58,7 +58,7 @@ class Migrate extends Action } } - public function action(string $version, Database $dbForConsole, callable $getProjectDB, Registry $register) + public function action(string $version, Database $dbForPlatform, callable $getProjectDB, Registry $register) { Authorization::disable(); if (!array_key_exists($version, Migration::$versions)) { @@ -93,10 +93,10 @@ class Migrate extends Action $count = 0; try { - $totalProjects = $dbForConsole->count('projects') + 1; + $totalProjects = $dbForPlatform->count('projects') + 1; } catch (\Throwable $th) { - $dbForConsole->setNamespace('_console'); - $totalProjects = $dbForConsole->count('projects') + 1; + $dbForPlatform->setNamespace('_console'); + $totalProjects = $dbForPlatform->count('projects') + 1; } $class = 'Appwrite\\Migration\\Version\\' . Migration::$versions[$version]; @@ -120,7 +120,7 @@ class Migrate extends Action $projectDB = $getProjectDB($project); $projectDB->disableValidation(); $migration - ->setProject($project, $projectDB, $dbForConsole) + ->setProject($project, $projectDB, $dbForPlatform) ->setPDO($register->get('db', true)) ->execute(); } catch (\Throwable $th) { @@ -132,7 +132,7 @@ class Migrate extends Action } $sum = \count($projects); - $projects = $dbForConsole->find('projects', [Query::limit($limit), Query::offset($offset)]); + $projects = $dbForPlatform->find('projects', [Query::limit($limit), Query::offset($offset)]); $offset = $offset + $limit; $count = $count + $sum; diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 65d2f7717c..126dcd7fb4 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -25,6 +25,9 @@ use Appwrite\Spec\Swagger2; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Platform\Action; +use Utopia\Validator\Nullable; +use Utopia\Validator\Text; +use Utopia\Validator\WhiteList; class SDKs extends Action { @@ -37,23 +40,35 @@ class SDKs extends Action { $this ->desc('Generate Appwrite SDKs') - ->callback(fn () => $this->action()); + ->param('platform', null, new Nullable(new Text(256)), 'Selected Platform', optional: true) + ->param('sdk', null, new Nullable(new Text(256)), 'Selected SDK', optional: true) + ->param('version', null, new Nullable(new Text(256)), 'Selected SDK', optional: true) + ->param('git', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we use git push?', optional: true) + ->param('production', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we push to production?', optional: true) + ->param('message', null, new Nullable(new Text(256)), 'Commit Message', optional: true) + ->callback([$this, 'action']); } - public function action(): void + public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message): void { - $platforms = Config::getParam('platforms'); - $selectedPlatform = Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):'); - $selectedSDK = \strtolower(Console::confirm('Choose SDK ("*" for all):')); - $version = Console::confirm('Choose an Appwrite version'); - $git = (Console::confirm('Should we use git push? (yes/no)') == 'yes'); - $production = ($git) ? (Console::confirm('Type "Appwrite" to push code to production git repos') == 'Appwrite') : false; - $message = ($git) ? Console::confirm('Please enter your commit message:') : ''; + $selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):'); + $selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):')); + $version ??= Console::confirm('Choose an Appwrite version'); + + $git ??= Console::confirm('Should we use git push? (yes/no)'); + $git = $git === 'yes'; + + if ($git) { + $production ??= Console::confirm('Type "Appwrite" to push code to production git repos'); + $production = $production === 'Appwrite'; + $message ??= Console::confirm('Please enter your commit message:'); + } if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', '1.2.x', '1.3.x', '1.4.x', '1.5.x', '1.6.x', 'latest'])) { throw new \Exception('Unknown version given'); } + $platforms = Config::getParam('platforms'); foreach ($platforms as $key => $platform) { if ($selectedPlatform !== $key && $selectedPlatform !== '*') { continue; @@ -260,9 +275,13 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ cd ' . $target . ' && \ - git init --initial-branch=' . $gitBranch . ' && \ + git init && \ git remote add origin ' . $gitUrl . ' && \ - git fetch origin ' . $gitBranch . ' && \ + git fetch origin && \ + git checkout main || git checkout -b main && \ + git pull origin main && \ + git checkout ' . $gitBranch . ' || git checkout -b ' . $gitBranch . ' && \ + git fetch origin ' . $gitBranch . ' || git push -u origin ' . $gitBranch . ' && \ git pull origin ' . $gitBranch . ' && \ rm -rf ' . $target . '/* && \ cp -r ' . $result . '/. ' . $target . '/ && \ diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index a1b85c341f..dad2db0d9a 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -9,6 +9,7 @@ use Utopia\Database\DateTime; use Utopia\Database\Document; use Utopia\Database\Exception; use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; use Utopia\Platform\Action; use Utopia\Pools\Group; use Utopia\System\System; @@ -25,7 +26,7 @@ abstract class ScheduleBase extends Action abstract public static function getName(): string; abstract public static function getSupportedResource(): string; abstract public static function getCollectionId(): string; - abstract protected function enqueueResources(Group $pools, Database $dbForConsole, callable $getProjectDB): void; + abstract protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void; public function __construct() { @@ -34,9 +35,20 @@ abstract class ScheduleBase extends Action $this ->desc("Execute {$type}s scheduled in Appwrite") ->inject('pools') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('getProjectDB') - ->callback(fn (Group $pools, Database $dbForConsole, callable $getProjectDB) => $this->action($pools, $dbForConsole, $getProjectDB)); + ->callback(fn (Group $pools, Database $dbForPlatform, callable $getProjectDB) => $this->action($pools, $dbForPlatform, $getProjectDB)); + } + + protected function updateProjectAccess(Document $project, Database $dbForPlatform): void + { + if (!$project->isEmpty() && $project->getId() !== 'console') { + $accessedAt = $project->getAttribute('accessedAt', ''); + 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)); + } + } } /** @@ -44,7 +56,7 @@ abstract class ScheduleBase extends Action * 2. Create timer that sync all changes from 'schedules' collection to local copy. Only reading changes thanks to 'resourceUpdatedAt' attribute * 3. Create timer that prepares coroutines for soon-to-execute schedules. When it's ready, coroutine sleeps until exact time before sending request to worker. */ - public function action(Group $pools, Database $dbForConsole, callable $getProjectDB): void + public function action(Group $pools, Database $dbForPlatform, callable $getProjectDB): void { Console::title(\ucfirst(static::getSupportedResource()) . ' scheduler V1'); Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started'); @@ -56,8 +68,8 @@ abstract class ScheduleBase extends Action * @throws Exception * @var Document $schedule */ - $getSchedule = function (Document $schedule) use ($dbForConsole, $getProjectDB): array { - $project = $dbForConsole->getDocument('projects', $schedule->getAttribute('projectId')); + $getSchedule = function (Document $schedule) use ($dbForPlatform, $getProjectDB): array { + $project = $dbForPlatform->getDocument('projects', $schedule->getAttribute('projectId')); $resource = $getProjectDB($project)->getDocument( static::getCollectionId(), @@ -91,7 +103,7 @@ abstract class ScheduleBase extends Action $paginationQueries[] = Query::cursorAfter($latestDocument); } - $results = $dbForConsole->find('schedules', \array_merge($paginationQueries, [ + $results = $dbForPlatform->find('schedules', \array_merge($paginationQueries, [ Query::equal('region', [System::getEnv('_APP_REGION', 'default')]), Query::equal('resourceType', [static::getSupportedResource()]), Query::equal('active', [true]), @@ -119,11 +131,11 @@ abstract class ScheduleBase extends Action Console::success("Starting timers at " . DateTime::now()); - run(function () use ($dbForConsole, &$lastSyncUpdate, $getSchedule, $pools, $getProjectDB) { + run(function () use ($dbForPlatform, &$lastSyncUpdate, $getSchedule, $pools, $getProjectDB) { /** * The timer synchronize $schedules copy with database collection. */ - Timer::tick(static::UPDATE_TIMER * 1000, function () use ($dbForConsole, &$lastSyncUpdate, $getSchedule, $pools) { + Timer::tick(static::UPDATE_TIMER * 1000, function () use ($dbForPlatform, &$lastSyncUpdate, $getSchedule, $pools) { $time = DateTime::now(); $timerStart = \microtime(true); @@ -141,7 +153,7 @@ abstract class ScheduleBase extends Action $paginationQueries[] = Query::cursorAfter($latestDocument); } - $results = $dbForConsole->find('schedules', \array_merge($paginationQueries, [ + $results = $dbForPlatform->find('schedules', \array_merge($paginationQueries, [ Query::equal('region', [System::getEnv('_APP_REGION', 'default')]), Query::equal('resourceType', [static::getSupportedResource()]), Query::greaterThanEqual('resourceUpdatedAt', $lastSyncUpdate), @@ -179,10 +191,10 @@ abstract class ScheduleBase extends Action Timer::tick( static::ENQUEUE_TIMER * 1000, - fn () => $this->enqueueResources($pools, $dbForConsole, $getProjectDB) + fn () => $this->enqueueResources($pools, $dbForPlatform, $getProjectDB) ); - $this->enqueueResources($pools, $dbForConsole, $getProjectDB); + $this->enqueueResources($pools, $dbForPlatform, $getProjectDB); }); } } diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 73a2814397..086bad513e 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -27,7 +27,7 @@ class ScheduleExecutions extends ScheduleBase return 'executions'; } - protected function enqueueResources(Group $pools, Database $dbForConsole, callable $getProjectDB): void + protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void { $queue = $pools->get('queue')->pop(); $connection = $queue->getResource(); @@ -36,7 +36,7 @@ class ScheduleExecutions extends ScheduleBase foreach ($this->schedules as $schedule) { if (!$schedule['active']) { - $dbForConsole->deleteDocument( + $dbForPlatform->deleteDocument( 'schedules', $schedule['$id'], ); @@ -50,13 +50,15 @@ class ScheduleExecutions extends ScheduleBase continue; } - $data = $dbForConsole->getDocument( + $data = $dbForPlatform->getDocument( 'schedules', $schedule['$id'], )->getAttribute('data', []); $delay = $scheduledAt->getTimestamp() - (new \DateTime())->getTimestamp(); + $this->updateProjectAccess($schedule['project'], $dbForPlatform); + \go(function () use ($queueForFunctions, $schedule, $delay, $data) { Co::sleep($delay); @@ -74,7 +76,7 @@ class ScheduleExecutions extends ScheduleBase ->trigger(); }); - $dbForConsole->deleteDocument( + $dbForPlatform->deleteDocument( 'schedules', $schedule['$id'], ); diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 4d57902330..c443bb6c2d 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -31,7 +31,7 @@ class ScheduleFunctions extends ScheduleBase return 'functions'; } - protected function enqueueResources(Group $pools, Database $dbForConsole, callable $getProjectDB): void + protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void { $timerStart = \microtime(true); $time = DateTime::now(); @@ -70,7 +70,7 @@ class ScheduleFunctions extends ScheduleBase } foreach ($delayedExecutions as $delay => $scheduleKeys) { - \go(function () use ($delay, $scheduleKeys, $pools) { + \go(function () use ($delay, $scheduleKeys, $pools, $dbForPlatform) { \sleep($delay); // in seconds $queue = $pools->get('queue')->pop(); @@ -84,6 +84,8 @@ class ScheduleFunctions extends ScheduleBase $schedule = $this->schedules[$scheduleKey]; + $this->updateProjectAccess($schedule['project'], $dbForPlatform); + $queueForFunctions = new Func($connection); $queueForFunctions diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index b9d8e2a282..5d997fc5bb 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -26,7 +26,7 @@ class ScheduleMessages extends ScheduleBase return 'messages'; } - protected function enqueueResources(Group $pools, Database $dbForConsole, callable $getProjectDB): void + protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void { foreach ($this->schedules as $schedule) { if (!$schedule['active']) { @@ -40,18 +40,20 @@ class ScheduleMessages extends ScheduleBase continue; } - \go(function () use ($schedule, $pools, $dbForConsole) { + \go(function () use ($schedule, $pools, $dbForPlatform) { $queue = $pools->get('queue')->pop(); $connection = $queue->getResource(); $queueForMessaging = new Messaging($connection); + $this->updateProjectAccess($schedule['project'], $dbForPlatform); + $queueForMessaging ->setType(MESSAGE_SEND_TYPE_EXTERNAL) ->setMessageId($schedule['resourceId']) ->setProject($schedule['project']) ->trigger(); - $dbForConsole->deleteDocument( + $dbForPlatform->deleteDocument( 'schedules', $schedule['$id'], ); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index f71de98d95..4d7fd5d695 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Tasks; +use Appwrite\SDK\AuthType; use Appwrite\Specification\Format\OpenAPI3; use Appwrite\Specification\Format\Swagger2; use Appwrite\Specification\Specification; @@ -61,7 +62,7 @@ class Specs extends Action // Mock dependencies App::setResource('request', fn () => $this->getRequest()); App::setResource('response', fn () => $response); - App::setResource('dbForConsole', fn () => new Database(new MySQL(''), new Cache(new None()))); + App::setResource('dbForPlatform', fn () => new Database(new MySQL(''), new Cache(new None()))); App::setResource('dbForProject', fn () => new Database(new MySQL(''), new Cache(new None()))); $platforms = [ @@ -182,56 +183,69 @@ class Specs extends Action foreach ($appRoutes as $key => $method) { foreach ($method as $route) { - $hide = $route->getLabel('sdk.hide', false); - if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { + $sdks = $route->getLabel('sdk', false); + + if (empty($sdks)) { continue; } - /** @var \Utopia\Route $route */ - $routeSecurity = $route->getLabel('sdk.auth', []); - $sdkPlatforms = []; + if (!\is_array($sdks)) { + $sdks = [$sdks]; + } - foreach ($routeSecurity as $value) { - switch ($value) { - case APP_AUTH_TYPE_SESSION: - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - break; - case APP_AUTH_TYPE_JWT: - case APP_AUTH_TYPE_KEY: - $sdkPlatforms[] = APP_PLATFORM_SERVER; - break; - case APP_AUTH_TYPE_ADMIN: - $sdkPlatforms[] = APP_PLATFORM_CONSOLE; - break; + foreach ($sdks as $sdk) { + /** @var \Appwrite\SDK\Method $sdks */ + + $hide = $sdk->isHidden(); + if ($hide === true || (\is_array($hide) && \in_array($platform, $hide))) { + continue; } - } - if (empty($routeSecurity)) { - $sdkPlatforms[] = APP_PLATFORM_SERVER; - $sdkPlatforms[] = APP_PLATFORM_CLIENT; - } + $routeSecurity = $sdk->getAuth(); + $sdkPlatforms = []; - if (!$route->getLabel('docs', true)) { - continue; - } + foreach ($routeSecurity as $value) { + switch ($value) { + case AuthType::SESSION: + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + break; + case AuthType::JWT: + case AuthType::KEY: + $sdkPlatforms[] = APP_PLATFORM_SERVER; + break; + case AuthType::ADMIN: + $sdkPlatforms[] = APP_PLATFORM_CONSOLE; + break; + } + } - if ($route->getLabel('sdk.mock', false) && !$mocks) { - continue; - } + if (empty($routeSecurity)) { + $sdkPlatforms[] = APP_PLATFORM_SERVER; + $sdkPlatforms[] = APP_PLATFORM_CLIENT; + } - if (!$route->getLabel('sdk.mock', false) && $mocks) { - continue; - } + if (!$route->getLabel('docs', true)) { + continue; + } - if (empty($route->getLabel('sdk.namespace', null))) { - continue; - } + if ($route->getLabel('mock', false) && !$mocks) { + continue; + } - if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { - continue; - } + if (!$route->getLabel('mock', false) && $mocks) { + continue; + } - $routes[] = $route; + if (empty($sdk->getNamespace())) { + continue; + } + + if ($platform !== APP_PLATFORM_CONSOLE && !\in_array($platforms[$platform], $sdkPlatforms)) { + continue; + } + + $routes[] = $route; + } } } diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 86ca59d3fd..c0bcab1c3a 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Workers; +use Appwrite\Auth\Auth; use Exception; use Throwable; use Utopia\Audit\Audit; @@ -60,6 +61,7 @@ class Audits extends Action $userName = $user->getAttribute('name', ''); $userEmail = $user->getAttribute('email', ''); + $userType = $user->getAttribute('type', Auth::ACTIVITY_TYPE_USER); $audit = new Audit($dbForProject); $audit->log( @@ -74,6 +76,7 @@ class Audits extends Action 'userId' => $user->getId(), 'userName' => $userName, 'userEmail' => $userEmail, + 'userType' => $userType, 'mode' => $mode, 'data' => $auditPayload, ] diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index 5dd2f7f886..4f5d6eb694 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -46,7 +46,8 @@ class Builds extends Action $this ->desc('Builds worker') ->inject('message') - ->inject('dbForConsole') + ->inject('project') + ->inject('dbForPlatform') ->inject('queueForEvents') ->inject('queueForFunctions') ->inject('queueForUsage') @@ -54,12 +55,13 @@ class Builds extends Action ->inject('dbForProject') ->inject('deviceForFunctions') ->inject('log') - ->callback(fn ($message, Database $dbForConsole, Event $queueForEvents, Func $queueForFunctions, Usage $usage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, Log $log) => $this->action($message, $dbForConsole, $queueForEvents, $queueForFunctions, $usage, $cache, $dbForProject, $deviceForFunctions, $log)); + ->callback(fn ($message, Document $project, Database $dbForPlatform, Event $queueForEvents, Func $queueForFunctions, Usage $usage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, Log $log) => $this->action($message, $project, $dbForPlatform, $queueForEvents, $queueForFunctions, $usage, $cache, $dbForProject, $deviceForFunctions, $log)); } /** * @param Message $message - * @param Database $dbForConsole + * @param Document $project + * @param Database $dbForPlatform * @param Event $queueForEvents * @param Func $queueForFunctions * @param Usage $queueForUsage @@ -70,7 +72,7 @@ class Builds extends Action * @return void * @throws \Utopia\Database\Exception */ - public function action(Message $message, Database $dbForConsole, Event $queueForEvents, Func $queueForFunctions, Usage $queueForUsage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, Log $log): void + public function action(Message $message, Document $project, Database $dbForPlatform, Event $queueForEvents, Func $queueForFunctions, Usage $queueForUsage, Cache $cache, Database $dbForProject, Device $deviceForFunctions, Log $log): void { $payload = $message->getPayload() ?? []; @@ -79,7 +81,6 @@ class Builds extends Action } $type = $payload['type'] ?? ''; - $project = new Document($payload['project'] ?? []); $resource = new Document($payload['resource'] ?? []); $deployment = new Document($payload['deployment'] ?? []); $template = new Document($payload['template'] ?? []); @@ -92,7 +93,7 @@ class Builds extends Action case BUILD_TYPE_RETRY: Console::info('Creating build for deployment: ' . $deployment->getId()); $github = new GitHub($cache); - $this->buildDeployment($deviceForFunctions, $queueForFunctions, $queueForEvents, $queueForUsage, $dbForConsole, $dbForProject, $github, $project, $resource, $deployment, $template, $log); + $this->buildDeployment($deviceForFunctions, $queueForFunctions, $queueForEvents, $queueForUsage, $dbForPlatform, $dbForProject, $github, $project, $resource, $deployment, $template, $log); break; default: @@ -105,7 +106,7 @@ class Builds extends Action * @param Func $queueForFunctions * @param Event $queueForEvents * @param Usage $queueForUsage - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Database $dbForProject * @param GitHub $github * @param Document $project @@ -117,7 +118,7 @@ class Builds extends Action * @throws \Utopia\Database\Exception * @throws Exception */ - protected function buildDeployment(Device $deviceForFunctions, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Database $dbForConsole, Database $dbForProject, GitHub $github, Document $project, Document $function, Document $deployment, Document $template, Log $log): void + protected function buildDeployment(Device $deviceForFunctions, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Database $dbForPlatform, Database $dbForProject, GitHub $github, Document $project, Document $function, Document $deployment, Document $template, Log $log): void { $executor = new Executor(System::getEnv('_APP_EXECUTOR_HOST')); @@ -199,7 +200,7 @@ class Builds extends Action $repositoryName = ''; if ($isVcsEnabled) { - $installation = $dbForConsole->getDocument('installations', $installationId); + $installation = $dbForPlatform->getDocument('installations', $installationId); $providerInstallationId = $installation->getAttribute('providerInstallationId'); $privateKey = System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'); $githubAppId = System::getEnv('_APP_VCS_GITHUB_APP_ID'); @@ -209,8 +210,7 @@ class Builds extends Action try { if ($isNewBuild && !$isVcsEnabled) { - // Non-vcs+Template - + // Non-VCS + Template $templateRepositoryName = $template->getAttribute('repositoryName', ''); $templateOwnerName = $template->getAttribute('ownerName', ''); $templateVersion = $template->getAttribute('version', ''); @@ -233,6 +233,8 @@ class Builds extends Action throw new \Exception('Unable to clone code repository: ' . $stderr); } + Console::execute('find ' . \escapeshellarg($tmpTemplateDirectory) . ' -type d -name ".git" -exec rm -rf {} +', '', $stdout, $stderr); + // Ensure directories Console::execute('mkdir -p ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory), '', $stdout, $stderr); @@ -398,6 +400,8 @@ class Builds extends Action throw new \Exception('Repository directory size should be less than ' . number_format($functionsSizeLimit / 1048576, 2) . ' MBs.'); } + Console::execute('find ' . \escapeshellarg($tmpDirectory) . ' -type d -name ".git" -exec rm -rf {} +', '', $stdout, $stderr); + $tarParamDirectory = '/tmp/builds/' . $buildId . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory); Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellcmd($tarParamDirectory) . ' .', '', $stdout, $stderr); // TODO: Replace escapeshellcmd with escapeshellarg if we find a way that doesnt break syntax @@ -415,7 +419,7 @@ class Builds extends Action $directorySize = $deviceForFunctions->getFileSize($source); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment->setAttribute('path', $source)->setAttribute('size', $directorySize)); - $this->runGitAction('processing', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForConsole); + $this->runGitAction('processing', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForPlatform); } /** Request the executor to build the code... */ @@ -423,7 +427,7 @@ class Builds extends Action $build = $dbForProject->updateDocument('builds', $buildId, $build); if ($isVcsEnabled) { - $this->runGitAction('building', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForConsole); + $this->runGitAction('building', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForPlatform); } /** Trigger Webhook */ @@ -637,7 +641,7 @@ class Builds extends Action $build = $dbForProject->updateDocument('builds', $buildId, $build); if ($isVcsEnabled) { - $this->runGitAction('ready', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForConsole); + $this->runGitAction('ready', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForPlatform); } Console::success("Build id: $buildId created"); @@ -658,12 +662,12 @@ class Builds extends Action /** Update function schedule */ // Inform scheduler if function is still active - $schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId')); + $schedule = $dbForPlatform->getDocument('schedules', $function->getAttribute('scheduleId')); $schedule ->setAttribute('resourceUpdatedAt', DateTime::now()) ->setAttribute('schedule', $function->getAttribute('schedule')) ->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment'))); - Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); } catch (\Throwable $th) { if ($dbForProject->getDocument('builds', $buildId)->getAttribute('status') === 'canceled') { Console::info('Build has been canceled'); @@ -680,7 +684,7 @@ class Builds extends Action $build = $dbForProject->updateDocument('builds', $buildId, $build); if ($isVcsEnabled) { - $this->runGitAction('failed', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForConsole); + $this->runGitAction('failed', $github, $providerCommitHash, $owner, $repositoryName, $project, $function, $deployment->getId(), $dbForProject, $dbForPlatform); } } finally { /** @@ -739,7 +743,7 @@ class Builds extends Action * @param Document $function * @param string $deploymentId * @param Database $dbForProject - * @param Database $dbForConsole + * @param Database $dbForPlatform * @return void * @throws Structure * @throws \Utopia\Database\Exception @@ -747,7 +751,7 @@ class Builds extends Action * @throws Conflict * @throws Restricted */ - protected function runGitAction(string $status, GitHub $github, string $providerCommitHash, string $owner, string $repositoryName, Document $project, Document $function, string $deploymentId, Database $dbForProject, Database $dbForConsole): void + protected function runGitAction(string $status, GitHub $github, string $providerCommitHash, string $owner, string $repositoryName, Document $project, Document $function, string $deploymentId, Database $dbForProject, Database $dbForPlatform): void { if ($function->getAttribute('providerSilentMode', false) === true) { return; @@ -792,7 +796,7 @@ class Builds extends Action $retries++; try { - $dbForConsole->createDocument('vcsCommentLocks', new Document([ + $dbForPlatform->createDocument('vcsCommentLocks', new Document([ '$id' => $commentId ])); break; @@ -812,7 +816,7 @@ class Builds extends Action $comment->addBuild($project, $function, $status, $deployment->getId(), ['type' => 'logs']); $github->updateComment($owner, $repositoryName, $commentId, $comment->generateComment()); } finally { - $dbForConsole->deleteDocument('vcsCommentLocks', $commentId); + $dbForPlatform->deleteDocument('vcsCommentLocks', $commentId); } } } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 58dc1dd28a..e763cb54ee 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Workers; +use Appwrite\Certificates\Adapter as CertificatesAdapter; use Appwrite\Event\Event; use Appwrite\Event\Func; use Appwrite\Event\Mail; @@ -11,7 +12,6 @@ use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model\Rule; use Exception; use Throwable; -use Utopia\App; use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -43,26 +43,31 @@ class Certificates extends Action $this ->desc('Certificates worker') ->inject('message') - ->inject('dbForConsole') + ->inject('dbForPlatform') ->inject('queueForMails') ->inject('queueForEvents') ->inject('queueForFunctions') ->inject('log') - ->callback(fn (Message $message, Database $dbForConsole, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log) => $this->action($message, $dbForConsole, $queueForMails, $queueForEvents, $queueForFunctions, $log)); + ->inject('certificates') + ->callback( + fn (Message $message, Database $dbForPlatform, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log, CertificatesAdapter $certificates) => + $this->action($message, $dbForPlatform, $queueForMails, $queueForEvents, $queueForFunctions, $log, $certificates) + ); } /** * @param Message $message - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Mail $queueForMails * @param Event $queueForEvents * @param Func $queueForFunctions * @param Log $log + * @param CertificatesAdapter $certificates * @return void * @throws Throwable * @throws \Utopia\Database\Exception */ - public function action(Message $message, Database $dbForConsole, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log): void + public function action(Message $message, Database $dbForPlatform, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log, CertificatesAdapter $certificates): void { $payload = $message->getPayload() ?? []; @@ -76,33 +81,33 @@ class Certificates extends Action $log->addTag('domain', $domain->get()); - $this->execute($domain, $dbForConsole, $queueForMails, $queueForEvents, $queueForFunctions, $log, $skipRenewCheck); + $this->execute($domain, $dbForPlatform, $queueForMails, $queueForEvents, $queueForFunctions, $log, $certificates, $skipRenewCheck); } /** * @param Domain $domain - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Mail $queueForMails * @param Event $queueForEvents * @param Func $queueForFunctions + * @param CertificatesAdapter $certificates * @param bool $skipRenewCheck * @return void * @throws Throwable * @throws \Utopia\Database\Exception */ - private function execute(Domain $domain, Database $dbForConsole, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log, bool $skipRenewCheck = false): void + private function execute(Domain $domain, Database $dbForPlatform, Mail $queueForMails, Event $queueForEvents, Func $queueForFunctions, Log $log, CertificatesAdapter $certificates, bool $skipRenewCheck = false): void { /** * 1. Read arguments and validate domain * 2. Get main domain * 3. Validate CNAME DNS if parameter is not main domain (meaning it's custom domain) - * 4. Validate security email. Cannot be empty, required by LetsEncrypt - * 5. Validate renew date with certificate file, unless requested to skip by parameter - * 6. Issue a certificate using certbot CLI - * 7. Update 'log' attribute on certificate document with Certbot message - * 8. Create storage folder for certificate, if not ready already - * 9. Move certificates from Certbot location to our Storage - * 10. Create/Update our Storage with new Traefik config with new certificate paths + * 4. Validate renew date with certificate file, unless requested to skip by parameter + * 5. Issue a certificate using certbot CLI + * 6. Update 'log' attribute on certificate document with Certbot message + * 7. Create storage folder for certificate, if not ready already + * 8. Move certificates from Certbot location to our Storage + * 9. Create/Update our Storage with new Traefik config with new certificate paths * 11. Read certificate file and update 'renewDate' on certificate document * 12. Update 'issueDate' and 'attempts' on certificate * @@ -119,14 +124,14 @@ class Certificates extends Action * 2. Save document to database * 3. Update all domains documents with current certificate ID * - * Note: Renewals are checked and scheduled from maintenence worker + * Note: Renewals are checked and scheduled from maintenance worker */ // Get current certificate - $certificate = $dbForConsole->findOne('certificates', [Query::equal('domain', [$domain->get()])]); + $certificate = $dbForPlatform->findOne('certificates', [Query::equal('domain', [$domain->get()])]); // If we don't have certificate for domain yet, let's create new document. At the end we save it - if (!$certificate) { + if ($certificate->isEmpty()) { $certificate = new Document(); $certificate->setAttribute('domain', $domain->get()); } @@ -134,40 +139,28 @@ class Certificates extends Action $success = false; try { - // Email for alerts is required by LetsEncrypt - $email = System::getEnv('_APP_EMAIL_CERTIFICATES', System::getEnv('_APP_SYSTEM_SECURITY_EMAIL_ADDRESS')); - if (empty($email)) { - throw new Exception('You must set a valid security email address (_APP_EMAIL_CERTIFICATES) to issue an SSL certificate.'); - } - // Validate domain and DNS records. Skip if job is forced if (!$skipRenewCheck) { $mainDomain = $this->getMainDomain(); $isMainDomain = !isset($mainDomain) || $domain->get() === $mainDomain; $this->validateDomain($domain, $isMainDomain, $log); + + // If certificate exists already, double-check expiry date. Skip if job is forced + if (!$certificates->isRenewRequired($domain->get(), $log)) { + Console::info("Skipping, renew isn't required"); + return; + } } - // If certificate exists already, double-check expiry date. Skip if job is forced - if (!$skipRenewCheck && !$this->isRenewRequired($domain->get(), $log)) { - throw new Exception('Renew isn\'t required.'); - } - - // Prepare folder name for certbot. Using this helps prevent miss-match in LetsEncrypt configuration when renewing certificate - $folder = ID::unique(); - - // Generate certificate files using Let's Encrypt - $letsEncryptData = $this->issueCertificate($folder, $domain->get(), $email); + // Prepare unique cert name. Using this helps prevent miss-match in configuration when renewing certificates. + $certName = ID::unique(); + $renewDate = $certificates->issueCertificate($certName, $domain->get()); // Command succeeded, store all data into document - $logs = 'Certificate successfully generated.'; - $certificate->setAttribute('logs', \mb_strcut($logs, 0, 1000000));// Limit to 1MB - - - // Give certificates to Traefik - $this->applyCertificateFiles($folder, $domain->get(), $letsEncryptData); + $certificate->setAttribute('logs', 'Certificate successfully generated.'); // Update certificate info stored in database - $certificate->setAttribute('renewDate', $this->getRenewDate($domain->get())); + $certificate->setAttribute('renewDate', $renewDate); $certificate->setAttribute('attempts', 0); $certificate->setAttribute('issueDate', DateTime::now()); $success = true; @@ -181,7 +174,7 @@ class Certificates extends Action $attempts = $certificate->getAttribute('attempts', 0) + 1; $certificate->setAttribute('attempts', $attempts); - // Store cuttent time as renew date to ensure another attempt in next maintenance cycle + // Store current time as renew date to ensure another attempt in next maintenance cycle. $certificate->setAttribute('renewDate', DateTime::now()); // Send email to security email @@ -193,7 +186,7 @@ class Certificates extends Action $certificate->setAttribute('updated', DateTime::now()); // Save all changes we made to certificate document into database - $this->saveCertificateDocument($domain->get(), $certificate, $success, $dbForConsole, $queueForEvents, $queueForFunctions); + $this->saveCertificateDocument($domain->get(), $certificate, $success, $dbForPlatform, $queueForEvents, $queueForFunctions); } } @@ -203,7 +196,7 @@ class Certificates extends Action * @param string $domain Domain name that certificate is for * @param Document $certificate Certificate document that we need to save * @param bool $success - * @param Database $dbForConsole Database connection for console + * @param Database $dbForPlatform Database connection for console * @param Event $queueForEvents * @param Func $queueForFunctions * @return void @@ -212,21 +205,21 @@ class Certificates extends Action * @throws Conflict * @throws Structure */ - private function saveCertificateDocument(string $domain, Document $certificate, bool $success, Database $dbForConsole, Event $queueForEvents, Func $queueForFunctions): void + private function saveCertificateDocument(string $domain, Document $certificate, bool $success, Database $dbForPlatform, Event $queueForEvents, Func $queueForFunctions): void { // Check if update or insert required - $certificateDocument = $dbForConsole->findOne('certificates', [Query::equal('domain', [$domain])]); - if (!empty($certificateDocument) && !$certificateDocument->isEmpty()) { + $certificateDocument = $dbForPlatform->findOne('certificates', [Query::equal('domain', [$domain])]); + if (!$certificateDocument->isEmpty()) { // Merge new data with current data $certificate = new Document(\array_merge($certificateDocument->getArrayCopy(), $certificate->getArrayCopy())); - $certificate = $dbForConsole->updateDocument('certificates', $certificate->getId(), $certificate); + $certificate = $dbForPlatform->updateDocument('certificates', $certificate->getId(), $certificate); } else { $certificate->removeAttribute('$internalId'); - $certificate = $dbForConsole->createDocument('certificates', $certificate); + $certificate = $dbForPlatform->createDocument('certificates', $certificate); } $certificateId = $certificate->getId(); - $this->updateDomainDocuments($certificateId, $domain, $success, $dbForConsole, $queueForEvents, $queueForFunctions); + $this->updateDomainDocuments($certificateId, $domain, $success, $dbForPlatform, $queueForEvents, $queueForFunctions); } /** @@ -245,8 +238,8 @@ class Certificates extends Action } /** - * Internal domain validation functionality to prevent unnecessary attempts failed from Let's Encrypt side. We check: - * - Domain needs to be public and valid (prevents NFT domains that are not supported by Let's Encrypt) + * Internal domain validation functionality to prevent unnecessary attempts. We check: + * - Domain needs to be public and valid (prevents NFT domains that are not supported) * - Domain must have proper DNS record * * @param Domain $domain Domain which we validate @@ -292,136 +285,6 @@ class Certificates extends Action } } - /** - * Reads expiry date of certificate from file and decides if renewal is required or not. - * - * @param string $domain Domain for which we check certificate file - * @return bool True, if certificate needs to be renewed - * @throws Exception - */ - private function isRenewRequired(string $domain, Log $log): bool - { - $certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem'; - if (\file_exists($certPath)) { - $validTo = null; - - $certData = openssl_x509_parse(file_get_contents($certPath)); - $validTo = $certData['validTo_time_t'] ?? 0; - - if (empty($validTo)) { - $log->addTag('certificateDomain', $domain); - throw new Exception('Unable to read certificate file (cert.pem).'); - } - - // LetsEncrypt allows renewal 30 days before expiry - $expiryInAdvance = (60 * 60 * 24 * 30); - if ($validTo - $expiryInAdvance > \time()) { - $log->addTag('certificateDomain', $domain); - $log->addExtra('certificateData', \is_array($certData) ? \json_encode($certData) : \strval($certData)); - return false; - } - } - - return true; - } - - /** - * LetsEncrypt communication to issue certificate (using certbot CLI) - * - * @param string $folder Folder into which certificates should be generated - * @param string $domain Domain to generate certificate for - * @return array Named array with keys 'stdout' and 'stderr', both string - * @throws Exception - */ - private function issueCertificate(string $folder, string $domain, string $email): array - { - $stdout = ''; - $stderr = ''; - - $staging = (App::isProduction()) ? '' : ' --dry-run'; - $exit = Console::execute("certbot certonly -v --webroot --noninteractive --agree-tos{$staging}" - . " --email " . $email - . " --cert-name " . $folder - . " -w " . APP_STORAGE_CERTIFICATES - . " -d {$domain}", '', $stdout, $stderr); - - // Unexpected error, usually 5XX, API limits, ... - if ($exit !== 0) { - throw new Exception('Failed to issue a certificate with message: ' . $stderr); - } - - return [ - 'stdout' => $stdout, - 'stderr' => $stderr - ]; - } - - /** - * Read new renew date from certificate file generated by Let's Encrypt - * - * @param string $domain Domain which certificate was generated for - * @return string - * @throws \Utopia\Database\Exception - */ - private function getRenewDate(string $domain): string - { - $certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem'; - $certData = openssl_x509_parse(file_get_contents($certPath)); - $validTo = $certData['validTo_time_t'] ?? null; - $dt = (new \DateTime())->setTimestamp($validTo); - return DateTime::addSeconds($dt, -60 * 60 * 24 * 30); // -30 days - } - - /** - * Method to take files from Let's Encrypt, and put it into Traefik. - * - * @param string $domain Domain which certificate was generated for - * @param string $folder Folder in which certificates were generated - * @param array $letsEncryptData Let's Encrypt logs to use for additional info when throwing error - * @return void - * @throws Exception - */ - private function applyCertificateFiles(string $folder, string $domain, array $letsEncryptData): void - { - - // Prepare folder in storage for domain - $path = APP_STORAGE_CERTIFICATES . '/' . $domain; - if (!\is_readable($path)) { - if (!\mkdir($path, 0755, true)) { - throw new Exception('Failed to create path for certificate.'); - } - } - - // Move generated files - if (!@\rename('/etc/letsencrypt/live/' . $folder . '/cert.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem')) { - throw new Exception('Failed to rename certificate cert.pem. Let\'s Encrypt log: ' . $letsEncryptData['stderr'] . ' ; ' . $letsEncryptData['stdout']); - } - - if (!@\rename('/etc/letsencrypt/live/' . $folder . '/chain.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/chain.pem')) { - throw new Exception('Failed to rename certificate chain.pem. Let\'s Encrypt log: ' . $letsEncryptData['stderr'] . ' ; ' . $letsEncryptData['stdout']); - } - - if (!@\rename('/etc/letsencrypt/live/' . $folder . '/fullchain.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/fullchain.pem')) { - throw new Exception('Failed to rename certificate fullchain.pem. Let\'s Encrypt log: ' . $letsEncryptData['stderr'] . ' ; ' . $letsEncryptData['stdout']); - } - - if (!@\rename('/etc/letsencrypt/live/' . $folder . '/privkey.pem', APP_STORAGE_CERTIFICATES . '/' . $domain . '/privkey.pem')) { - throw new Exception('Failed to rename certificate privkey.pem. Let\'s Encrypt log: ' . $letsEncryptData['stderr'] . ' ; ' . $letsEncryptData['stdout']); - } - - $config = \implode(PHP_EOL, [ - "tls:", - " certificates:", - " - certFile: /storage/certificates/{$domain}/fullchain.pem", - " keyFile: /storage/certificates/{$domain}/privkey.pem" - ]); - - // Save configuration into Traefik using our new cert files - if (!\file_put_contents(APP_STORAGE_CONFIG . '/' . $domain . '.yml', $config)) { - throw new Exception('Failed to save Traefik configuration.'); - } - } - /** * Method to make sure information about error is delivered to admnistrator. * @@ -475,17 +338,21 @@ class Certificates extends Action * * @return void */ - private function updateDomainDocuments(string $certificateId, string $domain, bool $success, Database $dbForConsole, Event $queueForEvents, Func $queueForFunctions): void + private function updateDomainDocuments(string $certificateId, string $domain, bool $success, Database $dbForPlatform, Event $queueForEvents, Func $queueForFunctions): void { + // TODO: @christyjacob remove once we migrate the rules in 1.7.x + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $rule = $dbForPlatform->getDocument('rules', md5($domain)); + } else { + $rule = $dbForPlatform->findOne('rules', [ + Query::equal('domain', [$domain]), + ]); + } - $rule = $dbForConsole->findOne('rules', [ - Query::equal('domain', [$domain]), - ]); - - if ($rule !== false && !$rule->isEmpty()) { + if (!$rule->isEmpty()) { $rule->setAttribute('certificateId', $certificateId); $rule->setAttribute('status', $success ? 'verified' : 'unverified'); - $dbForConsole->updateDocument('rules', $rule->getId(), $rule); + $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); $projectId = $rule->getAttribute('projectId'); @@ -494,7 +361,11 @@ class Certificates extends Action return; } - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); + + if ($project->isEmpty()) { + return; + } /** Trigger Webhook */ $ruleModel = new Rule(); diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index f697e7be13..441b09b4cc 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -11,6 +11,7 @@ use Utopia\Database\Document; use Utopia\Database\Exception as DatabaseException; use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; +use Utopia\Database\Exception\NotFound; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; @@ -33,21 +34,23 @@ class Databases extends Action $this ->desc('Databases worker') ->inject('message') - ->inject('dbForConsole') + ->inject('project') + ->inject('dbForPlatform') ->inject('dbForProject') ->inject('log') - ->callback(fn (Message $message, Database $dbForConsole, Database $dbForProject, Log $log) => $this->action($message, $dbForConsole, $dbForProject, $log)); + ->callback(fn (Message $message, Document $project, Database $dbForPlatform, Database $dbForProject, Log $log) => $this->action($message, $project, $dbForPlatform, $dbForProject, $log)); } /** * @param Message $message - * @param Database $dbForConsole + * @param Document $project + * @param Database $dbForPlatform * @param Database $dbForProject * @param Log $log * @return void * @throws \Exception */ - public function action(Message $message, Database $dbForConsole, Database $dbForProject, Log $log): void + public function action(Message $message, Document $project, Database $dbForPlatform, Database $dbForProject, Log $log): void { $payload = $message->getPayload() ?? []; @@ -56,7 +59,6 @@ class Databases extends Action } $type = $payload['type']; - $project = new Document($payload['project']); $collection = new Document($payload['collection'] ?? []); $document = new Document($payload['document'] ?? []); $database = new Document($payload['database'] ?? []); @@ -73,10 +75,10 @@ class Databases extends Action match (\strval($type)) { DATABASE_TYPE_DELETE_DATABASE => $this->deleteDatabase($database, $project, $dbForProject), DATABASE_TYPE_DELETE_COLLECTION => $this->deleteCollection($database, $collection, $project, $dbForProject), - DATABASE_TYPE_CREATE_ATTRIBUTE => $this->createAttribute($database, $collection, $document, $project, $dbForConsole, $dbForProject), - DATABASE_TYPE_DELETE_ATTRIBUTE => $this->deleteAttribute($database, $collection, $document, $project, $dbForConsole, $dbForProject), - DATABASE_TYPE_CREATE_INDEX => $this->createIndex($database, $collection, $document, $project, $dbForConsole, $dbForProject), - DATABASE_TYPE_DELETE_INDEX => $this->deleteIndex($database, $collection, $document, $project, $dbForConsole, $dbForProject), + DATABASE_TYPE_CREATE_ATTRIBUTE => $this->createAttribute($database, $collection, $document, $project, $dbForPlatform, $dbForProject), + DATABASE_TYPE_DELETE_ATTRIBUTE => $this->deleteAttribute($database, $collection, $document, $project, $dbForPlatform, $dbForProject), + DATABASE_TYPE_CREATE_INDEX => $this->createIndex($database, $collection, $document, $project, $dbForPlatform, $dbForProject), + DATABASE_TYPE_DELETE_INDEX => $this->deleteIndex($database, $collection, $document, $project, $dbForPlatform, $dbForProject), default => throw new \Exception('No database operation for type: ' . \strval($type)), }; } @@ -86,14 +88,15 @@ class Databases extends Action * @param Document $collection * @param Document $attribute * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Database $dbForProject * @return void * @throws Authorization * @throws Conflict * @throws \Exception + * @throws \Throwable */ - private function createAttribute(Document $database, Document $collection, Document $attribute, Document $project, Database $dbForConsole, Database $dbForProject): void + private function createAttribute(Document $database, Document $collection, Document $attribute, Document $project, Database $dbForPlatform, Database $dbForProject): void { if ($collection->isEmpty()) { throw new Exception('Missing collection'); @@ -132,8 +135,10 @@ class Databases extends Action $formatOptions = $attribute->getAttribute('formatOptions', []); $filters = $attribute->getAttribute('filters', []); $options = $attribute->getAttribute('options', []); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); + $relatedAttribute = new Document(); + $relatedCollection = new Document(); try { switch ($type) { @@ -170,12 +175,11 @@ class Databases extends Action $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'available')); } catch (\Throwable $e) { - // TODO: Send non DatabaseExceptions to Sentry Console::error($e->getMessage()); if ($e instanceof DatabaseException) { $attribute->setAttribute('error', $e->getMessage()); - if (isset($relatedAttribute)) { + if (! $relatedAttribute->isEmpty()) { $relatedAttribute->setAttribute('error', $e->getMessage()); } } @@ -186,22 +190,24 @@ class Databases extends Action $attribute->setAttribute('status', 'failed') ); - if (isset($relatedAttribute)) { + if (! $relatedAttribute->isEmpty()) { $dbForProject->updateDocument( 'attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'failed') ); } + + throw $e; } finally { $this->trigger($database, $collection, $attribute, $project, $projectId, $events); - } - if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); - } + if (! $relatedCollection->isEmpty()) { + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); + } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + } } /** @@ -209,14 +215,15 @@ class Databases extends Action * @param Document $collection * @param Document $attribute * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Database $dbForProject * @return void * @throws Authorization * @throws Conflict * @throws \Exception + * @throws \Throwable **/ - private function deleteAttribute(Document $database, Document $collection, Document $attribute, Document $project, Database $dbForConsole, Database $dbForProject): void + private function deleteAttribute(Document $database, Document $collection, Document $attribute, Document $project, Database $dbForPlatform, Database $dbForProject): void { if ($collection->isEmpty()) { throw new Exception('Missing collection'); @@ -236,7 +243,7 @@ class Databases extends Action $key = $attribute->getAttribute('key', ''); $status = $attribute->getAttribute('status', ''); $type = $attribute->getAttribute('type', ''); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); $options = $attribute->getAttribute('options', []); $relatedAttribute = new Document(); $relatedCollection = new Document(); @@ -248,7 +255,7 @@ class Databases extends Action // - stuck: attribute was available but cannot be removed try { - if ($status !== 'failed') { + try { if ($type === Database::VAR_RELATIONSHIP) { if ($options['twoWay']) { $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']); @@ -265,96 +272,105 @@ class Databases extends Action } elseif (!$dbForProject->deleteAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) { throw new DatabaseException('Failed to delete Attribute'); } - } - $dbForProject->deleteDocument('attributes', $attribute->getId()); + $dbForProject->deleteDocument('attributes', $attribute->getId()); - if (!$relatedAttribute->isEmpty()) { - $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); - } - } catch (\Throwable $e) { - // TODO: Send non DatabaseExceptions to Sentry - Console::error($e->getMessage()); - - if ($e instanceof DatabaseException) { - $attribute->setAttribute('error', $e->getMessage()); if (!$relatedAttribute->isEmpty()) { - $relatedAttribute->setAttribute('error', $e->getMessage()); + $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); + } + + } catch (NotFound $e) { + Console::error($e->getMessage()); + + $dbForProject->deleteDocument('attributes', $attribute->getId()); + + if (!$relatedAttribute->isEmpty()) { + $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); + } + + } catch (\Throwable $e) { + Console::error($e->getMessage()); + + if ($e instanceof DatabaseException) { + $attribute->setAttribute('error', $e->getMessage()); + if (!$relatedAttribute->isEmpty()) { + $relatedAttribute->setAttribute('error', $e->getMessage()); + } } - } - $dbForProject->updateDocument( - 'attributes', - $attribute->getId(), - $attribute->setAttribute('status', 'stuck') - ); - if (!$relatedAttribute->isEmpty()) { $dbForProject->updateDocument( 'attributes', - $relatedAttribute->getId(), - $relatedAttribute->setAttribute('status', 'stuck') + $attribute->getId(), + $attribute->setAttribute('status', 'stuck') ); + if (!$relatedAttribute->isEmpty()) { + $dbForProject->updateDocument( + 'attributes', + $relatedAttribute->getId(), + $relatedAttribute->setAttribute('status', 'stuck') + ); + } + + throw $e; + } finally { + $this->trigger($database, $collection, $attribute, $project, $projectId, $events); } - } finally { - $this->trigger($database, $collection, $attribute, $project, $projectId, $events); - } - // The underlying database removes/rebuilds indexes when attribute is removed - // Update indexes table with changes - /** @var Document[] $indexes */ - $indexes = $collection->getAttribute('indexes', []); + // The underlying database removes/rebuilds indexes when attribute is removed + // Update indexes table with changes + /** @var Document[] $indexes */ + $indexes = $collection->getAttribute('indexes', []); - foreach ($indexes as $index) { - /** @var string[] $attributes */ - $attributes = $index->getAttribute('attributes'); - $lengths = $index->getAttribute('lengths'); - $orders = $index->getAttribute('orders'); + foreach ($indexes as $index) { + /** @var string[] $attributes */ + $attributes = $index->getAttribute('attributes'); + $lengths = $index->getAttribute('lengths'); + $orders = $index->getAttribute('orders'); - $found = \array_search($key, $attributes); + $found = \array_search($key, $attributes); - if ($found !== false) { - // If found, remove entry from attributes, lengths, and orders - // array_values wraps array_diff to reindex array keys - // when found attribute is removed from array - $attributes = \array_values(\array_diff($attributes, [$attributes[$found]])); - $lengths = \array_values(\array_diff($lengths, isset($lengths[$found]) ? [$lengths[$found]] : [])); - $orders = \array_values(\array_diff($orders, isset($orders[$found]) ? [$orders[$found]] : [])); + if ($found !== false) { + // If found, remove entry from attributes, lengths, and orders + // array_values wraps array_diff to reindex array keys + // when found attribute is removed from array + $attributes = \array_values(\array_diff($attributes, [$attributes[$found]])); + $lengths = \array_values(\array_diff($lengths, isset($lengths[$found]) ? [$lengths[$found]] : [])); + $orders = \array_values(\array_diff($orders, isset($orders[$found]) ? [$orders[$found]] : [])); - if (empty($attributes)) { - $dbForProject->deleteDocument('indexes', $index->getId()); - } else { - $index - ->setAttribute('attributes', $attributes, Document::SET_TYPE_ASSIGN) - ->setAttribute('lengths', $lengths, Document::SET_TYPE_ASSIGN) - ->setAttribute('orders', $orders, Document::SET_TYPE_ASSIGN); - - // Check if an index exists with the same attributes and orders - $exists = false; - foreach ($indexes as $existing) { - if ( - $existing->getAttribute('key') !== $index->getAttribute('key') // Ignore itself - && $existing->getAttribute('attributes') === $index->getAttribute('attributes') - && $existing->getAttribute('orders') === $index->getAttribute('orders') - ) { - $exists = true; - break; - } - } - - if ($exists) { // Delete the duplicate if created, else update in db - $this->deleteIndex($database, $collection, $index, $project, $dbForConsole, $dbForProject); + if (empty($attributes)) { + $dbForProject->deleteDocument('indexes', $index->getId()); } else { - $dbForProject->updateDocument('indexes', $index->getId(), $index); + $index + ->setAttribute('attributes', $attributes, Document::SET_TYPE_ASSIGN) + ->setAttribute('lengths', $lengths, Document::SET_TYPE_ASSIGN) + ->setAttribute('orders', $orders, Document::SET_TYPE_ASSIGN); + + // Check if an index exists with the same attributes and orders + $exists = false; + foreach ($indexes as $existing) { + if ( + $existing->getAttribute('key') !== $index->getAttribute('key') // Ignore itself + && $existing->getAttribute('attributes') === $index->getAttribute('attributes') + && $existing->getAttribute('orders') === $index->getAttribute('orders') + ) { + $exists = true; + break; + } + } + + if ($exists) { // Delete the duplicate if created, else update in db + $this->deleteIndex($database, $collection, $index, $project, $dbForPlatform, $dbForProject); + } else { + $dbForProject->updateDocument('indexes', $index->getId(), $index); + } } } } - } + } finally { + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); - - if (!$relatedCollection->isEmpty() && !$relatedAttribute->isEmpty()) { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId()); + if (! $relatedCollection->isEmpty()) { + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); + } } } @@ -363,15 +379,16 @@ class Databases extends Action * @param Document $collection * @param Document $index * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Database $dbForProject * @return void * @throws Authorization * @throws Conflict * @throws Structure * @throws DatabaseException + * @throws \Throwable */ - private function createIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForConsole, Database $dbForProject): void + private function createIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForPlatform, Database $dbForProject): void { if ($collection->isEmpty()) { throw new Exception('Missing collection'); @@ -393,7 +410,7 @@ class Databases extends Action $attributes = $index->getAttribute('attributes', []); $lengths = $index->getAttribute('lengths', []); $orders = $index->getAttribute('orders', []); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); try { if (!$dbForProject->createIndex('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key, $type, $attributes, $lengths, $orders)) { @@ -401,9 +418,7 @@ class Databases extends Action } $dbForProject->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'available')); } catch (\Throwable $e) { - // TODO: Send non DatabaseExceptions to Sentry Console::error($e->getMessage()); - if ($e instanceof DatabaseException) { $index->setAttribute('error', $e->getMessage()); } @@ -412,11 +427,12 @@ class Databases extends Action $index->getId(), $index->setAttribute('status', 'failed') ); + + throw $e; } finally { $this->trigger($database, $collection, $index, $project, $projectId, $events); + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); } - - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); } /** @@ -424,15 +440,16 @@ class Databases extends Action * @param Document $collection * @param Document $index * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Database $dbForProject * @return void * @throws Authorization * @throws Conflict * @throws Structure * @throws DatabaseException + * @throws \Throwable */ - private function deleteIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForConsole, Database $dbForProject): void + private function deleteIndex(Document $database, Document $collection, Document $index, Document $project, Database $dbForPlatform, Database $dbForProject): void { if ($collection->isEmpty()) { throw new Exception('Missing collection'); @@ -450,7 +467,7 @@ class Databases extends Action ]); $key = $index->getAttribute('key'); $status = $index->getAttribute('status', ''); - $project = $dbForConsole->getDocument('projects', $projectId); + $project = $dbForPlatform->getDocument('projects', $projectId); try { if ($status !== 'failed' && !$dbForProject->deleteIndex('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) { @@ -459,7 +476,6 @@ class Databases extends Action $dbForProject->deleteDocument('indexes', $index->getId()); $index->setAttribute('status', 'deleted'); } catch (\Throwable $e) { - // TODO: Send non DatabaseExceptions to Sentry Console::error($e->getMessage()); if ($e instanceof DatabaseException) { @@ -470,11 +486,13 @@ class Databases extends Action $index->getId(), $index->setAttribute('status', 'stuck') ); + + throw $e; + } finally { $this->trigger($database, $collection, $index, $project, $projectId, $events); + $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collection->getId()); } - - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collection->getId()); } /** @@ -517,6 +535,8 @@ class Databases extends Action $databaseId = $database->getId(); $databaseInternalId = $database->getInternalId(); + $dbForProject->deleteCollection('database_' . $databaseInternalId . '_collection_' . $collection->getInternalId()); + /** * Related collections relating to current collection */ @@ -535,8 +555,6 @@ class Databases extends Action } ); - $dbForProject->deleteCollection('database_' . $databaseInternalId . '_collection_' . $collection->getInternalId()); - $this->deleteByGroup('attributes', [ Query::equal('databaseInternalId', [$databaseInternalId]), Query::equal('collectionInternalId', [$collectionInternalId]) diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 48e4014f1e..46ae480684 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -3,11 +3,10 @@ namespace Appwrite\Platform\Workers; use Appwrite\Auth\Auth; +use Appwrite\Certificates\Adapter as CertificatesAdapter; use Appwrite\Extend\Exception; use Executor\Executor; use Throwable; -use Utopia\Abuse\Abuse; -use Utopia\Abuse\Adapters\Database\TimeLimit; use Utopia\Audit\Audit; use Utopia\Cache\Adapter\Filesystem; use Utopia\Cache\Cache; @@ -44,24 +43,29 @@ class Deletes extends Action $this ->desc('Deletes worker') ->inject('message') - ->inject('dbForConsole') + ->inject('project') + ->inject('dbForPlatform') ->inject('getProjectDB') + ->inject('timelimit') ->inject('deviceForFiles') ->inject('deviceForFunctions') ->inject('deviceForBuilds') ->inject('deviceForCache') - ->inject('abuseRetention') + ->inject('certificates') ->inject('executionRetention') ->inject('auditRetention') ->inject('log') - ->callback(fn ($message, $dbForConsole, callable $getProjectDB, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, string $abuseRetention, string $executionRetention, string $auditRetention, Log $log) => $this->action($message, $dbForConsole, $getProjectDB, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $abuseRetention, $executionRetention, $auditRetention, $log)); + ->callback( + fn ($message, Document $project, Database $dbForPlatform, callable $getProjectDB, callable $timelimit, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, string $executionRetention, string $auditRetention, Log $log) => + $this->action($message, $project, $dbForPlatform, $getProjectDB, $timelimit, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $certificates, $executionRetention, $auditRetention, $log) + ); } /** * @throws Exception * @throws Throwable */ - public function action(Message $message, Database $dbForConsole, callable $getProjectDB, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, string $abuseRetention, string $executionRetention, string $auditRetention, Log $log): void + public function action(Message $message, Document $project, Database $dbForPlatform, callable $getProjectDB, callable $timelimit, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, string $executionRetention, string $auditRetention, Log $log): void { $payload = $message->getPayload() ?? []; @@ -75,7 +79,6 @@ class Deletes extends Action $resource = $payload['resource'] ?? null; $resourceType = $payload['resourceType'] ?? null; $document = new Document($payload['document'] ?? []); - $project = new Document($payload['project'] ?? []); $log->addTag('projectId', $project->getId()); $log->addTag('type', $type); @@ -84,10 +87,10 @@ class Deletes extends Action case DELETE_TYPE_DOCUMENT: switch ($document->getCollection()) { case DELETE_TYPE_PROJECTS: - $this->deleteProject($dbForConsole, $getProjectDB, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $document); + $this->deleteProject($dbForPlatform, $getProjectDB, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $certificates, $document); break; case DELETE_TYPE_FUNCTIONS: - $this->deleteFunction($dbForConsole, $getProjectDB, $deviceForFunctions, $deviceForBuilds, $document, $project); + $this->deleteFunction($dbForPlatform, $getProjectDB, $deviceForFunctions, $deviceForBuilds, $certificates, $document, $project); break; case DELETE_TYPE_DEPLOYMENTS: $this->deleteDeployment($getProjectDB, $deviceForFunctions, $deviceForBuilds, $document, $project); @@ -99,10 +102,10 @@ class Deletes extends Action $this->deleteBucket($getProjectDB, $deviceForFiles, $document, $project); break; case DELETE_TYPE_INSTALLATIONS: - $this->deleteInstallation($dbForConsole, $getProjectDB, $document, $project); + $this->deleteInstallation($dbForPlatform, $getProjectDB, $document, $project); break; case DELETE_TYPE_RULES: - $this->deleteRule($dbForConsole, $document); + $this->deleteRule($dbForPlatform, $document, $certificates); break; default: Console::error('No lazy delete operation available for document of type: ' . $document->getCollection()); @@ -110,7 +113,7 @@ class Deletes extends Action } break; case DELETE_TYPE_TEAM_PROJECTS: - $this->deleteProjectsByTeam($dbForConsole, $getProjectDB, $document); + $this->deleteProjectsByTeam($dbForPlatform, $getProjectDB, $certificates, $document); break; case DELETE_TYPE_EXECUTIONS: $this->deleteExecutionLogs($project, $getProjectDB, $executionRetention); @@ -120,11 +123,8 @@ class Deletes extends Action $this->deleteAuditLogs($project, $getProjectDB, $auditRetention); } break; - case DELETE_TYPE_ABUSE: - $this->deleteAbuseLogs($project, $getProjectDB, $abuseRetention); - break; case DELETE_TYPE_REALTIME: - $this->deleteRealtimeUsage($dbForConsole, $datetime); + $this->deleteRealtimeUsage($dbForPlatform, $datetime); break; case DELETE_TYPE_SESSIONS: $this->deleteExpiredSessions($project, $getProjectDB); @@ -139,7 +139,7 @@ class Deletes extends Action $this->deleteCacheByDate($project, $getProjectDB, $datetime); break; case DELETE_TYPE_SCHEDULES: - $this->deleteSchedules($dbForConsole, $getProjectDB, $datetime); + $this->deleteSchedules($dbForPlatform, $getProjectDB, $datetime); break; case DELETE_TYPE_TOPIC: $this->deleteTopic($project, $getProjectDB, $document); @@ -153,13 +153,20 @@ class Deletes extends Action case DELETE_TYPE_SESSION_TARGETS: $this->deleteSessionTargets($project, $getProjectDB, $document); break; + case DELETE_TYPE_MAINTENANCE: + $this->deleteExpiredTargets($project, $getProjectDB); + $this->deleteExecutionLogs($project, $getProjectDB, $executionRetention); + $this->deleteAuditLogs($project, $getProjectDB, $auditRetention); + $this->deleteUsageStats($project, $getProjectDB, $hourlyUsageRetentionDatetime); + $this->deleteExpiredSessions($project, $getProjectDB); + break; default: throw new \Exception('No delete operation for type: ' . \strval($type)); } } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @param string $datetime * @param Document|null $document @@ -170,7 +177,7 @@ class Deletes extends Action * @throws Structure * @throws DatabaseException */ - private function deleteSchedules(Database $dbForConsole, callable $getProjectDB, string $datetime): void + private function deleteSchedules(Database $dbForPlatform, callable $getProjectDB, string $datetime): void { $this->listByGroup( 'schedules', @@ -179,25 +186,31 @@ class Deletes extends Action Query::lessThanEqual('resourceUpdatedAt', $datetime), Query::equal('active', [false]), ], - $dbForConsole, - function (Document $document) use ($dbForConsole, $getProjectDB) { - $project = $dbForConsole->getDocument('projects', $document->getAttribute('projectId')); + $dbForPlatform, + function (Document $document) use ($dbForPlatform, $getProjectDB) { + $project = $dbForPlatform->getDocument('projects', $document->getAttribute('projectId')); if ($project->isEmpty()) { - $dbForConsole->deleteDocument('schedules', $document->getId()); + $dbForPlatform->deleteDocument('schedules', $document->getId()); Console::success('Deleted schedule for deleted project ' . $document->getAttribute('projectId')); return; } $collectionId = match ($document->getAttribute('resourceType')) { 'function' => 'functions', + 'execution' => 'executions', 'message' => 'messages' }; - $resource = $getProjectDB($project)->getDocument( - $collectionId, - $document->getAttribute('resourceId') - ); + try { + $resource = $getProjectDB($project)->getDocument( + $collectionId, + $document->getAttribute('resourceId') + ); + } catch (Throwable $e) { + Console::error('Failed to get resource for schedule ' . $document->getId() . ' ' . $e->getMessage()); + return; + } $delete = true; @@ -205,10 +218,13 @@ class Deletes extends Action case 'function': $delete = $resource->isEmpty(); break; + case 'execution': + $delete = false; + break; } if ($delete) { - $dbForConsole->deleteDocument('schedules', $document->getId()); + $dbForPlatform->deleteDocument('schedules', $document->getId()); Console::success('Deleting schedule for ' . $document->getAttribute('resourceType') . ' ' . $document->getAttribute('resourceId')); } } @@ -264,7 +280,7 @@ class Deletes extends Action MESSAGE_TYPE_EMAIL => 'emailTotal', MESSAGE_TYPE_SMS => 'smsTotal', MESSAGE_TYPE_PUSH => 'pushTotal', - default => throw new Exception('Invalid target provider type'), + default => throw new Exception('Invalid target CertificatesAdapter type'), }; $dbForProject->decreaseDocumentAttribute( 'topics', @@ -389,7 +405,7 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @param string $hourlyUsageRetentionDatetime * @return void @@ -432,7 +448,7 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Document $document * @return void * @throws Authorization @@ -442,10 +458,10 @@ class Deletes extends Action * @throws Structure * @throws Exception */ - private function deleteProjectsByTeam(Database $dbForConsole, callable $getProjectDB, Document $document): void + private function deleteProjectsByTeam(Database $dbForPlatform, callable $getProjectDB, CertificatesAdapter $certificates, Document $document): void { - $projects = $dbForConsole->find('projects', [ + $projects = $dbForPlatform->find('projects', [ Query::equal('teamInternalId', [$document->getInternalId()]) ]); @@ -455,13 +471,13 @@ class Deletes extends Action $deviceForBuilds = getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()); $deviceForCache = getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId()); - $this->deleteProject($dbForConsole, $getProjectDB, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $project); - $dbForConsole->deleteDocument('projects', $project->getId()); + $this->deleteProject($dbForPlatform, $getProjectDB, $deviceForFiles, $deviceForFunctions, $deviceForBuilds, $deviceForCache, $certificates, $project); + $dbForPlatform->deleteDocument('projects', $project->getId()); } } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @param Device $deviceForFiles * @param Device $deviceForFunctions @@ -473,7 +489,7 @@ class Deletes extends Action * @throws Authorization * @throws DatabaseException */ - private function deleteProject(Database $dbForConsole, callable $getProjectDB, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, Document $document): void + private function deleteProject(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFiles, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, Document $document): void { $projectInternalId = $document->getInternalId(); $projectId = $document->getId(); @@ -489,35 +505,35 @@ class Deletes extends Action $projectCollectionIds = [ ...\array_keys(Config::getParam('collections', [])['projects']), - Audit::COLLECTION, - TimeLimit::COLLECTION, + Audit::COLLECTION ]; $limit = \count($projectCollectionIds) + 25; + $sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', '')); + $sharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES_V1', '')); + + $projectTables = !\in_array($dsn->getHost(), $sharedTables); + $sharedTablesV1 = \in_array($dsn->getHost(), $sharedTablesV1); + $sharedTablesV2 = !$projectTables && !$sharedTablesV1; + $sharedTables = $sharedTablesV1 || $sharedTablesV2; + while (true) { $collections = $dbForProject->listCollections($limit); foreach ($collections as $collection) { - if ($dsn->getHost() !== System::getEnv('_APP_DATABASE_SHARED_TABLES', '') || !\in_array($collection->getId(), $projectCollectionIds)) { - try { + try { + if ($projectTables || !\in_array($collection->getId(), $projectCollectionIds)) { $dbForProject->deleteCollection($collection->getId()); - } catch (Throwable $e) { - Console::error('Error deleting '.$collection->getId().' '.$e->getMessage()); - - /** - * Ignore junction tables; - */ - if (!preg_match('/^_\d+_\d+$/', $collection->getId())) { - throw $e; - } + } else { + $this->deleteByGroup($collection->getId(), [], database: $dbForProject); } - } else { - $this->deleteByGroup($collection->getId(), [], database: $dbForProject); + } catch (Throwable $e) { + Console::error('Error deleting '.$collection->getId().' '.$e->getMessage()); } } - if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { + if ($sharedTables) { $collectionsIds = \array_map(fn ($collection) => $collection->getId(), $collections); if (empty(\array_diff($collectionsIds, $projectCollectionIds))) { @@ -531,50 +547,57 @@ class Deletes extends Action // Delete Platforms $this->deleteByGroup('platforms', [ Query::equal('projectInternalId', [$projectInternalId]) - ], $dbForConsole); + ], $dbForPlatform); // Delete project and function rules $this->deleteByGroup('rules', [ Query::equal('projectInternalId', [$projectInternalId]) - ], $dbForConsole, function (Document $document) use ($dbForConsole) { - $this->deleteRule($dbForConsole, $document); + ], $dbForPlatform, function (Document $document) use ($dbForPlatform, $certificates) { + $this->deleteRule($dbForPlatform, $document, $certificates); }); // Delete Keys $this->deleteByGroup('keys', [ Query::equal('projectInternalId', [$projectInternalId]) - ], $dbForConsole); + ], $dbForPlatform); // Delete Webhooks $this->deleteByGroup('webhooks', [ Query::equal('projectInternalId', [$projectInternalId]) - ], $dbForConsole); + ], $dbForPlatform); // Delete VCS Installations $this->deleteByGroup('installations', [ Query::equal('projectInternalId', [$projectInternalId]) - ], $dbForConsole); + ], $dbForPlatform); // Delete VCS Repositories $this->deleteByGroup('repositories', [ Query::equal('projectInternalId', [$projectInternalId]), - ], $dbForConsole); + ], $dbForPlatform); // Delete VCS comments $this->deleteByGroup('vcsComments', [ Query::equal('projectInternalId', [$projectInternalId]), - ], $dbForConsole); + ], $dbForPlatform); // Delete Schedules (No projectInternalId in this collection) $this->deleteByGroup('schedules', [ Query::equal('projectId', [$projectId]), - ], $dbForConsole); + ], $dbForPlatform); // Delete metadata table - if ($dsn->getHost() !== System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) { - $dbForProject->deleteCollection('_metadata'); - } else { - $this->deleteByGroup('_metadata', [], $dbForProject); + if ($projectTables) { + $dbForProject->deleteCollection(Database::METADATA); + } elseif ($sharedTablesV1) { + $this->deleteByGroup(Database::METADATA, [], $dbForProject); + } elseif ($sharedTablesV2) { + $queries = \array_map( + fn ($id) => Query::notEqual('$id', $id), + $projectCollectionIds + ); + + $this->deleteByGroup(Database::METADATA, $queries, $dbForProject); } // Delete all storage directories @@ -641,7 +664,7 @@ class Deletes extends Action } /** - * @param database $dbForConsole + * @param database $dbForPlatform * @param callable $getProjectDB * @param string $datetime * @return void @@ -657,7 +680,7 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @return void * @throws Exception|Throwable @@ -675,42 +698,21 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param string $datetime * @return void * @throws Exception */ - private function deleteRealtimeUsage(Database $dbForConsole, string $datetime): void + private function deleteRealtimeUsage(Database $dbForPlatform, string $datetime): void { // Delete Dead Realtime Logs $this->deleteByGroup('realtime', [ Query::lessThan('timestamp', $datetime) - ], $dbForConsole); + ], $dbForPlatform); } /** - * @param Database $dbForConsole - * @param callable $getProjectDB - * @param string $datetime - * @return void - * @throws Exception - */ - private function deleteAbuseLogs(Document $project, callable $getProjectDB, string $abuseRetention): void - { - $projectId = $project->getId(); - $dbForProject = $getProjectDB($project); - $timeLimit = new TimeLimit("", 0, 1, $dbForProject); - $abuse = new Abuse($timeLimit); - - try { - $abuse->cleanup($abuseRetention); - } catch (DatabaseException $e) { - Console::error('Failed to delete abuse logs for project ' . $projectId . ': ' . $e->getMessage()); - } - } - - /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @param string $datetime * @return void @@ -738,7 +740,7 @@ class Deletes extends Action * @return void * @throws Exception */ - private function deleteFunction(Database $dbForConsole, callable $getProjectDB, Device $deviceForFunctions, Device $deviceForBuilds, Document $document, Document $project): void + private function deleteFunction(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFunctions, Device $deviceForBuilds, CertificatesAdapter $certificates, Document $document, Document $project): void { $projectId = $project->getId(); $dbForProject = $getProjectDB($project); @@ -753,8 +755,8 @@ class Deletes extends Action Query::equal('resourceType', ['function']), Query::equal('resourceInternalId', [$functionInternalId]), Query::equal('projectInternalId', [$project->getInternalId()]) - ], $dbForConsole, function (Document $document) use ($project, $dbForConsole) { - $this->deleteRule($dbForConsole, $document); + ], $dbForPlatform, function (Document $document) use ($project, $dbForPlatform, $certificates) { + $this->deleteRule($dbForPlatform, $document, $certificates); }); /** @@ -808,13 +810,13 @@ class Deletes extends Action Query::equal('projectInternalId', [$project->getInternalId()]), Query::equal('resourceInternalId', [$functionInternalId]), Query::equal('resourceType', ['function']), - ], $dbForConsole, function (Document $document) use ($dbForConsole) { + ], $dbForPlatform, function (Document $document) use ($dbForPlatform) { $providerRepositoryId = $document->getAttribute('providerRepositoryId', ''); $projectInternalId = $document->getAttribute('projectInternalId', ''); $this->deleteByGroup('vcsComments', [ Query::equal('providerRepositoryId', [$providerRepositoryId]), Query::equal('projectInternalId', [$projectInternalId]), - ], $dbForConsole); + ], $dbForPlatform); }); /** @@ -1036,29 +1038,18 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Document $document rule document * @return void */ - private function deleteRule(Database $dbForConsole, Document $document): void + private function deleteRule(Database $dbForPlatform, Document $document, CertificatesAdapter $certificates): void { - $domain = $document->getAttribute('domain'); - $directory = APP_STORAGE_CERTIFICATES . '/' . $domain; - $checkTraversal = realpath($directory) === $directory; - - if ($checkTraversal && is_dir($directory)) { - // Delete files, so Traefik is aware of change - array_map('unlink', glob($directory . '/*.*')); - rmdir($directory); - Console::info("Deleted certificate files for {$domain}"); - } else { - Console::info("No certificate files found for {$domain}"); - } + $certificates->deleteCertificate($domain); // Delete certificate document, so Appwrite is aware of change if (isset($document['certificateId'])) { - $dbForConsole->deleteDocument('certificates', $document['certificateId']); + $dbForPlatform->deleteDocument('certificates', $document['certificateId']); } } @@ -1079,21 +1070,21 @@ class Deletes extends Action } /** - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param callable $getProjectDB * @param Document $document * @param Document $project * @return void * @throws Exception */ - private function deleteInstallation(Database $dbForConsole, callable $getProjectDB, Document $document, Document $project): void + private function deleteInstallation(Database $dbForPlatform, callable $getProjectDB, Document $document, Document $project): void { $dbForProject = $getProjectDB($project); $this->listByGroup('functions', [ Query::equal('installationInternalId', [$document->getInternalId()]) - ], $dbForProject, function ($function) use ($dbForProject, $dbForConsole) { - $dbForConsole->deleteDocument('repositories', $function->getAttribute('repositoryId')); + ], $dbForProject, function ($function) use ($dbForProject, $dbForPlatform) { + $dbForPlatform->deleteDocument('repositories', $function->getAttribute('repositoryId')); $function = $function ->setAttribute('installationId', '') diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index 7e548f57be..72a3334f2f 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -41,29 +41,18 @@ class Functions extends Action $this ->desc('Functions worker') ->groups(['functions']) + ->inject('project') ->inject('message') ->inject('dbForProject') ->inject('queueForFunctions') ->inject('queueForEvents') ->inject('queueForUsage') ->inject('log') - ->callback(fn (Message $message, Database $dbForProject, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Log $log) => $this->action($message, $dbForProject, $queueForFunctions, $queueForEvents, $queueForUsage, $log)); + ->inject('isResourceBlocked') + ->callback(fn (Document $project, Message $message, Database $dbForProject, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Log $log, callable $isResourceBlocked) => $this->action($project, $message, $dbForProject, $queueForFunctions, $queueForEvents, $queueForUsage, $log, $isResourceBlocked)); } - /** - * @param Message $message - * @param Database $dbForProject - * @param Func $queueForFunctions - * @param Event $queueForEvents - * @param Usage $queueForUsage - * @param Log $log - * @return void - * @throws Authorization - * @throws Structure - * @throws \Utopia\Database\Exception - * @throws Conflict - */ - public function action(Message $message, Database $dbForProject, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Log $log): void + public function action(Document $project, Message $message, Database $dbForProject, Func $queueForFunctions, Event $queueForEvents, Usage $queueForUsage, Log $log, callable $isResourceBlocked): void { $payload = $message->getPayload() ?? []; @@ -73,17 +62,16 @@ class Functions extends Action $type = $payload['type'] ?? ''; - // Short-term solution to offhand write operation from API contianer + // Short-term solution to offhand write operation from API container if ($type === Func::TYPE_ASYNC_WRITE) { $execution = new Document($payload['execution'] ?? []); - $execution = $dbForProject->createDocument('executions', $execution); + $dbForProject->createDocument('executions', $execution); return; } $events = $payload['events'] ?? []; $data = $payload['body'] ?? ''; $eventData = $payload['payload'] ?? ''; - $project = new Document($payload['project'] ?? []); $function = new Document($payload['function'] ?? []); $functionId = $payload['functionId'] ?? ''; $user = new Document($payload['user'] ?? []); @@ -121,7 +109,6 @@ class Functions extends Action $limit = 30; $sum = 30; $offset = 0; - /** @var Document[] $functions */ while ($sum >= $limit) { $functions = $dbForProject->find('functions', [ Query::limit($limit), @@ -138,6 +125,12 @@ class Functions extends Action if (!array_intersect($events, $function->getAttribute('events', []))) { continue; } + + if ($isResourceBlocked($project, RESOURCE_TYPE_FUNCTIONS, $function->getId())) { + Console::log('Function ' . $function->getId() . ' is blocked, skipping execution.'); + continue; + } + Console::success('Iterating function: ' . $function->getAttribute('name')); $this->execute( @@ -168,6 +161,11 @@ class Functions extends Action return; } + if ($isResourceBlocked($project, RESOURCE_TYPE_FUNCTIONS, $function->getId())) { + Console::log('Function ' . $function->getId() . ' is blocked, skipping execution.'); + return; + } + /** * Handle Schedule and HTTP execution. */ diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 510fec0431..aee60a2bb5 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -22,6 +22,8 @@ use Utopia\Messaging\Adapter\Push\APNS; use Utopia\Messaging\Adapter\Push as PushAdapter; use Utopia\Messaging\Adapter\Push\FCM; use Utopia\Messaging\Adapter\SMS as SMSAdapter; +use Utopia\Messaging\Adapter\SMS\Fast2SMS; +use Utopia\Messaging\Adapter\SMS\GEOSMS; use Utopia\Messaging\Adapter\SMS\Mock; use Utopia\Messaging\Adapter\SMS\Msg91; use Utopia\Messaging\Adapter\SMS\Telesign; @@ -32,6 +34,7 @@ use Utopia\Messaging\Messages\Email; use Utopia\Messaging\Messages\Email\Attachment; use Utopia\Messaging\Messages\Push; use Utopia\Messaging\Messages\SMS; +use Utopia\Messaging\Priority; use Utopia\Platform\Action; use Utopia\Queue\Message; use Utopia\Storage\Device; @@ -45,6 +48,8 @@ class Messaging extends Action { private ?Local $localDevice = null; + private ?SMSAdapter $adapter = null; + public static function getName(): string { return 'messaging'; @@ -55,18 +60,23 @@ class Messaging extends Action */ public function __construct() { + + $this->adapter = $this->createInternalSMSAdapter(); + $this ->desc('Messaging worker') ->inject('message') + ->inject('project') ->inject('log') ->inject('dbForProject') ->inject('deviceForFiles') ->inject('queueForUsage') - ->callback(fn (Message $message, Log $log, Database $dbForProject, Device $deviceForFiles, Usage $queueForUsage) => $this->action($message, $log, $dbForProject, $deviceForFiles, $queueForUsage)); + ->callback(fn (Message $message, Document $project, Log $log, Database $dbForProject, Device $deviceForFiles, Usage $queueForUsage) => $this->action($message, $project, $log, $dbForProject, $deviceForFiles, $queueForUsage)); } /** * @param Message $message + * @param Document $project * @param Log $log * @param Database $dbForProject * @param Device $deviceForFiles @@ -76,6 +86,7 @@ class Messaging extends Action */ public function action( Message $message, + Document $project, Log $log, Database $dbForProject, Device $deviceForFiles, @@ -89,14 +100,13 @@ class Messaging extends Action } $type = $payload['type'] ?? ''; - $project = new Document($payload['project'] ?? []); switch ($type) { case MESSAGE_SEND_TYPE_INTERNAL: $message = new Document($payload['message'] ?? []); $recipients = $payload['recipients'] ?? []; - $this->sendInternalSMSMessage($message, $project, $recipients, $queueForUsage, $log); + $this->sendInternalSMSMessage($message, $project, $recipients, $log); break; case MESSAGE_SEND_TYPE_EXTERNAL: $message = $dbForProject->getDocument('messages', $payload['messageId']); @@ -178,7 +188,7 @@ class Messaging extends Action Query::equal('type', [$providerType]), ]); - if ($default === false || $default->isEmpty()) { + if ($default->isEmpty()) { $dbForProject->updateDocument('messages', $message->getId(), $message->setAttributes([ 'status' => MessageStatus::FAILED, 'deliveryErrors' => ['No enabled provider found.'] @@ -275,7 +285,7 @@ class Messaging extends Action Query::equal('identifier', [$result['recipient']]) ]); - if ($target instanceof Document && !$target->isEmpty()) { + if (!$target->isEmpty()) { $dbForProject->updateDocument( 'targets', $target->getId(), @@ -287,7 +297,7 @@ class Messaging extends Action } catch (\Throwable $e) { $deliveryErrors[] = 'Failed sending to targets with error: ' . $e->getMessage(); } finally { - $errorTotal = count($deliveryErrors); + $errorTotal = \count($deliveryErrors); $queueForUsage ->setProject($project) ->addMetric(METRIC_MESSAGES, ($deliveredTotal + $errorTotal)) @@ -333,7 +343,6 @@ class Messaging extends Action $message->setAttribute('status', MessageStatus::SENT); } - $message->removeAttribute('to'); foreach ($providers as $provider) { @@ -377,112 +386,40 @@ class Messaging extends Action } } - private function sendInternalSMSMessage(Document $message, Document $project, array $recipients, Usage $queueForUsage, Log $log): void + private function sendInternalSMSMessage(Document $message, Document $project, array $recipients, Log $log): void { - if (empty(System::getEnv('_APP_SMS_PROVIDER')) || empty(System::getEnv('_APP_SMS_FROM'))) { - throw new \Exception('Skipped SMS processing. Missing "_APP_SMS_PROVIDER" or "_APP_SMS_FROM" environment variables.'); + if ($this->adapter === null) { + Console::warning('Skipped SMS processing. SMS adapter is not set.'); + return; } if ($project->isEmpty()) { throw new \Exception('Project not set in payload'); } - Console::log('Project: ' . $project->getId()); - + Console::log('Processing project: ' . $project->getId()); $denyList = System::getEnv('_APP_SMS_PROJECTS_DENY_LIST', ''); $denyList = explode(',', $denyList); - if (\in_array($project->getId(), $denyList)) { Console::error('Project is in the deny list. Skipping...'); return; } - $smsDSN = new DSN(System::getEnv('_APP_SMS_PROVIDER')); - $host = $smsDSN->getHost(); - $password = $smsDSN->getPassword(); - $user = $smsDSN->getUser(); - - $log->addTag('type', $host); - - $from = System::getEnv('_APP_SMS_FROM'); - - $provider = new Document([ - '$id' => ID::unique(), - 'provider' => $host, - 'type' => MESSAGE_TYPE_SMS, - 'name' => 'Internal SMS', - 'enabled' => true, - 'credentials' => match ($host) { - 'twilio' => [ - 'accountSid' => $user, - 'authToken' => $password, - // Twilio Messaging Service SIDs always start with MG - // https://www.twilio.com/docs/messaging/services - 'messagingServiceSid' => \str_starts_with($from, 'MG') ? $from : null - ], - 'textmagic' => [ - 'username' => $user, - 'apiKey' => $password - ], - 'telesign' => [ - 'customerId' => $user, - 'apiKey' => $password - ], - 'msg91' => [ - 'senderId' => $user, - 'authKey' => $password, - 'templateId' => $smsDSN->getParam('templateId', $from), - ], - 'vonage' => [ - 'apiKey' => $user, - 'apiSecret' => $password - ], - default => null - }, - 'options' => match ($host) { - 'twilio' => [ - 'from' => \str_starts_with($from, 'MG') ? null : $from - ], - default => [ - 'from' => $from - ] - } - ]); - - $adapter = $this->getSmsAdapter($provider); - - $batches = \array_chunk( + $from = System::getEnv('_APP_SMS_FROM', ''); + $sms = new SMS( $recipients, - $adapter->getMaxMessagesPerRequest() + $message->getAttribute('data')['content'], + $from ); - batch(\array_map(function ($batch) use ($message, $provider, $adapter, $project, $queueForUsage) { - return function () use ($batch, $message, $provider, $adapter, $project, $queueForUsage) { - $message->setAttribute('to', $batch); - - $data = $this->buildSmsMessage($message, $provider); - - try { - $adapter->send($data); - - $countryCode = $adapter->getCountryCode($message['to'][0] ?? ''); - if (!empty($countryCode)) { - $queueForUsage - ->addMetric(str_replace('{countryCode}', $countryCode, METRIC_AUTH_METHOD_PHONE_COUNTRY_CODE), 1); - } - $queueForUsage - ->addMetric(METRIC_AUTH_METHOD_PHONE, 1) - ->setProject($project) - ->trigger(); - } catch (\Throwable $th) { - throw new \Exception('Failed sending to targets with error: ' . $th->getMessage()); - } - }; - }, $batches)); + try { + $result = $this->adapter->send($sms); + } catch (\Throwable $th) { + throw new \Exception('Failed sending to targets with error: ' . $th->getMessage()); + } } - private function getSmsAdapter(Document $provider): ?SMSAdapter { $credentials = $provider->getAttribute('credentials'); @@ -512,6 +449,12 @@ class Messaging extends Action $credentials['apiKey'] ?? '', $credentials['apiSecret'] ?? '' ), + 'fast2sms' => new Fast2SMS( + $credentials['apiKey'] ?? '', + $credentials['senderId'] ?? '', + $credentials['messageId'] ?? '', + $credentials['useDLT'] ?? true + ), default => null }; } @@ -676,8 +619,8 @@ class Messaging extends Action private function buildPushMessage(Document $message): Push { $to = $message['to']; - $title = $message['data']['title']; - $body = $message['data']['body']; + $title = $message['data']['title'] ?? null; + $body = $message['data']['body'] ?? null; $data = $message['data']['data'] ?? null; $action = $message['data']['action'] ?? null; $image = $message['data']['image']['url'] ?? null; @@ -686,6 +629,21 @@ class Messaging extends Action $color = $message['data']['color'] ?? null; $tag = $message['data']['tag'] ?? null; $badge = $message['data']['badge'] ?? null; + $contentAvailable = $message['data']['contentAvailable'] ?? null; + $critical = $message['data']['critical'] ?? null; + $priority = $message['data']['priority'] ?? null; + + if ($title === '') { + $title = null; + } + if ($body === '') { + $body = null; + } + if ($priority !== null) { + $priority = $priority === 'high' + ? Priority::HIGH + : Priority::NORMAL; + } return new Push( $to, @@ -698,7 +656,10 @@ class Messaging extends Action $icon, $color, $tag, - $badge + $badge, + $contentAvailable, + $critical, + $priority ); } @@ -710,4 +671,127 @@ class Messaging extends Action return $this->localDevice; } + + private function createInternalSMSAdapter(): ?SMSAdapter + { + if (empty(System::getEnv('_APP_SMS_PROVIDER')) || empty(System::getEnv('_APP_SMS_FROM'))) { + Console::warning('Skipped SMS processing. Missing "_APP_SMS_PROVIDER" or "_APP_SMS_FROM" environment variables.'); + return null; + } + + $providers = System::getEnv('_APP_SMS_PROVIDER', ''); + + $dsns = []; + if (!empty($providers)) { + $providers = explode(',', $providers); + foreach ($providers as $provider) { + $dsns[] = new DSN($provider); + } + } + + if (count($dsns) === 1) { + $provider = $this->createProviderFromDSN($dsns[0]); + $adapter = $this->getSmsAdapter($provider); + return $adapter; + } + + $defaultDSN = null; + $localDSNs = []; + + /** @var DSN $dsn */ + foreach ($dsns as $dsn) { + if ($dsn->getParam('local', '') === 'default') { + $defaultDSN = $dsn; + } else { + $localDSNs[] = $dsn; + } + } + + if ($defaultDSN === null) { + throw new \Exception('No default SMS provider found'); + } + + $defaultProvider = $this->createProviderFromDSN($defaultDSN); + $adapter = $this->getSmsAdapter($defaultProvider); + $geosms = new GEOSMS($adapter); + + /** @var DSN $localDSN */ + foreach ($localDSNs as $localDSN) { + try { + $provider = $this->createProviderFromDSN($localDSN); + $adapter = $this->getSmsAdapter($provider); + } catch (\Exception) { + Console::warning('Unable to create adapter: ' . $localDSN->getHost()); + continue; + } + + $callingCode = $localDSN->getParam('local', ''); + if (empty($callingCode)) { + Console::warning('Unable to register adapter: ' . $localDSN->getHost() . '. Missing `local` parameter.'); + continue; + } + + $geosms->setLocal($callingCode, $adapter); + } + return $geosms; + } + + private function createProviderFromDSN(DSN $dsn): Document + { + $host = $dsn->getHost(); + $password = $dsn->getPassword(); + $user = $dsn->getUser(); + $from = System::getEnv('_APP_SMS_FROM'); + + $provider = new Document([ + '$id' => ID::unique(), + 'provider' => $host, + 'type' => MESSAGE_TYPE_SMS, + 'name' => 'Internal SMS', + 'enabled' => true, + 'credentials' => match ($host) { + 'twilio' => [ + 'accountSid' => $user, + 'authToken' => $password, + // Twilio Messaging Service SIDs always start with MG + // https://www.twilio.com/docs/messaging/services + 'messagingServiceSid' => \str_starts_with($from, 'MG') ? $from : null + ], + 'textmagic' => [ + 'username' => $user, + 'apiKey' => $password + ], + 'telesign' => [ + 'customerId' => $user, + 'apiKey' => $password + ], + 'msg91' => [ + 'senderId' => $user, + 'authKey' => $password, + 'templateId' => $dsn->getParam('templateId', $from), + ], + 'vonage' => [ + 'apiKey' => $user, + 'apiSecret' => $password + ], + 'fast2sms' => [ + 'senderId' => $user, + 'apiKey' => $password, + 'messageId' => $dsn->getParam('messageId'), + 'useDLT' => $dsn->getParam('useDLT'), + ], + default => null + }, + 'options' => match ($host) { + 'twilio' => [ + 'from' => \str_starts_with($from, 'MG') ? null : $from + ], + default => [ + 'from' => $from + ] + } + ]); + + return $provider; + } } diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index beff0b064b..cd567f6fa3 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -2,10 +2,9 @@ namespace Appwrite\Platform\Workers; +use Ahc\Jwt\JWT; use Appwrite\Event\Event; use Appwrite\Messaging\Adapter\Realtime; -use Appwrite\Permission; -use Appwrite\Role; use Exception; use Utopia\CLI\Console; use Utopia\Config\Config; @@ -15,8 +14,6 @@ use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; -use Utopia\Database\Helpers\ID; -use Utopia\Logger\Log; use Utopia\Migration\Destination; use Utopia\Migration\Destinations\Appwrite as DestinationAppwrite; use Utopia\Migration\Exception as MigrationException; @@ -28,15 +25,18 @@ use Utopia\Migration\Sources\Supabase; use Utopia\Migration\Transfer; use Utopia\Platform\Action; use Utopia\Queue\Message; +use Utopia\System\System; class Migrations extends Action { protected Database $dbForProject; - protected Database $dbForConsole; + protected Database $dbForPlatform; protected Document $project; + protected $logError; + public static function getName(): string { return 'migrations'; @@ -50,16 +50,17 @@ class Migrations extends Action $this ->desc('Migrations worker') ->inject('message') + ->inject('project') ->inject('dbForProject') - ->inject('dbForConsole') - ->inject('log') - ->callback(fn (Message $message, Database $dbForProject, Database $dbForConsole, Log $log) => $this->action($message, $dbForProject, $dbForConsole, $log)); + ->inject('dbForPlatform') + ->inject('logError') + ->callback(fn (Message $message, Document $project, Database $dbForProject, Database $dbForPlatform, callable $logError) => $this->action($message, $project, $dbForProject, $dbForPlatform, $logError)); } /** * @throws Exception */ - public function action(Message $message, Database $dbForProject, Database $dbForConsole, Log $log): void + public function action(Message $message, Document $project, Database $dbForProject, Database $dbForPlatform, callable $logError): void { $payload = $message->getPayload() ?? []; @@ -68,7 +69,6 @@ class Migrations extends Action } $events = $payload['events'] ?? []; - $project = new Document($payload['project'] ?? []); $migration = new Document($payload['migration'] ?? []); if ($project->getId() === 'console') { @@ -76,8 +76,9 @@ class Migrations extends Action } $this->dbForProject = $dbForProject; - $this->dbForConsole = $dbForConsole; + $this->dbForPlatform = $dbForPlatform; $this->project = $project; + $this->logError = $logError; /** * Handle Event execution. @@ -86,10 +87,7 @@ class Migrations extends Action return; } - $log->addTag('migrationId', $migration->getId()); - $log->addTag('projectId', $project->getId()); - - $this->processMigration($migration, $log); + $this->processMigration($migration); } /** @@ -124,7 +122,7 @@ class Migrations extends Action ), SourceAppwrite::getName() => new SourceAppwrite( $credentials['projectId'], - $credentials['endpoint'], + $credentials['endpoint'] === 'http://localhost/v1' ? 'http://appwrite/v1' : $credentials['endpoint'], $credentials['apiKey'], ), default => throw new \Exception('Invalid source type'), @@ -134,16 +132,15 @@ class Migrations extends Action /** * @throws Exception */ - protected function processDestination(Document $migration): Destination + protected function processDestination(Document $migration, string $apiKey): Destination { $destination = $migration->getAttribute('destination'); - $credentials = $migration->getAttribute('credentials'); return match ($destination) { DestinationAppwrite::getName() => new DestinationAppwrite( - $credentials['projectId'], - $credentials['endpoint'], - $credentials['apiKey'], + $this->project->getId(), + 'http://appwrite/v1', + $apiKey, $this->dbForProject, Config::getParam('collections', [])['databases']['collections'], ), @@ -199,7 +196,7 @@ class Migrations extends Action */ protected function removeAPIKey(Document $apiKey): void { - $this->dbForConsole->deleteDocument('keys', $apiKey->getId()); + $this->dbForPlatform->deleteDocument('keys', $apiKey->getId()); } /** @@ -208,48 +205,32 @@ class Migrations extends Action * @throws \Utopia\Database\Exception * @throws Exception */ - protected function generateAPIKey(Document $project): Document + protected function generateAPIKey(Document $project): string { - $generatedSecret = bin2hex(\random_bytes(128)); - - $key = new Document([ - '$id' => ID::unique(), - '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), - ], - 'projectInternalId' => $project->getInternalId(), + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 86400, 0); + $apiKey = $jwt->encode([ 'projectId' => $project->getId(), - 'name' => 'Transfer API Key', 'scopes' => [ 'users.read', 'users.write', 'teams.read', 'teams.write', - 'databases.read', - 'databases.write', - 'collections.read', - 'collections.write', - 'documents.read', - 'documents.write', 'buckets.read', 'buckets.write', 'files.read', 'files.write', 'functions.read', 'functions.write', - ], - 'expire' => null, - 'sdks' => [], - 'accessedAt' => null, - 'secret' => $generatedSecret, + 'databases.read', + 'databases.write', + 'collections.read', + 'collections.write', + 'documents.read', + 'documents.write' + ] ]); - $this->dbForConsole->createDocument('keys', $key); - $this->dbForConsole->purgeCachedDocument('projects', $project->getId()); - - return $key; + return API_KEY_DYNAMIC . '_' . $apiKey; } /** @@ -260,26 +241,24 @@ class Migrations extends Action * @throws \Utopia\Database\Exception * @throws Exception */ - protected function processMigration(Document $migration, Log $log): void + protected function processMigration(Document $migration): void { $project = $this->project; - $projectDocument = $this->dbForConsole->getDocument('projects', $project->getId()); + $projectDocument = $this->dbForPlatform->getDocument('projects', $project->getId()); $tempAPIKey = $this->generateAPIKey($projectDocument); $transfer = $source = $destination = null; try { - $migration = $this->dbForProject->getDocument('migrations', $migration->getId()); - if ( - $migration->getAttribute('source') === SourceAppwrite::getName() || - $migration->getAttribute('destination') === DestinationAppwrite::getName() + $migration->getAttribute('source') === SourceAppwrite::getName() && + empty($migration->getAttribute('credentials', [])) ) { $credentials = $migration->getAttribute('credentials', []); $credentials['projectId'] = $credentials['projectId'] ?? $projectDocument->getId(); $credentials['endpoint'] = $credentials['endpoint'] ?? 'http://appwrite/v1'; - $credentials['apiKey'] = $credentials['apiKey'] ?? $tempAPIKey['secret']; + $credentials['apiKey'] = $credentials['apiKey'] ?? $tempAPIKey; $migration->setAttribute('credentials', $credentials); } @@ -288,10 +267,8 @@ class Migrations extends Action $migration->setAttribute('status', 'processing'); $this->updateMigrationDocument($migration, $projectDocument); - $log->addTag('type', $migration->getAttribute('source')); - $source = $this->processSource($migration); - $destination = $this->processDestination($migration); + $destination = $this->processDestination($migration, $tempAPIKey); $source->report(); @@ -327,7 +304,6 @@ class Migrations extends Action $errorMessages = []; foreach ($sourceErrors as $error) { - /** @var $sourceErrors $error */ $message = "Error occurred while fetching '{$error->getResourceName()}:{$error->getResourceId()}' from source with message: '{$error->getMessage()}'"; if ($error->getPrevious()) { $message .= " Message: ".$error->getPrevious()->getMessage() . " File: ".$error->getPrevious()->getFile() . " Line: ".$error->getPrevious()->getLine(); @@ -347,7 +323,6 @@ class Migrations extends Action } $migration->setAttribute('errors', $errorMessages); - $log->addExtra('migrationErrors', json_encode($errorMessages)); $this->updateMigrationDocument($migration, $projectDocument); return; @@ -362,7 +337,12 @@ class Migrations extends Action if (! $migration->isEmpty()) { $migration->setAttribute('status', 'failed'); $migration->setAttribute('stage', 'finished'); - $migration->setAttribute('errors', [$th->getMessage()]); + + call_user_func($this->logError, $th, 'appwrite-worker', 'appwrite-queue-'.self::getName(), [ + 'migrationId' => $migration->getId(), + 'source' => $migration->getAttribute('source') ?? '', + 'destination' => $migration->getAttribute('destination') ?? '', + ]); return; } @@ -382,27 +362,47 @@ class Migrations extends Action } $migration->setAttribute('errors', $errorMessages); - $log->addTag('migrationErrors', json_encode($errorMessages)); } } finally { - if (! $tempAPIKey->isEmpty()) { - $this->removeAPIKey($tempAPIKey); - } - $this->updateMigrationDocument($migration, $projectDocument); if ($migration->getAttribute('status', '') === 'failed') { Console::error('Migration('.$migration->getInternalId().':'.$migration->getId().') failed, Project('.$this->project->getInternalId().':'.$this->project->getId().')'); - $destination->error(); - $source->error(); + if ($destination) { + $destination->error(); - throw new Exception('Migration failed'); + foreach ($destination->getErrors() as $error) { + /** @var MigrationException $error */ + call_user_func($this->logError, $error, 'appwrite-worker', 'appwrite-queue-' . self::getName(), [ + 'migrationId' => $migration->getId(), + 'source' => $migration->getAttribute('source') ?? '', + 'destination' => $migration->getAttribute('destination') ?? '', + 'resourceName' => $error->getResourceName(), + 'resourceGroup' => $error->getResourceGroup() + ]); + } + } + + if ($source) { + $source->error(); + + foreach ($source->getErrors() as $error) { + /** @var MigrationException $error */ + call_user_func($this->logError, $error, 'appwrite-worker', 'appwrite-queue-' . self::getName(), [ + 'migrationId' => $migration->getId(), + 'source' => $migration->getAttribute('source') ?? '', + 'destination' => $migration->getAttribute('destination') ?? '', + 'resourceName' => $error->getResourceName(), + 'resourceGroup' => $error->getResourceGroup() + ]); + } + } } if ($migration->getAttribute('status', '') === 'completed') { - $destination->success(); - $source->success(); + $destination?->success(); + $source?->success(); } } } diff --git a/src/Appwrite/Platform/Workers/Usage.php b/src/Appwrite/Platform/Workers/Usage.php index 034e558d5d..3687eeab67 100644 --- a/src/Appwrite/Platform/Workers/Usage.php +++ b/src/Appwrite/Platform/Workers/Usage.php @@ -15,9 +15,10 @@ class Usage extends Action { private array $stats = []; private int $lastTriggeredTime = 0; + private int $aggregationInterval = 20; private int $keys = 0; private const INFINITY_PERIOD = '_inf_'; - private const KEYS_THRESHOLD = 10000; + private const KEYS_THRESHOLD = 20000; public static function getName(): string { @@ -33,33 +34,39 @@ class Usage extends Action $this ->desc('Usage worker') ->inject('message') + ->inject('project') ->inject('getProjectDB') ->inject('queueForUsageDump') - ->callback(function (Message $message, callable $getProjectDB, UsageDump $queueForUsageDump) { - $this->action($message, $getProjectDB, $queueForUsageDump); + ->callback(function (Message $message, Document $project, callable $getProjectDB, UsageDump $queueForUsageDump) { + $this->action($message, $project, $getProjectDB, $queueForUsageDump); }); + $this->aggregationInterval = (int) System::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '20'); $this->lastTriggeredTime = time(); } /** * @param Message $message + * @param Document $project * @param callable $getProjectDB * @param UsageDump $queueForUsageDump * @return void * @throws \Utopia\Database\Exception * @throws Exception */ - public function action(Message $message, callable $getProjectDB, UsageDump $queueForUsageDump): void + public function action(Message $message, Document $project, callable $getProjectDB, UsageDump $queueForUsageDump): void { $payload = $message->getPayload() ?? []; if (empty($payload)) { throw new Exception('Missing payload'); } - //Todo Figure out way to preserve keys when the container is being recreated @shimonewman - $aggregationInterval = (int) System::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '20'); - $project = new Document($payload['project'] ?? []); + + if (empty($project->getAttribute('database'))) { + var_dump($payload); + return; + } + $projectId = $project->getInternalId(); foreach ($payload['reduce'] ?? [] as $document) { if (empty($document)) { @@ -74,7 +81,12 @@ class Usage extends Action ); } - $this->stats[$projectId]['project'] = $project; + + $this->stats[$projectId]['project'] = [ + '$id' => $project->getId(), + '$internalId' => $project->getInternalId(), + 'database' => $project->getAttribute('database'), + ]; $this->stats[$projectId]['receivedAt'] = DateTime::now(); foreach ($payload['metrics'] ?? [] as $metric) { $this->keys++; @@ -89,7 +101,7 @@ class Usage extends Action // If keys crossed threshold or X time passed since the last send and there are some keys in the array ($this->stats) if ( $this->keys >= self::KEYS_THRESHOLD || - (time() - $this->lastTriggeredTime > $aggregationInterval && $this->keys > 0) + (time() - $this->lastTriggeredTime > $this->aggregationInterval && $this->keys > 0) ) { Console::warning('[' . DateTime::now() . '] Aggregated ' . $this->keys . ' keys'); diff --git a/src/Appwrite/Platform/Workers/UsageDump.php b/src/Appwrite/Platform/Workers/UsageDump.php index b5480e1dec..2f1d13f29a 100644 --- a/src/Appwrite/Platform/Workers/UsageDump.php +++ b/src/Appwrite/Platform/Workers/UsageDump.php @@ -57,16 +57,20 @@ class UsageDump extends Action throw new Exception('Missing payload'); } - // TODO: rename both usage workers @shimonewman + foreach ($payload['stats'] ?? [] as $stats) { $project = new Document($stats['project'] ?? []); + + /** + * End temp bug fallback + */ $numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0; $receivedAt = $stats['receivedAt'] ?? 'NONE'; if ($numberOfKeys === 0) { continue; } - console::log('[' . DateTime::now() . '] ProjectId [' . $project->getInternalId() . '] ReceivedAt [' . $receivedAt . '] ' . $numberOfKeys . ' keys'); + console::log('['.DateTime::now().'] Id: '.$project->getId(). ' InternalId: '.$project->getInternalId(). ' Db: '.$project->getAttribute('database').' ReceivedAt: '.$receivedAt. ' Keys: '.$numberOfKeys); try { $dbForProject = $getProjectDB($project); diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index 88ca7871f2..a76e4f17b0 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Workers; use Appwrite\Event\Mail; +use Appwrite\Event\Usage; use Appwrite\Template\Template; use Exception; use Utopia\Database\Database; @@ -31,21 +32,24 @@ class Webhooks extends Action $this ->desc('Webhooks worker') ->inject('message') - ->inject('dbForConsole') + ->inject('project') + ->inject('dbForPlatform') ->inject('queueForMails') + ->inject('queueForUsage') ->inject('log') - ->callback(fn (Message $message, Database $dbForConsole, Mail $queueForMails, Log $log) => $this->action($message, $dbForConsole, $queueForMails, $log)); + ->callback(fn (Message $message, Document $project, Database $dbForPlatform, Mail $queueForMails, Usage $queueForUsage, Log $log) => $this->action($message, $project, $dbForPlatform, $queueForMails, $queueForUsage, $log)); } /** * @param Message $message - * @param Database $dbForConsole + * @param Document $project + * @param Database $dbForPlatform * @param Mail $queueForMails * @param Log $log * @return void * @throws Exception */ - public function action(Message $message, Database $dbForConsole, Mail $queueForMails, Log $log): void + public function action(Message $message, Document $project, Database $dbForPlatform, Mail $queueForMails, Usage $queueForUsage, Log $log): void { $this->errors = []; $payload = $message->getPayload() ?? []; @@ -56,14 +60,13 @@ class Webhooks extends Action $events = $payload['events']; $webhookPayload = json_encode($payload['payload']); - $project = new Document($payload['project']); $user = new Document($payload['user'] ?? []); $log->addTag('projectId', $project->getId()); foreach ($project->getAttribute('webhooks', []) as $webhook) { if (array_intersect($webhook->getAttribute('events', []), $events)) { - $this->execute($events, $webhookPayload, $webhook, $user, $project, $dbForConsole, $queueForMails); + $this->execute($events, $webhookPayload, $webhook, $user, $project, $dbForPlatform, $queueForMails, $queueForUsage); } } @@ -78,11 +81,11 @@ class Webhooks extends Action * @param Document $webhook * @param Document $user * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Mail $queueForMails * @return void */ - private function execute(array $events, string $payload, Document $webhook, Document $user, Document $project, Database $dbForConsole, Mail $queueForMails): void + private function execute(array $events, string $payload, Document $webhook, Document $user, Document $project, Database $dbForPlatform, Mail $queueForMails, Usage $queueForUsage): void { if ($webhook->getAttribute('enabled') !== true) { return; @@ -138,8 +141,8 @@ class Webhooks extends Action \curl_close($ch); if (!empty($curlError) || $statusCode >= 400) { - $dbForConsole->increaseDocumentAttribute('webhooks', $webhook->getId(), 'attempts', 1); - $webhook = $dbForConsole->getDocument('webhooks', $webhook->getId()); + $dbForPlatform->increaseDocumentAttribute('webhooks', $webhook->getId(), 'attempts', 1); + $webhook = $dbForPlatform->getDocument('webhooks', $webhook->getId()); $attempts = $webhook->getAttribute('attempts'); $logs = ''; @@ -158,18 +161,32 @@ class Webhooks extends Action if ($attempts >= \intval(System::getEnv('_APP_WEBHOOK_MAX_FAILED_ATTEMPTS', '10'))) { $webhook->setAttribute('enabled', false); - $this->sendEmailAlert($attempts, $statusCode, $webhook, $project, $dbForConsole, $queueForMails); + $this->sendEmailAlert($attempts, $statusCode, $webhook, $project, $dbForPlatform, $queueForMails); } - $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('webhooks', $webhook->getId(), $webhook); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $this->errors[] = $logs; + $queueForUsage + ->addMetric(METRIC_WEBHOOKS_FAILED, 1) + ->addMetric(str_replace('{webhookInternalId}', $webhook->getInternalId(), METRIC_WEBHOOK_ID_FAILED), 1) + ; + + } else { $webhook->setAttribute('attempts', 0); // Reset attempts on success - $dbForConsole->updateDocument('webhooks', $webhook->getId(), $webhook); - $dbForConsole->purgeCachedDocument('projects', $project->getId()); + $dbForPlatform->updateDocument('webhooks', $webhook->getId(), $webhook); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); + $queueForUsage + ->addMetric(METRIC_WEBHOOKS_SENT, 1) + ->addMetric(str_replace('{webhookInternalId}', $webhook->getInternalId(), METRIC_WEBHOOK_ID_SENT), 1) + ; } + + $queueForUsage + ->setProject($project) + ->trigger(); } /** @@ -177,20 +194,20 @@ class Webhooks extends Action * @param mixed $statusCode * @param Document $webhook * @param Document $project - * @param Database $dbForConsole + * @param Database $dbForPlatform * @param Mail $queueForMails * @return void */ - public function sendEmailAlert(int $attempts, mixed $statusCode, Document $webhook, Document $project, Database $dbForConsole, Mail $queueForMails): void + public function sendEmailAlert(int $attempts, mixed $statusCode, Document $webhook, Document $project, Database $dbForPlatform, Mail $queueForMails): void { - $memberships = $dbForConsole->find('memberships', [ + $memberships = $dbForPlatform->find('memberships', [ Query::equal('teamInternalId', [$project->getAttribute('teamInternalId')]), Query::limit(APP_LIMIT_SUBQUERY) ]); $userIds = array_column(\array_map(fn ($membership) => $membership->getArrayCopy(), $memberships), 'userId'); - $users = $dbForConsole->find('users', [ + $users = $dbForPlatform->find('users', [ Query::equal('$id', $userIds), ]); diff --git a/src/Appwrite/PubSub/Adapter.php b/src/Appwrite/PubSub/Adapter.php new file mode 100644 index 0000000000..e5ddbe5e62 --- /dev/null +++ b/src/Appwrite/PubSub/Adapter.php @@ -0,0 +1,13 @@ +<?php + +namespace Appwrite\PubSub; + +interface Adapter +{ + public function ping($message = null): bool; + + public function subscribe($channels, $callback); + + public function publish($channel, $message); + +} diff --git a/src/Appwrite/PubSub/Adapter/Redis.php b/src/Appwrite/PubSub/Adapter/Redis.php new file mode 100644 index 0000000000..187eb9cd95 --- /dev/null +++ b/src/Appwrite/PubSub/Adapter/Redis.php @@ -0,0 +1,31 @@ +<?php + +namespace Appwrite\PubSub\Adapter; + +use Appwrite\PubSub\Adapter; + +class Redis implements Adapter +{ + private \Redis $client; + + public function __construct(\Redis $client) + { + $this->client = $client; + + } + + public function ping($message = null): bool + { + return $this->client->ping($message); + } + + public function subscribe($channels, $callback) + { + return $this->client->subscribe($channels, $callback); + } + + public function publish($channel, $message) + { + return $this->client->publish($channel, $message); + } +} diff --git a/src/Appwrite/SDK/AuthType.php b/src/Appwrite/SDK/AuthType.php new file mode 100644 index 0000000000..307b3cf35e --- /dev/null +++ b/src/Appwrite/SDK/AuthType.php @@ -0,0 +1,11 @@ +<?php + +namespace Appwrite\SDK; + +enum AuthType: string +{ + case JWT = APP_AUTH_TYPE_JWT; + case KEY = APP_AUTH_TYPE_KEY; + case SESSION = APP_AUTH_TYPE_SESSION; + case ADMIN = APP_AUTH_TYPE_ADMIN; +} diff --git a/src/Appwrite/SDK/ContentType.php b/src/Appwrite/SDK/ContentType.php new file mode 100644 index 0000000000..174c889815 --- /dev/null +++ b/src/Appwrite/SDK/ContentType.php @@ -0,0 +1,15 @@ +<?php + +namespace Appwrite\SDK; + +enum ContentType: string +{ + case NONE = ''; + case JSON = 'application/json'; + case IMAGE = 'image/*'; + case IMAGE_PNG = 'image/png'; + case MULTIPART = 'multipart/form-data'; + case HTML = 'text/html'; + case TEXT = 'text/plain'; + case ANY = '*/*'; +} diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php new file mode 100644 index 0000000000..626459ea7f --- /dev/null +++ b/src/Appwrite/SDK/Method.php @@ -0,0 +1,286 @@ +<?php + +namespace Appwrite\SDK; + +use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Response; +use Swoole\Http\Response as HttpResponse; + +class Method +{ + public static array $processed = []; + + public static array $errors = []; + + /** + * Initialise a new SDK method + * + * @param string $namespace + * @param string $name + * @param string $description + * @param array<AuthType> $auth + * @param array<SDKResponse> $responses + * @param ContentType $responseType + * @param MethodType|null $methodType + * @param bool $deprecated + * @param array|bool $hide + * @param bool $packaging + * @param string $requestType + * @param array $parameters + * @param array $additionalParameters + * + * @throws \Exception + */ + public function __construct( + protected string $namespace, + protected string $name, + protected string $description, + protected array $auth, + protected array $responses, + protected ContentType $contentType = ContentType::JSON, + protected ?MethodType $type = null, + protected bool $deprecated = false, + protected array|bool $hide = false, + protected bool $packaging = false, + protected string $requestType = 'application/json', + protected array $parameters = [], + protected array $additionalParameters = [] + ) { + $this->validateMethod($name, $namespace); + $this->validateAuthTypes($auth); + $this->validateDesc($description); + + foreach ($responses as $response) { + /** @var SDKResponse $response */ + $this->validateResponseModel($response->getModel()); + $this->validateNoContent($response); + } + } + + protected function getRouteName(): string + { + return $this->namespace . '.' . $this->name; + } + + protected function validateMethod(string $name, string $namespace): void + { + if (\in_array($this->getRouteName(), self::$processed)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Method already exists in namespace {$namespace}"; + } + + self::$processed[] = $this->getRouteName(); + } + + protected function validateAuthTypes(array $authTypes): void + { + foreach ($authTypes as $authType) { + if (!($authType instanceof AuthType)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid auth type"; + } + } + } + + protected function validateDesc(string $desc): void + { + if (empty($desc)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Description label is empty"; + return; + } + + $descPath = $this->getDescriptionFilePath(); + + if (empty($descPath)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; + return; + } + } + + protected function validateResponseModel(string|array $responseModel): void + { + $response = new Response(new HttpResponse()); + + if (!\is_array($responseModel)) { + $responseModel = [$responseModel]; + } + + foreach ($responseModel as $model) { + try { + $response->getModel($model); + } catch (\Exception $e) { + self::$errors[] = "Error with {$this->getRouteName()} method: Invalid response model, make sure the model has been defined in Response.php"; + } + } + } + + protected function validateNoContent(SDKResponse $response): void + { + if ($response->getCode() === 204) { + if ($response->getModel() !== Response::MODEL_NONE) { + self::$errors[] = "Error with {$this->getRouteName()} method: Response code 204 must have response model 'none'"; + } + } + } + + public function getNamespace(): string + { + return $this->namespace; + } + + public function getMethodName(): string + { + return $this->name; + } + + public function getDescription(): string + { + return $this->description; + } + + /** + * This method returns the absolute path to the description file returning null if the file does not exist. + * + * @return string|null + */ + public function getDescriptionFilePath(): ?string + { + return \realpath(__DIR__ . '/../../../' . $this->getDescription()) ?: null; + } + + public function getAuth(): array + { + return $this->auth; + } + + /** + * @return array<SDKResponse> + */ + public function getResponses(): array + { + return $this->responses; + } + + public function getContentType(): ContentType + { + return $this->contentType; + } + + public function getType(): ?MethodType + { + return $this->type; + } + + public function isDeprecated(): bool + { + return $this->deprecated; + } + + public function isHidden(): bool|array + { + return $this->hide ?? false; + } + + public function isPackaging(): bool + { + return $this->packaging; + } + + public function getRequestType(): string + { + return $this->requestType; + } + + public function getParameters(): array + { + return $this->parameters; + } + + public function getAdditionalParameters(): array + { + return $this->additionalParameters; + } + + public function setNamespace(string $namespace): self + { + $this->namespace = $namespace; + return $this; + } + + public function setMethodName(string $name): self + { + $this->name = $name; + return $this; + } + + public function setDescription(string $description): self + { + $this->description = $description; + return $this; + } + + public function setAuth(array $auth): self + { + $this->validateAuthTypes($auth); + $this->auth = $auth; + return $this; + } + + /** + * @param array<SDKResponse> $responses + */ + public function setResponses(array $responses): self + { + foreach ($responses as $response) { + $this->validateResponseModel($response->getModel()); + $this->validateNoContent($response); + } + $this->responses = $responses; + return $this; + } + + public function setContentType(ContentType $contentType): self + { + $this->contentType = $contentType; + return $this; + } + + public function setType(?MethodType $type): self + { + $this->type = $type; + return $this; + } + + public function setDeprecated(bool $deprecated): self + { + $this->deprecated = $deprecated; + return $this; + } + + public function setHide(bool|array $hide): self + { + $this->hide = $hide; + return $this; + } + + public function setPackaging(bool $packaging): self + { + $this->packaging = $packaging; + return $this; + } + + public function setRequestType(string $requestType): self + { + $this->requestType = $requestType; + return $this; + } + + public function setParameters(array $parameters): self + { + $this->parameters = $parameters; + return $this; + } + + public static function getErrors(): array + { + return self::$errors; + } +} diff --git a/src/Appwrite/SDK/MethodType.php b/src/Appwrite/SDK/MethodType.php new file mode 100644 index 0000000000..2b1f786779 --- /dev/null +++ b/src/Appwrite/SDK/MethodType.php @@ -0,0 +1,11 @@ +<?php + +namespace Appwrite\SDK; + +enum MethodType: string +{ + case WEBAUTH = 'webAuth'; + case LOCATION = 'location'; + case GRAPHQL = 'graphql'; + case UPLOAD = 'upload'; +} diff --git a/src/Appwrite/SDK/Response.php b/src/Appwrite/SDK/Response.php new file mode 100644 index 0000000000..e87813024b --- /dev/null +++ b/src/Appwrite/SDK/Response.php @@ -0,0 +1,27 @@ +<?php + +namespace Appwrite\SDK; + +class Response +{ + /** + * @param int $code + * @param string|array $model + * @param string $description + */ + public function __construct( + private int $code, + private string|array $model + ) { + } + + public function getCode(): int + { + return $this->code; + } + + public function getModel(): string|array + { + return $this->model; + } +} diff --git a/src/Appwrite/Specification/Format.php b/src/Appwrite/Specification/Format.php index 30ce6470e1..8396f5cb7c 100644 --- a/src/Appwrite/Specification/Format.php +++ b/src/Appwrite/Specification/Format.php @@ -215,6 +215,8 @@ abstract class Format switch ($param) { case 'status': return 'MessageStatus'; + case 'priority': + return 'MessagePriority'; } break; case 'createSmtpProvider': diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index f7430ec70e..bd5405539d 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -120,28 +122,49 @@ class OpenAPI3 extends Format foreach ($this->routes as $route) { $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; + $sdk = $route->getLabel('sdk', false); - $method = $route->getLabel('sdk.method', \uniqid()); - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + if (empty($sdk)) { + continue; + } + + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + + /** + * @var \Appwrite\SDK\Method $sdk + */ + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + + $desc = $sdk->getDescriptionFilePath(); + $produces = ($sdk->getContentType())->value; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -152,102 +175,140 @@ class OpenAPI3 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'operationId' => $namespace . ucfirst($method), + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging() ], ]; - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [] + ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => '#/components/schemas/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + // Handle response models + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } + } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => $modelDescription, - 'content' => [ - $produces => [ - 'schema' => [ - 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) - ], - ], - ], + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => $model->getName(), - 'content' => [ - $produces => [ - 'schema' => [ - '$ref' => '#/components/schemas/' . $model->getType(), + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'content' => [ + $produces => [ + 'schema' => [ + 'oneOf' => \array_map(fn ($m) => ['$ref' => '#/components/schemas/' . $m->getType()], $model) + ], ], ], - ], - ]; + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'content' => [ + $produces => [ + 'schema' => [ + '$ref' => '#/components/schemas/' . $model->getType(), + ], + ], + ], + ]; + } } - } - if ($route->getLabel('sdk.response.code', 500) === 204) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (($response->getCode() ?? 500) === 204) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -298,7 +359,7 @@ class OpenAPI3 extends Format $node['schema']['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getType() === MethodType::UPLOAD) { $node['schema']['x-upload-id'] = true; } $node['schema']['type'] = $validator->getType(); @@ -422,7 +483,7 @@ class OpenAPI3 extends Format $allowed = true; foreach ($this->enumBlacklist as $blacklist) { if ( - $blacklist['namespace'] == $route->getLabel('sdk.namespace', '') + $blacklist['namespace'] == $sdk->getNamespace() && $blacklist['method'] == $method && $blacklist['parameter'] == $name ) { @@ -433,8 +494,8 @@ class OpenAPI3 extends Format if ($allowed) { $node['schema']['enum'] = $validator->getList(); - $node['schema']['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['schema']['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['schema']['x-enum-name'] = $this->getEnumName($sdk->getNamespace() ?? '', $method, $name); + $node['schema']['x-enum-keys'] = $this->getEnumKeys($sdk->getNamespace() ?? '', $method, $name); } if ($validator->getType() === 'integer') { $node['format'] = 'int32'; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index f2e324c71f..7277e3ab2b 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -2,6 +2,8 @@ namespace Appwrite\Specification\Format; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\MethodType; use Appwrite\Specification\Format; use Appwrite\Template\Template; use Appwrite\Utopia\Response\Model; @@ -118,27 +120,47 @@ class Swagger2 extends Format /** @var \Utopia\Route $route */ $url = \str_replace('/v1', '', $route->getPath()); $scope = $route->getLabel('scope', ''); - $consumes = [$route->getLabel('sdk.request.type', 'application/json')]; - $method = $route->getLabel('sdk.method', \uniqid()); - $desc = (!empty($route->getLabel('sdk.description', ''))) ? \realpath(__DIR__ . '/../../../../' . $route->getLabel('sdk.description', '')) : null; - $produces = $route->getLabel('sdk.response.type', null); - $model = $route->getLabel('sdk.response.model', 'none'); - $routeSecurity = $route->getLabel('sdk.auth', []); + /** @var \Appwrite\SDK\Method $sdk */ + $sdk = $route->getLabel('sdk', false); + + if (empty($sdk)) { + continue; + } + + $additionalMethods = null; + if (is_array($sdk)) { + $mainSdk = array_shift($sdk); + $additionalMethods = $sdk; + + $sdk = $mainSdk; + } + + $consumes = [$sdk->getRequestType()]; + + $method = $sdk->getMethodName() ?? \uniqid(); + + if (!empty($method) && is_array($method)) { + $method = array_keys($method)[0]; + } + + $desc = $sdk->getDescriptionFilePath(); + $produces = ($sdk->getContentType())->value; + $routeSecurity = $sdk->getAuth() ?? []; $sdkPlatforms = []; foreach ($routeSecurity as $value) { switch ($value) { - case APP_AUTH_TYPE_SESSION: + case AuthType::SESSION: $sdkPlatforms[] = APP_PLATFORM_CLIENT; break; - case APP_AUTH_TYPE_KEY: + case AuthType::KEY: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_JWT: + case AuthType::JWT: $sdkPlatforms[] = APP_PLATFORM_SERVER; break; - case APP_AUTH_TYPE_ADMIN: + case AuthType::ADMIN: $sdkPlatforms[] = APP_PLATFORM_CONSOLE; break; } @@ -149,31 +171,30 @@ class Swagger2 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $namespace = $sdk->getNamespace() ?? 'default'; + $temp = [ 'summary' => $route->getDesc(), - 'operationId' => $route->getLabel('sdk.namespace', 'default') . ucfirst($method), + 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], - 'tags' => [$route->getLabel('sdk.namespace', 'default')], + 'tags' => [$namespace], 'description' => ($desc) ? \file_get_contents($desc) : '', 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, 'weight' => $route->getOrder(), 'cookies' => $route->getLabel('sdk.cookies', false), - 'type' => $route->getLabel('sdk.methodType', ''), - 'deprecated' => $route->getLabel('sdk.deprecated', false), - 'demo' => Template::fromCamelCaseToDash($route->getLabel('sdk.namespace', 'default')) . '/' . Template::fromCamelCaseToDash($method) . '.md', - 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $route->getLabel('sdk.description', ''), + 'type' => $sdk->getType()->value ?? '', + 'deprecated' => $sdk->isDeprecated(), + 'demo' => Template::fromCamelCaseToDash($namespace) . '/' . Template::fromCamelCaseToDash($method) . '.md', + 'edit' => 'https://github.com/appwrite/appwrite/edit/master' . $sdk->getDescription() ?? '', 'rate-limit' => $route->getLabel('abuse-limit', 0), 'rate-time' => $route->getLabel('abuse-time', 3600), 'rate-key' => $route->getLabel('abuse-key', 'url:{url},ip:{ip}'), 'scope' => $route->getLabel('scope', ''), 'platforms' => $sdkPlatforms, - 'packaging' => $route->getLabel('sdk.packaging', false), - 'offline-model' => $route->getLabel('sdk.offline.model', ''), - 'offline-key' => $route->getLabel('sdk.offline.key', ''), - 'offline-response-key' => $route->getLabel('sdk.offline.response.key', '$id'), + 'packaging' => $sdk->isPackaging() ], ]; @@ -181,71 +202,111 @@ class Swagger2 extends Format $temp['produces'][] = $produces; } - foreach ($this->models as $value) { - if (\is_array($model)) { - $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); - } else { - if ($value->getType() === $model) { - $model = $value; - break; + if (!empty($additionalMethods)) { + $temp['x-appwrite']['additional-methods'] = []; + foreach ($additionalMethods as $method) { + /** @var \Appwrite\SDK\Method $method */ + $additionalMethod = [ + 'name' => $method->getMethodName(), + 'parameters' => [], + 'required' => [], + 'responses' => [], + 'description' => $method->getDescription(), + ]; + + foreach ($method->getParameters() as $name => $param) { + $additionalMethod['parameters'][] = $name; + + if (!$param['optional']) { + $additionalMethod['required'][] = $name; + } } + + foreach ($method->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $additionalMethod['responses'][] = [ + 'code' => $response->getCode(), + 'model' => '#/definitions/' . $response->getModel() + ]; + } + + $temp['x-appwrite']['additional-methods'][] = $additionalMethod; } } - if (!(\is_array($model)) && $model->isNone()) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => in_array($produces, [ - 'image/*', - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/webp', - 'image/svg-x', - 'image/x-icon', - 'image/bmp', - ]) ? 'Image' : 'File', - 'schema' => [ - 'type' => 'file' - ], - ]; - } else { - if (\is_array($model)) { - $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); - // model has multiple possible responses, we will use oneOf - foreach ($model as $m) { - $usedModels[] = $m->getType(); + // Handle Responses + + foreach ($sdk->getResponses() as $response) { + /** @var \Appwrite\SDK\Response $response */ + $model = $response->getModel(); + + foreach ($this->models as $value) { + if (\is_array($model)) { + $model = \array_map(fn ($m) => $m === $value->getType() ? $value : $m, $model); + } else { + if ($value->getType() === $model) { + $model = $value; + break; + } } - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => $modelDescription, + } + + if (!(\is_array($model)) && $model->isNone()) { + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => in_array($produces, [ + 'image/*', + 'image/jpeg', + 'image/gif', + 'image/png', + 'image/webp', + 'image/svg-x', + 'image/x-icon', + 'image/bmp', + ]) ? 'Image' : 'File', 'schema' => [ - 'x-oneOf' => \array_map(function ($m) { - return ['$ref' => '#/definitions/' . $m->getType()]; - }, $model) + 'type' => 'file' ], ]; } else { - // Response definition using one type - $usedModels[] = $model->getType(); - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')] = [ - 'description' => $model->getName(), - 'schema' => [ - '$ref' => '#/definitions/' . $model->getType(), - ], - ]; + if (\is_array($model)) { + $modelDescription = \join(', or ', \array_map(fn ($m) => $m->getName(), $model)); + // model has multiple possible responses, we will use oneOf + foreach ($model as $m) { + $usedModels[] = $m->getType(); + } + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $modelDescription, + 'schema' => [ + 'x-oneOf' => \array_map(function ($m) { + return ['$ref' => '#/definitions/' . $m->getType()]; + }, $model) + ], + ]; + } else { + // Response definition using one type + $usedModels[] = $model->getType(); + $temp['responses'][(string)$response->getCode() ?? '500'] = [ + 'description' => $model->getName(), + 'schema' => [ + '$ref' => '#/definitions/' . $model->getType(), + ], + ]; + } } - } - if (in_array($route->getLabel('sdk.response.code', 500), [204, 301, 302, 308], true)) { - $temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['description'] = 'No content'; - unset($temp['responses'][(string)$route->getLabel('sdk.response.code', '500')]['schema']); + if (in_array($response->getCode() ?? 500, [204, 301, 302, 308], true)) { + $temp['responses'][(string)$response->getCode() ?? '500']['description'] = 'No content'; + unset($temp['responses'][(string)$response->getCode() ?? '500']['schema']); + } } if ((!empty($scope))) { // && 'public' != $scope $securities = ['Project' => []]; - foreach ($route->getLabel('sdk.auth', []) as $security) { - if (array_key_exists($security, $this->keys)) { - $securities[$security] = []; + foreach ($sdk->getAuth() as $security) { + /** @var \Appwrite\SDK\AuthType $security */ + if (array_key_exists($security->value, $this->keys)) { + $securities[$security->value] = []; } } @@ -266,7 +327,7 @@ class Swagger2 extends Format $parameters = \array_merge( $route->getParams(), - $route->getLabel('sdk.parameters', []), + $sdk->getAdditionalParameters() ?? [], ); foreach ($parameters as $name => $param) { // Set params @@ -316,7 +377,7 @@ class Swagger2 extends Format $node['x-example'] = false; break; case 'Appwrite\Utopia\Database\Validator\CustomId': - if ($route->getLabel('sdk.methodType', '') === 'upload') { + if ($sdk->getType() === MethodType::UPLOAD) { $node['x-upload-id'] = true; } $node['type'] = $validator->getType(); @@ -423,7 +484,7 @@ class Swagger2 extends Format //Iterate the blackList. If it matches with the current one, then it is blackListed $allowed = true; foreach ($this->enumBlacklist as $blacklist) { - if ($blacklist['namespace'] == $route->getLabel('sdk.namespace', '') && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { + if ($blacklist['namespace'] == $namespace && $blacklist['method'] == $method && $blacklist['parameter'] == $name) { $allowed = false; break; } @@ -431,8 +492,8 @@ class Swagger2 extends Format if ($allowed && $validator->getType() === 'string') { $node['enum'] = $validator->getList(); - $node['x-enum-name'] = $this->getEnumName($route->getLabel('sdk.namespace', ''), $method, $name); - $node['x-enum-keys'] = $this->getEnumKeys($route->getLabel('sdk.namespace', ''), $method, $name); + $node['x-enum-name'] = $this->getEnumName($namespace, $method, $name); + $node['x-enum-keys'] = $this->getEnumKeys($namespace, $method, $name); } if ($validator->getType() === 'integer') { diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php b/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php index 6b9e9e6d32..436a95534b 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php @@ -8,6 +8,7 @@ class Migrations extends Base 'status', 'stage', 'source', + 'destination', 'resources', 'statusCounters', 'resourceData', diff --git a/src/Appwrite/Utopia/Request.php b/src/Appwrite/Utopia/Request.php index 26c1baf188..f8c0439293 100644 --- a/src/Appwrite/Utopia/Request.php +++ b/src/Appwrite/Utopia/Request.php @@ -28,8 +28,30 @@ class Request extends UtopiaRequest $parameters = parent::getParams(); if ($this->hasFilters() && self::hasRoute()) { - $method = self::getRoute()->getLabel('sdk.method', 'unknown'); - $endpointIdentifier = self::getRoute()->getLabel('sdk.namespace', 'unknown') . '.' . $method; + $methods = self::getRoute()->getLabel('sdk', null); + + if (!\is_array($methods)) { + $methods = [$methods]; + } + + $params = []; + + foreach ($methods as $method) { + /** @var \Appwrite\SDK\Method $method */ + if (empty($method)) { + $endpointIdentifier = 'unknown.unknown'; + } else { + $endpointIdentifier = $method->getNamespace() . '.' . $method->getMethodName(); + } + + $params += $method->getParameters(); + } + + if (!empty($params)) { + $parameters = array_filter($parameters, function ($key) use ($params) { + return array_key_exists($key, $params); + }, \ARRAY_FILTER_USE_KEY); + } foreach ($this->getFilters() as $filter) { $parameters = $filter->parse($parameters, $endpointIdentifier); diff --git a/src/Appwrite/Utopia/Response/Model/Func.php b/src/Appwrite/Utopia/Response/Model/Func.php index f4ff214d0b..ab2d7ba051 100644 --- a/src/Appwrite/Utopia/Response/Model/Func.php +++ b/src/Appwrite/Utopia/Response/Model/Func.php @@ -94,7 +94,7 @@ class Func extends Model ]) ->addRule('schedule', [ 'type' => self::TYPE_STRING, - 'description' => 'Function execution schedult in CRON format.', + 'description' => 'Function execution schedule in CRON format.', 'default' => '', 'example' => '5 4 * * *', ]) diff --git a/src/Appwrite/Utopia/Response/Model/Membership.php b/src/Appwrite/Utopia/Response/Model/Membership.php index 64283bd4a8..46153842bc 100644 --- a/src/Appwrite/Utopia/Response/Model/Membership.php +++ b/src/Appwrite/Utopia/Response/Model/Membership.php @@ -36,13 +36,13 @@ class Membership extends Model ]) ->addRule('userName', [ 'type' => self::TYPE_STRING, - 'description' => 'User name.', + 'description' => 'User name. Hide this attribute by toggling membership privacy in the Console.', 'default' => '', 'example' => 'John Doe', ]) ->addRule('userEmail', [ 'type' => self::TYPE_STRING, - 'description' => 'User email address.', + 'description' => 'User email address. Hide this attribute by toggling membership privacy in the Console.', 'default' => '', 'example' => 'john@appwrite.io', ]) @@ -78,7 +78,7 @@ class Membership extends Model ]) ->addRule('mfa', [ 'type' => self::TYPE_BOOLEAN, - 'description' => 'Multi factor authentication status, true if the user has MFA enabled or false otherwise.', + 'description' => 'Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.', 'default' => false, 'example' => false, ]) diff --git a/src/Appwrite/Utopia/Response/Model/MetricBreakdown.php b/src/Appwrite/Utopia/Response/Model/MetricBreakdown.php index 29d5621532..ba46afcb77 100644 --- a/src/Appwrite/Utopia/Response/Model/MetricBreakdown.php +++ b/src/Appwrite/Utopia/Response/Model/MetricBreakdown.php @@ -15,6 +15,7 @@ class MetricBreakdown extends Model 'description' => 'Resource ID.', 'default' => '', 'example' => '5e5ea5c16897e', + 'required' => false, ]) ->addRule('name', [ 'type' => self::TYPE_STRING, @@ -27,6 +28,13 @@ class MetricBreakdown extends Model 'description' => 'The value of this metric at the timestamp.', 'default' => 0, 'example' => 1, + ]) + ->addRule('estimate', [ + 'type' => self::TYPE_FLOAT, + 'description' => 'The estimated value of this metric at the end of the period.', + 'default' => 0, + 'example' => 1, + 'required' => false, ]); } diff --git a/src/Appwrite/Utopia/Response/Model/Migration.php b/src/Appwrite/Utopia/Response/Model/Migration.php index bb13c2cb04..f70dc37027 100644 --- a/src/Appwrite/Utopia/Response/Model/Migration.php +++ b/src/Appwrite/Utopia/Response/Model/Migration.php @@ -46,9 +46,15 @@ class Migration extends Model 'default' => '', 'example' => 'Appwrite', ]) + ->addRule('destination', [ + 'type' => self::TYPE_STRING, + 'description' => 'A string containing the type of destination of the migration.', + 'default' => 'Appwrite', + 'example' => 'Appwrite', + ]) ->addRule('resources', [ 'type' => self::TYPE_STRING, - 'description' => 'Resources to migration.', + 'description' => 'Resources to migrate.', 'default' => [], 'example' => ['user'], 'array' => true diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index e1d0105587..6e01baee84 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -151,6 +151,24 @@ class Project extends Model 'default' => false, 'example' => true, ]) + ->addRule('authMembershipsUserName', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether or not to show user names in the teams membership response.', + 'default' => false, + 'example' => true, + ]) + ->addRule('authMembershipsUserEmail', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether or not to show user emails in the teams membership response.', + 'default' => false, + 'example' => true, + ]) + ->addRule('authMembershipsMfa', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether or not to show user MFA status in the teams membership response.', + 'default' => false, + 'example' => true, + ]) ->addRule('oAuthProviders', [ 'type' => Response::MODEL_AUTH_PROVIDER, 'description' => 'List of Auth Providers.', @@ -348,6 +366,9 @@ class Project extends Model $document->setAttribute('authPersonalDataCheck', $authValues['personalDataCheck'] ?? false); $document->setAttribute('authMockNumbers', $authValues['mockNumbers'] ?? []); $document->setAttribute('authSessionAlerts', $authValues['sessionAlerts'] ?? false); + $document->setAttribute('authMembershipsUserName', $authValues['membershipsUserName'] ?? true); + $document->setAttribute('authMembershipsUserEmail', $authValues['membershipsUserEmail'] ?? true); + $document->setAttribute('authMembershipsMfa', $authValues['membershipsMfa'] ?? true); foreach ($auth as $index => $method) { $key = $method['key']; diff --git a/src/Appwrite/Utopia/Response/Model/Target.php b/src/Appwrite/Utopia/Response/Model/Target.php index d180b6c4c4..530749e006 100644 --- a/src/Appwrite/Utopia/Response/Model/Target.php +++ b/src/Appwrite/Utopia/Response/Model/Target.php @@ -32,7 +32,7 @@ class Target extends Model 'type' => self::TYPE_STRING, 'description' => 'Target Name.', 'default' => '', - 'example' => 'Aegon apple token', + 'example' => 'Apple iPhone 12', ]) ->addRule('userId', [ 'type' => self::TYPE_STRING, @@ -58,6 +58,12 @@ class Target extends Model 'description' => 'The target identifier.', 'default' => '', 'example' => 'token', + ]) + ->addRule('expired', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Is the target expired.', + 'default' => false, + 'example' => false, ]); } diff --git a/src/Appwrite/Utopia/Response/Model/UsageDatabase.php b/src/Appwrite/Utopia/Response/Model/UsageDatabase.php index eb985baabb..a0fe421f5f 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageDatabase.php +++ b/src/Appwrite/Utopia/Response/Model/UsageDatabase.php @@ -34,6 +34,18 @@ class UsageDatabase extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('databaseReadsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases reads.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('databaseWritesTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases writes.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('collections', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated number of collections per period.', @@ -55,6 +67,20 @@ class UsageDatabase extends Model 'example' => [], 'array' => true ]) + ->addRule('databaseReads', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database reads.', + 'default' => [], + 'example' => [], + 'array' => true + ]) + ->addRule('databaseWrites', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database writes.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/UsageDatabases.php b/src/Appwrite/Utopia/Response/Model/UsageDatabases.php index e0abba8ab8..4e053e5223 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageDatabases.php +++ b/src/Appwrite/Utopia/Response/Model/UsageDatabases.php @@ -40,6 +40,18 @@ class UsageDatabases extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('databasesReadsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases reads.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('databasesWritesTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases writes.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('databases', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated number of databases per period.', @@ -68,6 +80,20 @@ class UsageDatabases extends Model 'example' => [], 'array' => true ]) + ->addRule('databasesReads', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database reads.', + 'default' => [], + 'example' => [], + 'array' => true + ]) + ->addRule('databasesWrites', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database writes.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/UsageProject.php b/src/Appwrite/Utopia/Response/Model/UsageProject.php index 17d9271f04..1006276b56 100644 --- a/src/Appwrite/Utopia/Response/Model/UsageProject.php +++ b/src/Appwrite/Utopia/Response/Model/UsageProject.php @@ -82,6 +82,18 @@ class UsageProject extends Model 'default' => 0, 'example' => 0, ]) + ->addRule('databasesReadsTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases reads.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('databasesWritesTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total number of databases writes.', + 'default' => 0, + 'example' => 0, + ]) ->addRule('requests', [ 'type' => Response::MODEL_METRIC, 'description' => 'Aggregated number of requests per period.', @@ -152,6 +164,39 @@ class UsageProject extends Model 'example' => [], 'array' => true ]) + ->addRule('authPhoneTotal', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Total aggregated number of phone auth.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('authPhoneEstimate', [ + 'type' => self::TYPE_FLOAT, + 'description' => 'Estimated total aggregated cost of phone auth.', + 'default' => 0, + 'example' => 0, + ]) + ->addRule('authPhoneCountryBreakdown', [ + 'type' => Response::MODEL_METRIC_BREAKDOWN, + 'description' => 'Aggregated breakdown in totals of phone auth by country.', + 'default' => [], + 'example' => [], + 'array' => true + ]) + ->addRule('databasesReads', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database reads.', + 'default' => [], + 'example' => [], + 'array' => true + ]) + ->addRule('databasesWrites', [ + 'type' => Response::MODEL_METRIC, + 'description' => 'An array of aggregated number of database writes.', + 'default' => [], + 'example' => [], + 'array' => true + ]) ; } diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 0774f1c6fd..dc80808b14 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -179,9 +179,14 @@ class Client default => http_build_query($params), }; - foreach ($headers as $i => $header) { - $headers[] = $i . ':' . $header; - unset($headers[$i]); + $formattedHeaders = []; + foreach ($headers as $key => $value) { + if (strtolower($key) === 'accept-encoding') { + curl_setopt($ch, CURLOPT_ENCODING, $value); + continue; + } else { + $formattedHeaders[] = $key . ': ' . $value; + } } curl_setopt($ch, CURLOPT_PATH_AS_IS, 1); @@ -189,7 +194,7 @@ class Client curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36'); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + curl_setopt($ch, CURLOPT_HTTPHEADER, $formattedHeaders); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 15); curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$responseHeaders, &$cookies) { @@ -220,7 +225,6 @@ class Client curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); } - $responseBody = curl_exec($ch); $responseType = $responseHeaders['content-type'] ?? ''; $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); diff --git a/tests/e2e/General/CompressionTest.php b/tests/e2e/General/CompressionTest.php new file mode 100644 index 0000000000..9affacfe0a --- /dev/null +++ b/tests/e2e/General/CompressionTest.php @@ -0,0 +1,137 @@ +<?php + +namespace Tests\E2E\General; + +use Appwrite\ID; +use Appwrite\Permission; +use Appwrite\Role; +use CURLFile; +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideServer; + +class CompressionTest extends Scope +{ + use ProjectCustom; + use SideServer; + + public function testSmallResponse() + { + // with header + $response = $this->client->call(Client::METHOD_GET, '/ping', [ + 'accept-encoding' => 'gzip', + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('Pong!', $response['body']); + $this->assertLessThan(1024, strlen($response['body'])); + $this->assertArrayNotHasKey('content-encoding', $response['headers']); + + // without header + $response = $this->client->call(Client::METHOD_GET, '/ping', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('Pong!', $response['body']); + $this->assertLessThan(1024, strlen($response['body'])); + $this->assertArrayNotHasKey('content-encoding', $response['headers']); + } + + public function testLargeResponse() + { + // create an anonymous user + $response = $this->client->call(Client::METHOD_POST, '/users', array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'], + 'content-type' => 'application/json', + ], $this->getHeaders()), [ + 'userId' => ID::unique(), + 'email' => 'test@localhost.test', + 'password' => 'password', + 'name' => 'User Name', + ]); + $this->assertEquals(201, $response['headers']['status-code']); + $userId = $response['body']['$id']; + + // set prefs with 2000 bytes of data + $prefs = ["longValue" => str_repeat('a', 2000)]; + + $response = $this->client->call(Client::METHOD_PATCH, '/users/' . $userId . '/prefs', array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'], + 'content-type' => 'application/json', + ], $this->getHeaders()), [ + 'prefs' => $prefs, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + // get prefs with compression + $response = $this->client->call(Client::METHOD_GET, '/users/' . $userId . '/prefs', array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'], + 'accept-encoding' => 'gzip', + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('content-encoding', $response['headers'], 'Content encoding should be gzip, headers received: ' . json_encode($response['headers'], JSON_PRETTY_PRINT)); + $this->assertLessThan(2000, intval($response['headers']['content-length'])); + + // get prefs without compression + $response = $this->client->call(Client::METHOD_GET, '/users/' . $userId . '/prefs', array_merge([ + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertGreaterThanOrEqual(2000, intval($response['headers']['content-length'])); + $this->assertArrayNotHasKey('content-encoding', $response['headers']); + } + + public function testImageResponse() + { + // create bucket + $bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'bucketId' => ID::unique(), + 'name' => 'Test Bucket', + 'fileSecurity' => true, + ]); + $bucketId = $bucket['body']['$id']; + $this->assertEquals(201, $bucket['headers']['status-code']); + + // upload image + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../resources/logo.png'), 'image/png', 'logo.png'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $fileId = $file['body']['$id']; + + // get image with header + $response = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $fileId, array_merge([ + 'content-type' => 'application/json', + 'accept-encoding' => 'gzip', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayNotHasKey('content-encoding', $response['headers']); + // get image without + $response = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $fileId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayNotHasKey('content-encoding', $response['headers']); + } +} diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index c50a15fd3f..74ae1c00bc 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -143,7 +143,7 @@ class UsageTest extends Scope ); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(22, count($response['body'])); + $this->assertEquals(29, count($response['body'])); $this->validateDates($response['body']['network']); $this->validateDates($response['body']['requests']); $this->validateDates($response['body']['users']); @@ -324,7 +324,7 @@ class UsageTest extends Scope ] ); - $this->assertEquals(22, count($response['body'])); + $this->assertEquals(29, count($response['body'])); $this->assertEquals(1, count($response['body']['requests'])); $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); $this->validateDates($response['body']['requests']); @@ -545,7 +545,7 @@ class UsageTest extends Scope ] ); - $this->assertEquals(22, count($response['body'])); + $this->assertEquals(29, count($response['body'])); $this->assertEquals(1, count($response['body']['requests'])); $this->assertEquals(1, count($response['body']['network'])); $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index ad2c93790c..7f84ace6f2 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -94,6 +94,8 @@ trait ProjectCustom 'topics.read', 'subscribers.write', 'subscribers.read', + 'migrations.write', + 'migrations.read' ], ]); diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 244f84b161..cca27cc3be 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -2695,4 +2695,45 @@ class AccountCustomClientTest extends Scope return $data; } + + public function testCreatePushTarget(): void + { + $response = $this->client->call(Client::METHOD_POST, '/account/targets/push', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders()), [ + 'targetId' => ID::unique(), + 'identifier' => 'test-identifier', + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('test-identifier', $response['body']['identifier']); + } + + public function testUpdatePushTarget(): void + { + $response = $this->client->call(Client::METHOD_POST, '/account/targets/push', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'targetId' => ID::unique(), + 'identifier' => 'test-identifier-2', + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('test-identifier-2', $response['body']['identifier']); + + $response = $this->client->call(Client::METHOD_PUT, '/account/targets/'. $response['body']['$id'] .'/push', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'identifier' => 'test-identifier-updated', + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('test-identifier-updated', $response['body']['identifier']); + $this->assertEquals(false, $response['body']['expired']); + } } diff --git a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php index 96bb0b5609..2266c91afe 100644 --- a/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesConsoleClientTest.php @@ -224,7 +224,7 @@ class DatabasesConsoleClientTest extends Scope ]); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(7, count($response['body'])); + $this->assertEquals(11, count($response['body'])); $this->assertEquals('24h', $response['body']['range']); $this->assertIsNumeric($response['body']['documentsTotal']); $this->assertIsNumeric($response['body']['collectionsTotal']); diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 7cb8adb815..b501e2119e 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -1362,7 +1362,7 @@ class DatabasesCustomServerTest extends Scope ]); $this->assertEquals(400, $tooWide['headers']['status-code']); - $this->assertEquals('Attribute limit exceeded', $tooWide['body']['message']); + $this->assertEquals('attribute_limit_exceeded', $tooWide['body']['type']); } public function testIndexLimitException() diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 9b9f03a100..d8d1eb8eb5 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -375,7 +375,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('ready', $deployment['body']['status']); - }, 500000, 1000); + }, 50000, 1000); $function = $this->getFunction($functionId); diff --git a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php index b1315103b1..4f4b0c960d 100644 --- a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php +++ b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php @@ -1,12 +1,13 @@ <?php -namespace Tests\E2E\Services\Functions; +namespace Tests\E2E\Services\FunctionsSchedule; use Appwrite\ID; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; +use Tests\E2E\Services\Functions\FunctionsBase; use Utopia\Database\Helpers\Role; class FunctionsScheduleTest extends Scope diff --git a/tests/e2e/Services/Health/HealthCustomServerTest.php b/tests/e2e/Services/Health/HealthCustomServerTest.php index 8360af542e..9d6a04abe6 100644 --- a/tests/e2e/Services/Health/HealthCustomServerTest.php +++ b/tests/e2e/Services/Health/HealthCustomServerTest.php @@ -455,7 +455,7 @@ class HealthCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals('/CN=www.google.com', $response['body']['name']); $this->assertEquals('www.google.com', $response['body']['subjectSN']); - $this->assertStringContainsString('Google Trust Services', $response['body']['issuerOrganisation']); + $this->assertContains($response['body']['issuerOrganisation'], ['Let\'s Encrypt', 'Google Trust Services']); $this->assertIsInt($response['body']['validFrom']); $this->assertIsInt($response['body']['validTo']); @@ -467,7 +467,7 @@ class HealthCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals('/CN=appwrite.io', $response['body']['name']); $this->assertEquals('appwrite.io', $response['body']['subjectSN']); - $this->assertEquals("Let's Encrypt", $response['body']['issuerOrganisation']); + $this->assertContains($response['body']['issuerOrganisation'], ['Let\'s Encrypt', 'Google Trust Services']); $this->assertIsInt($response['body']['validFrom']); $this->assertIsInt($response['body']['validTo']); diff --git a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php index 1b0d840f96..245eb3e8de 100644 --- a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php +++ b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php @@ -2,6 +2,7 @@ namespace Tests\E2E\Services\Messaging; +use Appwrite\Tests\Async; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; @@ -11,6 +12,8 @@ use Utopia\Database\Query; class MessagingConsoleClientTest extends Scope { + use Async; + use MessagingBase; use ProjectCustom; use SideConsole; @@ -54,15 +57,18 @@ class MessagingConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $logs = $this->client->call(Client::METHOD_GET, '/messaging/providers/' . $provider['body']['$id'] . '/logs', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + // required for Cloud x Audits + $this->assertEventually(function () use ($provider) { + $logs = $this->client->call(Client::METHOD_GET, '/messaging/providers/' . $provider['body']['$id'] . '/logs', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - $this->assertEquals($logs['headers']['status-code'], 200); - $this->assertIsArray($logs['body']['logs']); - $this->assertIsNumeric($logs['body']['total']); - $this->assertCount(2, $logs['body']['logs']); + $this->assertEquals($logs['headers']['status-code'], 200); + $this->assertIsArray($logs['body']['logs']); + $this->assertIsNumeric($logs['body']['total']); + $this->assertCount(2, $logs['body']['logs']); + }); $logs = $this->client->call(Client::METHOD_GET, '/messaging/providers/' . $provider['body']['$id'] . '/logs', \array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php new file mode 100644 index 0000000000..e4c7ba7712 --- /dev/null +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -0,0 +1,895 @@ +<?php + +namespace Tests\E2E\Services\Migrations; + +use CURLFile; +use Tests\E2E\Client; +use Tests\E2E\Scopes\ProjectCustom; +use Tests\E2E\Services\Functions\FunctionsBase; +use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; +use Utopia\Migration\Resource; +use Utopia\Migration\Sources\Appwrite; + +trait MigrationsBase +{ + use ProjectCustom; + use FunctionsBase; + + /** + * @var array + */ + protected static $destinationProject = []; + + /** + * @param bool $fresh + * @return array + */ + public function getDesintationProject(bool $fresh = false): array + { + if (!empty(self::$destinationProject) && !$fresh) { + return self::$destinationProject; + } + + $projectBackup = self::$project; + + self::$destinationProject = $this->getProject(true); + self::$project = $projectBackup; + + return self::$destinationProject; + } + + public function performMigrationSync( + array $body, + ): array { + $migration = $this->client->call(Client::METHOD_POST, '/migrations/appwrite', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ], $body); + + $this->assertEquals(202, $migration['headers']['status-code']); + $this->assertNotEmpty($migration['body']); + $this->assertNotEmpty($migration['body']['$id']); + + $attempts = 0; + while ($attempts < 5) { + $response = $this->client->call(Client::METHOD_GET, '/migrations/' . $migration['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + if ($response['body']['status'] === 'failed') { + $this->fail('Migration failed', json_encode($response['body'], JSON_PRETTY_PRINT)); + } + + $this->assertNotEquals('failed', $response['body']['status']); + + if ($response['body']['status'] === 'completed') { + return $response['body']; + } + + if ($attempts === 4) { + $this->assertEquals('completed', $response['body']['status']); + } + + $attempts++; + sleep(5); + } + } + + /** + * Appwrite E2E Migration Tests + */ + public function testCreateAppwriteMigration() + { + $response = $this->performMigrationSync([ + 'resources' => Appwrite::getSupportedResources(), + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals(Appwrite::getSupportedResources(), $response['resources']); + $this->assertEquals('Appwrite', $response['source']); + $this->assertEquals('Appwrite', $response['destination']); + $this->assertEmpty($response['statusCounters']); + } + + /** + * Auth + */ + public function testAppwriteMigrationAuthUserPassword() + { + $response = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'userId' => ID::unique(), + 'email' => 'test@test.com', + 'password' => 'password', + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('test@test.com', $response['body']['email']); + + $user = $response['body']; + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_USER, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_USER], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_USER, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_USER]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($user['email'], $response['body']['email']); + $this->assertEquals($user['password'], $response['body']['password']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + } + + public function testAppwriteMigrationAuthUserPhone() + { + $response = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'userId' => ID::unique(), + 'phone' => '+12065550100', + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('+12065550100', $response['body']['phone']); + + $user = $response['body']; + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_USER, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_USER], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_USER, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_USER]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($user['phone'], $response['body']['phone']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + } + + public function testAppwriteMigrationAuthTeam() + { + $user = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'userId' => ID::unique(), + 'email' => 'test@test.com', + 'password' => 'password', + ]); + + $this->assertEquals(201, $user['headers']['status-code']); + $this->assertNotEmpty($user['body']); + $this->assertNotEmpty($user['body']['$id']); + $this->assertEquals('test@test.com', $user['body']['email']); + + $team = $this->client->call(Client::METHOD_POST, '/teams', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'teamId' => ID::unique(), + 'name' => 'Test Team', + ]); + + $this->assertEquals(201, $team['headers']['status-code']); + $this->assertNotEmpty($team['body']); + $this->assertNotEmpty($team['body']['$id']); + + $membership = $this->client->call(Client::METHOD_POST, '/teams/' . $team['body']['$id'] . '/memberships', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'teamId' => $team['body']['$id'], + 'userId' => $user['body']['$id'], + 'roles' => ['owner'], + ]); + + $this->assertEquals(201, $membership['headers']['status-code']); + $this->assertNotEmpty($membership['body']); + $this->assertNotEmpty($membership['body']['$id']); + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_USER, + Resource::TYPE_TEAM, + Resource::TYPE_MEMBERSHIP, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_USER, Resource::TYPE_TEAM, Resource::TYPE_MEMBERSHIP], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_USER, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_USER]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_USER]['warning']); + + $this->assertArrayHasKey(Resource::TYPE_TEAM, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_TEAM]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_TEAM]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_TEAM]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_TEAM]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_TEAM]['warning']); + + $this->assertArrayHasKey(Resource::TYPE_MEMBERSHIP, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_MEMBERSHIP]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_MEMBERSHIP]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_MEMBERSHIP]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_MEMBERSHIP]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_MEMBERSHIP]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $team['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($team['body']['name'], $response['body']['name']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $team['body']['$id'] . '/memberships', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + + $membership = $response['body']['memberships'][0]; + + $this->assertEquals($user['body']['$id'], $membership['userId']); + $this->assertEquals($team['body']['$id'], $membership['teamId']); + $this->assertEquals(['owner'], $membership['roles']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/teams/' . $team['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/teams/' . $team['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/users/' . $user['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/teams/' . $team['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/teams/' . $team['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + } + + /** + * Databases + */ + public function testAppwriteMigrationDatabase() + { + $response = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'databaseId' => ID::unique(), + 'name' => 'Test Database' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + $databaseId = $response['body']['$id']; + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_DATABASE, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_DATABASE], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_DATABASE, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_DATABASE]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DATABASE]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + $this->assertEquals($databaseId, $response['body']['$id']); + $this->assertEquals('Test Database', $response['body']['name']); + + // Cleanup on destination + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + return [ + 'databaseId' => $databaseId, + ]; + } + + /** + * @depends testAppwriteMigrationDatabase + */ + public function testAppwriteMigrationDatabasesCollection(array $data) + { + $databaseId = $data['databaseId']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'collectionId' => ID::unique(), + 'name' => 'Test Collection', + ]); + + $this->assertEquals(201, $collection['headers']['status-code']); + + $collectionId = $collection['body']['$id']; + + // Create Attribute + $response = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/string', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'key' => 'name', + 'size' => 100, + 'encrypt' => false, + 'required' => true + ]); + + $this->assertEquals(202, $response['headers']['status-code']); + + // Wait for attribute to be ready + $this->assertEventually(function () use ($databaseId, $collectionId) { + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/name', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('available', $response['body']['status']); + }, 5000, 500); + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_DATABASE, + Resource::TYPE_COLLECTION, + Resource::TYPE_ATTRIBUTE, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE], $result['resources']); + + foreach ([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE] as $resource) { + $this->assertArrayHasKey($resource, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][$resource]['error']); + $this->assertEquals(0, $result['statusCounters'][$resource]['pending']); + $this->assertEquals(1, $result['statusCounters'][$resource]['success']); + $this->assertEquals(0, $result['statusCounters'][$resource]['processing']); + $this->assertEquals(0, $result['statusCounters'][$resource]['warning']); + } + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + + $this->assertEquals($collectionId, $response['body']['$id']); + $this->assertEquals('Test Collection', $response['body']['name']); + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/name', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + + $this->assertEquals('name', $response['body']['key']); + $this->assertEquals(100, $response['body']['size']); + $this->assertEquals(true, $response['body']['required']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + return [ + 'databaseId' => $databaseId, + 'collectionId' => $collectionId, + ]; + } + + /** + * @depends testAppwriteMigrationDatabasesCollection + */ + public function testAppwriteMigrationDatabasesDocument(array $data) + { + $databaseId = $data['databaseId']; + $collectionId = $data['collectionId']; + + $document = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'documentId' => ID::unique(), + 'data' => [ + 'name' => 'Test Document', + ] + ]); + + $this->assertEquals(201, $document['headers']['status-code']); + $this->assertNotEmpty($document['body']); + $this->assertNotEmpty($document['body']['$id']); + + $documentId = $document['body']['$id']; + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_DATABASE, + Resource::TYPE_COLLECTION, + Resource::TYPE_ATTRIBUTE, + Resource::TYPE_DOCUMENT, + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE, Resource::TYPE_DOCUMENT], $result['resources']); + + //TODO: Add TYPE_DOCUMENT to the migration status counters once pending issue is resolved + foreach ([Resource::TYPE_DATABASE, Resource::TYPE_COLLECTION, Resource::TYPE_ATTRIBUTE] as $resource) { + $this->assertArrayHasKey($resource, $result['statusCounters']); + $this->assertEquals(0, $result['statusCounters'][$resource]['error']); + $this->assertEquals(0, $result['statusCounters'][$resource]['pending']); + $this->assertEquals(1, $result['statusCounters'][$resource]['success']); + $this->assertEquals(0, $result['statusCounters'][$resource]['processing']); + $this->assertEquals(0, $result['statusCounters'][$resource]['warning']); + } + + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + + $this->assertEquals($documentId, $response['body']['$id']); + $this->assertEquals('Test Document', $response['body']['name']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + } + + /** + * Storage + */ + public function testAppwriteMigrationStorageBucket() + { + $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()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + 'maximumFileSize' => 1000000, + 'allowedFileExtensions' => ['pdf'], + 'compression' => 'gzip', + 'encryption' => false, + 'antivirus' => false + ]); + + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']); + $this->assertNotEmpty($bucket['body']['$id']); + $this->assertEquals('Test Bucket', $bucket['body']['name']); + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_BUCKET + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_BUCKET], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_BUCKET, $result['statusCounters']); + + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_BUCKET]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucket['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + $this->assertEquals($bucket['body']['$id'], $response['body']['$id']); + $this->assertEquals($bucket['body']['name'], $response['body']['name']); + $this->assertEquals($bucket['body']['$permissions'], $response['body']['$permissions']); + $this->assertEquals($bucket['body']['maximumFileSize'], $response['body']['maximumFileSize']); + $this->assertEquals($bucket['body']['allowedFileExtensions'], $response['body']['allowedFileExtensions']); + $this->assertEquals($bucket['body']['compression'], $response['body']['compression']); + $this->assertEquals($bucket['body']['encryption'], $response['body']['encryption']); + $this->assertEquals($bucket['body']['antivirus'], $response['body']['antivirus']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucket['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $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'], + ]); + } + + public function testAppwriteMigrationStorageFiles() + { + $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', + 'fileSecurity' => true, + 'maximumFileSize' => 2000000, //2MB + 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], + 'permissions' => [ + Permission::read(Role::any()), + Permission::create(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']['$id']); + + $bucketId = $bucket['body']['$id']; + + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/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', 'logo.png'), + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + Permission::delete(Role::any()), + ], + ]); + + $this->assertEquals(201, $file['headers']['status-code']); + $this->assertNotEmpty($file['body']['$id']); + + $fileId = $file['body']['$id']; + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_BUCKET, + Resource::TYPE_FILE + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_BUCKET, Resource::TYPE_FILE], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_BUCKET, $result['statusCounters']); + + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_BUCKET]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_BUCKET]['warning']); + + $this->assertArrayHasKey(Resource::TYPE_FILE, $result['statusCounters']); + + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FILE]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FILE]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_FILE]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FILE]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FILE]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/storage/buckets/' . $bucketId . '/files/' . $fileId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + $this->assertEquals($fileId, $response['body']['$id']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId . '/files/' . $fileId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId . '/files/' . $fileId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + } + + /** + * Functions + */ + public function testAppwriteMigrationFunction() + { + $functionId = $this->setupFunction([ + 'functionId' => ID::unique(), + 'name' => 'Test', + 'runtime' => 'php-8.0', + 'entrypoint' => 'index.php' + ]); + + $deploymentId = $this->setupDeployment($functionId, [ + 'entrypoint' => 'index.php', + 'code' => $this->packageFunction('php'), + 'activate' => true + ]); + + $result = $this->performMigrationSync([ + 'resources' => [ + Resource::TYPE_FUNCTION, + Resource::TYPE_DEPLOYMENT + ], + 'endpoint' => 'http://localhost/v1', + 'projectId' => $this->getProject()['$id'], + 'apiKey' => $this->getProject()['apiKey'], + ]); + + $this->assertEquals('completed', $result['status']); + $this->assertEquals([Resource::TYPE_FUNCTION, Resource::TYPE_DEPLOYMENT], $result['resources']); + $this->assertArrayHasKey(Resource::TYPE_FUNCTION, $result['statusCounters']); + + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FUNCTION]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FUNCTION]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_FUNCTION]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FUNCTION]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_FUNCTION]['warning']); + + $this->assertArrayHasKey(Resource::TYPE_DEPLOYMENT, $result['statusCounters']); + + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DEPLOYMENT]['error']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DEPLOYMENT]['pending']); + $this->assertEquals(1, $result['statusCounters'][Resource::TYPE_DEPLOYMENT]['success']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DEPLOYMENT]['processing']); + $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_DEPLOYMENT]['warning']); + + $response = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + + $this->assertEquals($functionId, $response['body']['$id']); + $this->assertEquals('Test', $response['body']['name']); + $this->assertEquals('php-8.0', $response['body']['runtime']); + $this->assertEquals('index.php', $response['body']['entrypoint']); + + + $this->assertEventually(function () use ($functionId) { + $deployments = $this->client->call(Client::METHOD_GET, '/functions/' . $functionId . '/deployments/', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ])); + + $this->assertEquals(200, $deployments['headers']['status-code']); + $this->assertNotEmpty($deployments['body']); + $this->assertEquals(1, $deployments['body']['total']); + + $this->assertEquals('ready', $deployments['body']['deployments'][0]['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployments['body']['deployments'][0], JSON_PRETTY_PRINT)); + }, 50000, 500); + + // Attempt execution + $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ], [ + 'body' => 'test' + ]); + + $this->assertEquals(201, $execution['headers']['status-code']); + $this->assertStringContainsString('body-is-test', $execution['body']['logs']); + + // Cleanup + $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ]); + + $this->client->call(Client::METHOD_DELETE, '/functions/' . $functionId, [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getDesintationProject()['$id'], + 'x-appwrite-key' => $this->getDesintationProject()['apiKey'], + ]); + } +} diff --git a/tests/e2e/Services/Migrations/MigrationsConsoleClientTest.php b/tests/e2e/Services/Migrations/MigrationsConsoleClientTest.php new file mode 100644 index 0000000000..2167ef9338 --- /dev/null +++ b/tests/e2e/Services/Migrations/MigrationsConsoleClientTest.php @@ -0,0 +1,12 @@ +<?php + +namespace Tests\E2E\Services\Migrations; + +use Tests\E2E\Scopes\Scope; +use Tests\E2E\Scopes\SideConsole; + +class MigrationsConsoleClientTest extends Scope +{ + use MigrationsBase; + use SideConsole; +} diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 48210435e7..34c1142619 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -4,6 +4,7 @@ namespace Tests\E2E\Services\Projects; use Appwrite\Auth\Auth; use Appwrite\Extend\Exception; +use Appwrite\Tests\Async; use Tests\E2E\Client; use Tests\E2E\General\UsageTest; use Tests\E2E\Scopes\ProjectConsole; @@ -19,6 +20,7 @@ class ProjectsConsoleClientTest extends Scope use ProjectsBase; use ProjectConsole; use SideClient; + use Async; /** * @group smtpAndTemplates @@ -485,6 +487,8 @@ class ProjectsConsoleClientTest extends Scope $this->assertIsNumeric($response['body']['usersTotal']); $this->assertIsNumeric($response['body']['filesStorageTotal']); $this->assertIsNumeric($response['body']['deploymentStorageTotal']); + $this->assertIsNumeric($response['body']['authPhoneTotal']); + $this->assertIsNumeric($response['body']['authPhoneEstimate']); /** @@ -1409,18 +1413,20 @@ class ProjectsConsoleClientTest extends Scope /** * List sessions */ - $response = $this->client->call(Client::METHOD_GET, '/account/sessions', [ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'Cookie' => $sessionCookie, - ]); + $this->assertEventually(function () use ($id, $sessionCookie, $sessionId2) { + $response = $this->client->call(Client::METHOD_GET, '/account/sessions', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'Cookie' => $sessionCookie, + ]); - $this->assertEquals(200, $response['headers']['status-code']); - $sessions = $response['body']['sessions']; + $this->assertEquals(200, $response['headers']['status-code']); + $sessions = $response['body']['sessions']; - $this->assertEquals(1, count($sessions)); - $this->assertEquals($sessionId2, $sessions[0]['$id']); + $this->assertEquals(1, count($sessions)); + $this->assertEquals($sessionId2, $sessions[0]['$id']); + }); /** * Reset Limit @@ -3727,11 +3733,11 @@ class ProjectsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'teamId' => ID::unique(), - 'name' => 'Amating Team', + 'name' => 'Amazing Team', ]); $this->assertEquals(201, $team['headers']['status-code']); - $this->assertEquals('Amating Team', $team['body']['name']); + $this->assertEquals('Amazing Team', $team['body']['name']); $this->assertNotEmpty($team['body']['$id']); $teamId = $team['body']['$id']; @@ -3794,6 +3800,115 @@ class ProjectsConsoleClientTest extends Scope return $data; } + public function testDeleteSharedProject(): void + { + $team = $this->client->call(Client::METHOD_POST, '/teams', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'teamId' => ID::unique(), + 'name' => 'Amazing Team', + ]); + + $teamId = $team['body']['$id']; + + // Ensure deleting one project does not affect another project + $project1 = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'projectId' => ID::unique(), + 'name' => 'Amazing Project 1', + 'teamId' => $teamId, + 'region' => 'default' + ]); + + $project2 = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'projectId' => ID::unique(), + 'name' => 'Amazing Project 2', + 'teamId' => $teamId, + 'region' => 'default' + ]); + + $project1Id = $project1['body']['$id']; + $project2Id = $project2['body']['$id']; + + // Create user in each project + $key1 = $this->client->call(Client::METHOD_POST, '/projects/' . $project1Id . '/keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'scopes' => ['users.read', 'users.write'], + ]); + + $user1 = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $project1Id, + 'x-appwrite-key' => $key1['body']['secret'], + ], [ + 'userId' => ID::unique(), + 'email' => 'test1@appwrite.io', + 'password' => 'password', + ]); + + $this->assertEquals(201, $user1['headers']['status-code']); + + $key2 = $this->client->call(Client::METHOD_POST, '/projects/' . $project2Id . '/keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'scopes' => ['users.read', 'users.write'], + ]); + + $user2 = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $project2Id, + 'x-appwrite-key' => $key2['body']['secret'], + ], [ + 'userId' => ID::unique(), + 'email' => 'test2@appwrite.io', + 'password' => 'password', + ]); + + $this->assertEquals(201, $user2['headers']['status-code']); + + // Delete project 1 + $project1 = $this->client->call(Client::METHOD_DELETE, '/projects/' . $project1Id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(204, $project1['headers']['status-code']); + + \sleep(3); + + // Ensure project 2 user is still there + $user2 = $this->client->call(Client::METHOD_GET, '/users/' . $user2['body']['$id'], [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $project2Id, + 'x-appwrite-key' => $key2['body']['secret'], + ]); + + $this->assertEquals(200, $user2['headers']['status-code']); + + // Create another user in project 2 in case read hits stale cache + $user3 = $this->client->call(Client::METHOD_POST, '/users', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $project2Id, + 'x-appwrite-key' => $key2['body']['secret'], + ], [ + 'userId' => ID::unique(), + 'email' => 'test3@appwrite.io' + ]); + + $this->assertEquals(201, $user3['headers']['status-code']); + } + /** * @depends testCreateProject */ diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 616f309fd2..dda524fc7c 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -111,6 +111,30 @@ class RealtimeCustomClientTest extends Scope $client->close(); } + public function testPingPong() + { + $client = $this->getWebsocket(['files'], [ + 'origin' => 'http://localhost' + ]); + $response = json_decode($client->receive(), true); + + $this->assertArrayHasKey('type', $response); + $this->assertArrayHasKey('data', $response); + $this->assertEquals('connected', $response['type']); + $this->assertNotEmpty($response['data']); + $this->assertCount(1, $response['data']['channels']); + $this->assertContains('files', $response['data']['channels']); + + $client->send(\json_encode([ + 'type' => 'ping' + ])); + + $response = json_decode($client->receive(), true); + $this->assertEquals('pong', $response['type']); + + $client->close(); + } + public function testManualAuthentication() { $user = $this->getUser(); diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 8a1fed028e..3381b80120 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -30,8 +30,8 @@ trait TeamsBaseClient $this->assertIsInt($response['body']['total']); $this->assertNotEmpty($response['body']['memberships'][0]['$id']); $this->assertFalse($response['body']['memberships'][0]['mfa']); - $this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['userName']); - $this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('userName', $response['body']['memberships'][0]); + $this->assertArrayHasKey('userEmail', $response['body']['memberships'][0]); $this->assertEquals($teamName, $response['body']['memberships'][0]['teamName']); $this->assertContains('owner', $response['body']['memberships'][0]['roles']); $this->assertContains('player', $response['body']['memberships'][0]['roles']); @@ -96,8 +96,8 @@ trait TeamsBaseClient $this->assertEquals(200, $response['headers']['status-code']); $this->assertIsInt($response['body']['total']); $this->assertNotEmpty($response['body']['memberships'][0]); - $this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['userName']); - $this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('userName', $response['body']['memberships'][0]); + $this->assertArrayHasKey('userEmail', $response['body']['memberships'][0]); $this->assertEquals($teamName, $response['body']['memberships'][0]['teamName']); $this->assertContains('owner', $response['body']['memberships'][0]['roles']); $this->assertContains('player', $response['body']['memberships'][0]['roles']); @@ -112,8 +112,8 @@ trait TeamsBaseClient $this->assertEquals(200, $response['headers']['status-code']); $this->assertIsInt($response['body']['total']); $this->assertNotEmpty($response['body']['memberships'][0]); - $this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['userName']); - $this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('userName', $response['body']['memberships'][0]); + $this->assertArrayHasKey('userEmail', $response['body']['memberships'][0]); $this->assertEquals($teamName, $response['body']['memberships'][0]['teamName']); $this->assertContains('owner', $response['body']['memberships'][0]['roles']); $this->assertContains('player', $response['body']['memberships'][0]['roles']); @@ -157,8 +157,8 @@ trait TeamsBaseClient $this->assertNotEmpty($response['body']['$id']); $this->assertFalse($response['body']['mfa']); $this->assertNotEmpty($response['body']['userId']); - $this->assertNotEmpty($response['body']['userName']); - $this->assertNotEmpty($response['body']['userEmail']); + $this->assertArrayHasKey('userName', $response['body']); + $this->assertArrayHasKey('userEmail', $response['body']); $this->assertNotEmpty($response['body']['teamId']); $this->assertNotEmpty($response['body']['teamName']); $this->assertCount(1, $response['body']['roles']); @@ -291,10 +291,7 @@ trait TeamsBaseClient $this->assertEquals($secondName, $lastEmail['to'][0]['name']); $this->assertEquals('Invitation to ' . $teamName . ' Team at ' . $this->getProject()['name'], $lastEmail['subject']); - /** - * Test for FAILURE - */ - + // test for resending invitation $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -305,7 +302,11 @@ trait TeamsBaseClient 'url' => 'http://localhost:5000/join-us#title' ]); - $this->assertEquals(409, $response['headers']['status-code']); + $this->assertEquals(201, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', @@ -559,6 +560,76 @@ trait TeamsBaseClient return $data; } + + /** + * @depends testCreateTeam + */ + public function testUpdateMembershipWithSession(array $data): void + { + $teamUid = $data['teamUid'] ?? ''; + + // create user + $response = $this->client->call(Client::METHOD_POST, '/account', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'userId' => 'unique()', + 'email' => uniqid() . 'foe@localhost.test', + 'password' => 'password', + 'name' => 'test' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $user = $response['body']; + + // create session + $response = $this->client->call(Client::METHOD_POST, '/account/sessions', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'email' => $user['email'], + 'password' => 'password' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + $session = $response['cookies']['a_session_' . $this->getProject()['$id']]; + + $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'email' => $user['email'], + 'roles' => ['developer'], + 'url' => 'http://localhost:5000/join-us#title' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + $lastEmail = $this->getLastEmail(); + + $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $membershipUid = substr($lastEmail['text'], strpos($lastEmail['text'], '?membershipId=', 0) + 14, 20); + $userUid = substr($lastEmail['text'], strpos($lastEmail['text'], '&userId=', 0) + 8, 20); + + $response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid . '/status', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ], [ + 'secret' => $secret, + 'userId' => $userUid, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertNotEmpty($response['body']['userId']); + $this->assertNotEmpty($response['body']['teamId']); + $this->assertCount(1, $response['body']['roles']); + $this->assertEmpty($response['cookies']); + } + /** * @depends testUpdateTeamMembership */ @@ -648,7 +719,7 @@ trait TeamsBaseClient ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(3, $response['body']['total']); + $this->assertEquals(4, $response['body']['total']); $ownerMembershipUid = $response['body']['memberships'][0]['$id']; @@ -703,7 +774,7 @@ trait TeamsBaseClient ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['total']); + $this->assertEquals(3, $response['body']['total']); /** * Test for when the owner tries to delete their membership diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index 4e9d0839ab..bade16cf2f 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -29,7 +29,7 @@ trait TeamsBaseServer * Test for FAILURE */ - return []; + return $data; } /** @@ -60,6 +60,67 @@ trait TeamsBaseServer $this->assertEquals(true, (new DatetimeValidator())->isValid($response['body']['joined'])); // is null in DB $this->assertEquals(true, $response['body']['confirm']); + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $this->getProject()['$id'] . '/auth/memberships-privacy', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'userName' => false, + 'userEmail' => false, + 'mfa' => false, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test that sensitive fields are not hidden, as we are on console + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['total']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + + // Assert that sensitive fields are present + $this->assertNotEmpty($response['body']['memberships'][0]['userName']); + $this->assertNotEmpty($response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('mfa', $response['body']['memberships'][0]); + + /** + * Update project settings to show sensitive fields + */ + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $this->getProject()['$id'] . '/auth/memberships-privacy', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'userName' => true, + 'userEmail' => true, + 'mfa' => true, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test that sensitive fields are shown + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['total']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + + // Assert that sensitive fields are present + $this->assertNotEmpty($response['body']['memberships'][0]['userName']); + $this->assertNotEmpty($response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('mfa', $response['body']['memberships'][0]); + /** * Test for FAILURE */ @@ -124,10 +185,7 @@ trait TeamsBaseServer // $this->assertContains('team:'.$teamUid.'/admin', $response['body']['roles']); // $this->assertContains('team:'.$teamUid.'/editor', $response['body']['roles']); - /** - * Test for FAILURE - */ - + // test for resending invitation $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -138,7 +196,11 @@ trait TeamsBaseServer 'url' => 'http://localhost:5000/join-us#title' ]); - $this->assertEquals(409, $response['headers']['status-code']); + $this->assertEquals(201, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Teams/TeamsCustomClientTest.php b/tests/e2e/Services/Teams/TeamsCustomClientTest.php index 1de22f743f..7286bb0827 100644 --- a/tests/e2e/Services/Teams/TeamsCustomClientTest.php +++ b/tests/e2e/Services/Teams/TeamsCustomClientTest.php @@ -14,6 +14,109 @@ class TeamsCustomClientTest extends Scope use ProjectCustom; use SideClient; + /** + * @depends testGetTeamMemberships + */ + public function testGetMembershipPrivacy($data) + { + $teamUid = $data['teamUid'] ?? ''; + + $projectId = $this->getProject()['$id']; + + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $projectId . '/auth/memberships-privacy', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'userName' => false, + 'userEmail' => false, + 'mfa' => false, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test that sensitive fields are hidden + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['total']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + + // Assert that sensitive fields are not present + $this->assertEmpty($response['body']['memberships'][0]['userName']); + $this->assertEmpty($response['body']['memberships'][0]['userEmail']); + $this->assertFalse($response['body']['memberships'][0]['mfa']); + + /** + * Update project settings to show sensitive fields + */ + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $projectId . '/auth/memberships-privacy', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'userName' => true, + 'userEmail' => true, + 'mfa' => true, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test that sensitive fields are shown + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['total']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + + // Assert that sensitive fields are present + $this->assertNotEmpty($response['body']['memberships'][0]['userName']); + $this->assertNotEmpty($response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('mfa', $response['body']['memberships'][0]); + + /** + * Update project settings to show only MFA + */ + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $this->getProject()['$id'] . '/auth/memberships-privacy', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => 'console', + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'userName' => false, + 'userEmail' => false, + 'mfa' => true, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + /** + * Test that sensitive fields are not shown + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['total']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + + // Assert that sensitive fields are present + $this->assertEmpty($response['body']['memberships'][0]['userName']); + $this->assertEmpty($response['body']['memberships'][0]['userEmail']); + $this->assertArrayHasKey('mfa', $response['body']['memberships'][0]); + } + /** * @depends testUpdateTeamMembership */ diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index d9105e0790..04e0eb5bc3 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -310,6 +310,22 @@ trait UsersBase $this->assertNotEmpty($session['secret']); $this->assertNotEmpty($session['expire']); $this->assertEquals('server', $session['provider']); + + $response = $this->client->call(Client::METHOD_GET, '/account', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-session' => $session['secret'] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/current', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-session' => $session['secret'] + ]); + + $this->assertEquals(204, $response['headers']['status-code']); } @@ -1498,6 +1514,7 @@ trait UsersBase ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals('random-email1@mail.org', $response['body']['identifier']); + $this->assertEquals(false, $response['body']['expired']); return $response['body']; } @@ -1510,6 +1527,7 @@ trait UsersBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); + $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(3, \count($response['body']['targets'])); } diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index 6be3e16c1f..2ef41003ee 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -901,6 +901,17 @@ trait WebhooksBase $teamId = $data['teamId'] ?? ''; $email = uniqid() . 'friend@localhost.test'; + // Create user to ensure team event is triggered after user event + $user = $this->client->call(Client::METHOD_POST, '/account', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'userId' => ID::unique(), + 'email' => $email, + 'password' => 'password', + 'name' => 'Friend User', + ]); + /** * Test for SUCCESS */ @@ -909,7 +920,6 @@ trait WebhooksBase 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'email' => $email, - 'name' => 'Friend User', 'roles' => ['admin', 'editor'], 'url' => 'http://localhost:5000/join-us#title' ]); diff --git a/tests/resources/docker/docker-compose.yml b/tests/resources/docker/docker-compose.yml index a34b4fcf88..94d506056c 100644 --- a/tests/resources/docker/docker-compose.yml +++ b/tests/resources/docker/docker-compose.yml @@ -62,6 +62,7 @@ services: - redis # - clamav environment: + - _APP_COMPRESSION_MIN_SIZE_BYTES - _APP_ENV - _APP_OPTIONS_ABUSE - _APP_OPTIONS_ROUTER_PROTECTION diff --git a/tests/unit/Auth/Validator/PhoneTest.php b/tests/unit/Auth/Validator/PhoneTest.php index d5a4e7f826..b7730641c3 100644 --- a/tests/unit/Auth/Validator/PhoneTest.php +++ b/tests/unit/Auth/Validator/PhoneTest.php @@ -31,6 +31,7 @@ class PhoneTest extends TestCase $this->assertEquals($this->object->isValid('+0415553452342'), false); $this->assertEquals($this->object->isValid('+14 155 5524564'), false); $this->assertEquals($this->object->isValid('+1415555245634543'), false); + $this->assertEquals($this->object->isValid('+8020000000'), false); // when country code is not present $this->assertEquals($this->object->isValid(+14155552456), false); $this->assertEquals($this->object->isValid('+1415555'), true); diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index dd9833378f..079bb47b65 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -3,13 +3,9 @@ namespace Tests\Unit\Event; use Appwrite\Event\Event; -use Appwrite\URL\URL; use InvalidArgumentException; use PHPUnit\Framework\TestCase; -use Utopia\DSN\DSN; -use Utopia\Queue; use Utopia\Queue\Client; -use Utopia\System\System; require_once __DIR__ . '/../../../app/init.php'; @@ -20,19 +16,8 @@ class EventTest extends TestCase public function setUp(): void { - $fallbackForRedis = 'redis_main=' . URL::unparse([ - 'scheme' => 'redis', - 'host' => System::getEnv('_APP_REDIS_HOST', 'redis'), - 'port' => System::getEnv('_APP_REDIS_PORT', '6379'), - 'user' => System::getEnv('_APP_REDIS_USER', ''), - 'pass' => System::getEnv('_APP_REDIS_PASS', ''), - ]); - - $dsn = System::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis); - $dsn = explode('=', $dsn); - $dsn = $dsn[1] ?? ''; - $dsn = new DSN($dsn); - $connection = new Queue\Connection\Redis($dsn->getHost(), $dsn->getPort()); + global $register; + $connection = $register->get('pools')->get('queue')->pop()->getResource(); $this->queue = 'v1-tests' . uniqid(); $this->object = new Event($connection); $this->object->setClass('TestsV1'); diff --git a/tests/unit/Usage/StatsTest.php b/tests/unit/Usage/StatsTest.php index 67e39d8974..79fa1f58ec 100644 --- a/tests/unit/Usage/StatsTest.php +++ b/tests/unit/Usage/StatsTest.php @@ -2,13 +2,9 @@ namespace Tests\Unit\Usage; -use Appwrite\URL\URL as AppwriteURL; use PHPUnit\Framework\TestCase; -use Utopia\DSN\DSN; -use Utopia\Queue; use Utopia\Queue\Client; use Utopia\Queue\Connection; -use Utopia\System\System; class StatsTest extends TestCase { @@ -19,18 +15,9 @@ class StatsTest extends TestCase public function setUp(): void { - $env = System::getEnv('_APP_CONNECTIONS_QUEUE', 'redis_main=' . AppwriteURL::unparse([ - 'scheme' => 'redis', - 'host' => System::getEnv('_APP_REDIS_HOST', 'redis'), - 'port' => System::getEnv('_APP_REDIS_PORT', '6379'), - 'user' => System::getEnv('_APP_REDIS_USER', ''), - 'pass' => System::getEnv('_APP_REDIS_PASS', ''), - ])); - - $dsn = explode('=', $env); - $dsn = count($dsn) > 1 ? $dsn[1] : $dsn[0]; - $dsn = new DSN($dsn); - $this->connection = new Queue\Connection\Redis($dsn->getHost(), $dsn->getPort()); + global $register; + $connection = $register->get('pools')->get('queue')->pop()->getResource(); + $this->connection = $connection; $this->client = new Client(self::QUEUE_NAME, $this->connection); } diff --git a/tests/unit/Utopia/RequestTest.php b/tests/unit/Utopia/RequestTest.php index 73daaa88bc..e19fdbe01f 100644 --- a/tests/unit/Utopia/RequestTest.php +++ b/tests/unit/Utopia/RequestTest.php @@ -2,6 +2,7 @@ namespace Tests\Unit\Utopia; +use Appwrite\SDK\Method; use Appwrite\Utopia\Request; use PHPUnit\Framework\TestCase; use Swoole\Http\Request as SwooleRequest; @@ -31,8 +32,13 @@ class RequestTest extends TestCase $this->assertCount(2, $this->request->getFilters()); $route = new Route(Request::METHOD_GET, '/test'); - $route->label('sdk.method', 'method'); - $route->label('sdk.namespace', 'namespace'); + $route->label('sdk', new Method( + namespace: 'namespace', + name: 'method', + description: 'description', + auth: [], + responses: [], + )); // set test header to prevent header populaten inside the request class $this->request->addHeader('EXAMPLE', 'VALUE'); $this->request->setRoute($route); From ca7cf765b232a94421d620b6a2ca12aeaa7d7c41 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 09:22:35 +0000 Subject: [PATCH 107/169] chore: refactor tokens --- .../Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php | 4 ++-- .../Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php | 2 +- .../Platform/Modules/Tokens/Http/Tokens/GetToken.php | 2 +- .../Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php | 2 +- tests/e2e/Services/Tokens/TokensCustomServerTest.php | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php index e422cd1c8a..f23e944a8f 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php @@ -32,8 +32,8 @@ class CreateFileToken extends Action ->desc('Create file token') ->groups(['api', 'token']) ->label('scope', 'tokens.write') - ->label('audits.event', 'token.create') ->label('event', 'tokens.[tokenId].create') + ->label('audits.event', 'token.create') ->label('audits.resource', 'token/{response.$id}') ->label('usage.metric', 'tokens.{scope}.requests.create') ->label('usage.params', ['resourceId:{request.resourceId}', 'resourceType:{request.resourceType}']) @@ -84,7 +84,7 @@ class CreateFileToken extends Action 'secret' => Auth::tokenGenerator(128), 'resourceId' => $bucketId . ':' . $fileId, 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), - 'resourceType' => 'file', + 'resourceType' => 'files', 'expire' => $expire, '$permissions' => $permissions ])); diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php index 88a6137654..b86246eae4 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php @@ -29,8 +29,8 @@ class ListFileTokens extends Action ->desc('List tokens') ->groups(['api', 'tokens']) ->label('scope', 'tokens.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('usage.metric', 'tokens.requests.read') + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'tokens') ->label('sdk.method', 'list') ->label('sdk.description', '/docs/references/storage/list.md') diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php index d1a895fabc..9ca11f8e28 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php @@ -25,9 +25,9 @@ class GetToken extends Action ->desc('Get token') ->groups(['api', 'tokens']) ->label('scope', 'tokens.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('usage.metric', 'tokens.{scope}.requests.read') ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'tokens') ->label('sdk.method', 'get') ->label('sdk.description', '/docs/references/tokens/get.md') diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php index 225c9b78fb..8fd546dd07 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php @@ -28,9 +28,9 @@ class GetTokenJWT extends Action ->desc('Get token as JWT') ->groups(['api', 'tokens']) ->label('scope', 'tokens.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('usage.metric', 'tokens.{scope}.requests.read') ->label('usage.params', ['tokenId:{request.tokenId}']) + ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) ->label('sdk.namespace', 'tokens') ->label('sdk.method', 'getJWT') ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') diff --git a/tests/e2e/Services/Tokens/TokensCustomServerTest.php b/tests/e2e/Services/Tokens/TokensCustomServerTest.php index 4750ec0a2e..587fc0f531 100644 --- a/tests/e2e/Services/Tokens/TokensCustomServerTest.php +++ b/tests/e2e/Services/Tokens/TokensCustomServerTest.php @@ -62,9 +62,8 @@ class TokensCustomServerTest extends Scope $res = $this->client->call(Client::METHOD_POST, '/tokens/buckets/' . $bucketId . '/files/' . $fileId, array_merge([ 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-key' => $this->getProject()['apiKey'], - ], $this->getHeaders()), []); + 'x-appwrite-project' => $this->getProject()['$id'] + ], $this->getHeaders())); $this->assertEquals(201, $res['headers']['status-code']); $this->assertEquals('files', $res['body']['resourceType']); From 4aa3a51ef026cc23a35ef13ff492a6ef69e85d76 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 09:52:43 +0000 Subject: [PATCH 108/169] chore: refactor module structure --- .../Http/DevKeys/{CreateDevKey.php => Create.php} | 2 +- .../Http/DevKeys/{DeleteDevKey.php => Delete.php} | 2 +- .../Projects/Http/DevKeys/{GetDevKey.php => Get.php} | 2 +- .../Http/DevKeys/{UpdateDevKey.php => Update.php} | 2 +- .../Http/DevKeys/{ListDevKeys.php => XList.php} | 2 +- .../Platform/Modules/Projects/Services/Http.php | 10 +++++----- 6 files changed, 10 insertions(+), 10 deletions(-) rename src/Appwrite/Platform/Modules/Projects/Http/DevKeys/{CreateDevKey.php => Create.php} (98%) rename src/Appwrite/Platform/Modules/Projects/Http/DevKeys/{DeleteDevKey.php => Delete.php} (98%) rename src/Appwrite/Platform/Modules/Projects/Http/DevKeys/{GetDevKey.php => Get.php} (98%) rename src/Appwrite/Platform/Modules/Projects/Http/DevKeys/{UpdateDevKey.php => Update.php} (98%) rename src/Appwrite/Platform/Modules/Projects/Http/DevKeys/{ListDevKeys.php => XList.php} (98%) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php similarity index 98% rename from src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index 90a8969774..c29515d3b1 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/CreateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -19,7 +19,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; -class CreateDevKey extends Action +class Create extends Action { use HTTP; public static function getName() diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php similarity index 98% rename from src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index 27b2b83396..4f4a021a75 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/DeleteDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -14,7 +14,7 @@ use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -class DeleteDevKey extends Action +class Delete extends Action { use HTTP; public static function getName() diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php similarity index 98% rename from src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index 5e5960b121..f0cec5370d 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/GetDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -14,7 +14,7 @@ use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -class GetDevKey extends Action +class Get extends Action { use HTTP; public static function getName() diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php similarity index 98% rename from src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index e2601a1693..9a8f488864 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/UpdateDevKey.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -16,7 +16,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; -class UpdateDevKey extends Action +class Update extends Action { use HTTP; public static function getName() diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php similarity index 98% rename from src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php rename to src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 267284fa2c..9d86b8bdd0 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/ListDevKeys.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -15,7 +15,7 @@ use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -class ListDevKeys extends Action +class XList extends Action { use HTTP; public static function getName() diff --git a/src/Appwrite/Platform/Modules/Projects/Services/Http.php b/src/Appwrite/Platform/Modules/Projects/Services/Http.php index a2b8fffa0a..cec8ed6d16 100644 --- a/src/Appwrite/Platform/Modules/Projects/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Projects/Services/Http.php @@ -2,11 +2,11 @@ namespace Appwrite\Platform\Modules\Projects\Services; -use Appwrite\Platform\Modules\Projects\Http\DevKeys\CreateDevKey; -use Appwrite\Platform\Modules\Projects\Http\DevKeys\DeleteDevKey; -use Appwrite\Platform\Modules\Projects\Http\DevKeys\GetDevKey; -use Appwrite\Platform\Modules\Projects\Http\DevKeys\ListDevKeys; -use Appwrite\Platform\Modules\Projects\Http\DevKeys\UpdateDevKey; +use Appwrite\Platform\Modules\Projects\Http\DevKeys\Create as CreateDevKey; +use Appwrite\Platform\Modules\Projects\Http\DevKeys\Delete as DeleteDevKey; +use Appwrite\Platform\Modules\Projects\Http\DevKeys\Get as GetDevKey; +use Appwrite\Platform\Modules\Projects\Http\DevKeys\Update as UpdateDevKey; +use Appwrite\Platform\Modules\Projects\Http\DevKeys\XList as ListDevKeys; use Utopia\Platform\Service; class Http extends Service From c7611ed382a1e8c7a1ed238e090f600baa07c354 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 13:28:22 +0000 Subject: [PATCH 109/169] chore: refactor file tokens with new project structuring --- .../Http/Tokens/Buckets/Files/Action.php | 2 +- .../Http/Tokens/Buckets/Files/Create.php} | 28 +++++++++++++------ .../Http/Tokens/Buckets/Files/XList.php} | 28 +++++++++++++------ .../Http/Tokens/Delete.php} | 27 ++++++++++++------ .../Http/Tokens/Get.php} | 28 +++++++++++++------ .../Http/Tokens/JWT/Get.php} | 28 +++++++++++++------ .../Http/Tokens/Update.php} | 28 +++++++++++++------ .../Modules/{Tokens => Storage}/Module.php | 0 .../{Tokens => Storage}/Services/Http.php | 14 +++++----- 9 files changed, 122 insertions(+), 61 deletions(-) rename src/Appwrite/Platform/Modules/{Tokens => Storage}/Http/Tokens/Buckets/Files/Action.php (95%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php => Storage/Http/Tokens/Buckets/Files/Create.php} (86%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php => Storage/Http/Tokens/Buckets/Files/XList.php} (81%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/DeleteToken.php => Storage/Http/Tokens/Delete.php} (74%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/GetToken.php => Storage/Http/Tokens/Get.php} (65%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/GetTokenJWT.php => Storage/Http/Tokens/JWT/Get.php} (77%) rename src/Appwrite/Platform/Modules/{Tokens/Http/Tokens/UpdateToken.php => Storage/Http/Tokens/Update.php} (86%) rename src/Appwrite/Platform/Modules/{Tokens => Storage}/Module.php (100%) rename src/Appwrite/Platform/Modules/{Tokens => Storage}/Services/Http.php (58%) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php similarity index 95% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php index 6d6838451a..524d25dc42 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php @@ -1,6 +1,6 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files; use Appwrite\Auth\Auth; use Appwrite\Extend\Exception; diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php similarity index 86% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index f23e944a8f..847a1d32b1 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/CreateFileToken.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -1,10 +1,14 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files; use Appwrite\Auth\Auth; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; @@ -16,7 +20,7 @@ use Utopia\Database\Validator\UID; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Nullable; -class CreateFileToken extends Action +class Create extends Action { use HTTP; @@ -40,13 +44,19 @@ class CreateFileToken extends Action ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'createFileToken') - ->label('sdk.description', '/docs/references/tokens/create_file_token.md') - ->label('sdk.response.code', Response::STATUS_CODE_CREATED) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'createFileToken', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RESOURCE_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('expire', null, new Nullable(new DatetimeValidator()), 'Token expiry date', true) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php similarity index 81% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php index b86246eae4..214e349a72 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/ListFileTokens.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php @@ -1,8 +1,12 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files; use Appwrite\Extend\Exception as ExtendException; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\Queries\FileTokens; use Appwrite\Utopia\Response; use Exception; @@ -12,7 +16,7 @@ use Utopia\Database\Query; use Utopia\Database\Validator\UID; use Utopia\Platform\Scope\HTTP; -class ListFileTokens extends Action +class XList extends Action { use HTTP; @@ -30,13 +34,19 @@ class ListFileTokens extends Action ->groups(['api', 'tokens']) ->label('scope', 'tokens.read') ->label('usage.metric', 'tokens.requests.read') - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'list') - ->label('sdk.description', '/docs/references/storage/list.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN_LIST) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'list', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RESOURCE_TOKEN_LIST, + ) + ], + contentType: ContentType::JSON + )) ->param('bucketId', '', new UID(), 'Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket).') ->param('fileId', '', new UID(), 'File unique ID.') ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php similarity index 74% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php index d8f463cbd8..dfad05e2d4 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/DeleteToken.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php @@ -1,16 +1,20 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -class DeleteToken extends Action +class Delete extends Action { use HTTP; @@ -34,12 +38,19 @@ class DeleteToken extends Action ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'delete') - ->label('sdk.description', '/docs/references/tokens/delete.md') - ->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT) - ->label('sdk.response.model', Response::MODEL_NONE) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'delete', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_NOCONTENT, + model: Response::MODEL_NONE, + ) + ], + contentType: ContentType::NONE + )) ->param('tokenId', '', new UID(), 'Token ID.') ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php similarity index 65% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php index 9ca11f8e28..2f15a52f4a 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetToken.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php @@ -1,15 +1,19 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -class GetToken extends Action +class Get extends Action { use HTTP; @@ -27,13 +31,19 @@ class GetToken extends Action ->label('scope', 'tokens.read') ->label('usage.metric', 'tokens.{scope}.requests.read') ->label('usage.params', ['tokenId:{request.tokenId}']) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'get') - ->label('sdk.description', '/docs/references/tokens/get.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'get', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RESOURCE_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->param('tokenId', '', new UID(), 'Token ID.') ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php similarity index 77% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php index 8fd546dd07..986700cb0d 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/GetTokenJWT.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php @@ -1,9 +1,13 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens\JWT; use Ahc\Jwt\JWT; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; @@ -12,7 +16,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\System\System; -class GetTokenJWT extends Action +class Get extends Action { use HTTP; @@ -30,13 +34,19 @@ class GetTokenJWT extends Action ->label('scope', 'tokens.read') ->label('usage.metric', 'tokens.{scope}.requests.read') ->label('usage.params', ['tokenId:{request.tokenId}']) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'getJWT') - ->label('sdk.description', '/docs/references/storage/get-file-token-jwt.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_JWT) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'getJWT', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_JWT, + ) + ], + contentType: ContentType::JSON + )) ->param('tokenId', '', new UID(), 'File token ID.') ->inject('response') ->inject('dbForProject') diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php similarity index 86% rename from src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php rename to src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php index a20fda3e96..e9979eb6fc 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/UpdateToken.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php @@ -1,10 +1,14 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Http\Tokens; +namespace Appwrite\Platform\Modules\Storage\Http\Tokens; use Appwrite\Auth\Auth; use Appwrite\Event\Event; use Appwrite\Extend\Exception; +use Appwrite\SDK\AuthType; +use Appwrite\SDK\ContentType; +use Appwrite\SDK\Method; +use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; @@ -17,7 +21,7 @@ use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Nullable; -class UpdateToken extends Action +class Update extends Action { use HTTP; @@ -41,13 +45,19 @@ class UpdateToken extends Action ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT) ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) - ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT]) - ->label('sdk.namespace', 'tokens') - ->label('sdk.method', 'update') - ->label('sdk.description', '/docs/references/tokens/update.md') - ->label('sdk.response.code', Response::STATUS_CODE_OK) - ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) - ->label('sdk.response.model', Response::MODEL_RESOURCE_TOKEN) + ->label('sdk', new Method( + namespace: 'tokens', + name: 'update', + description: '', + auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_RESOURCE_TOKEN, + ) + ], + contentType: ContentType::JSON + )) ->param('tokenId', '', new UID(), 'Token unique ID.') ->param('expire', null, new Nullable(new DatetimeValidator()), 'File token expiry date', true) ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) diff --git a/src/Appwrite/Platform/Modules/Tokens/Module.php b/src/Appwrite/Platform/Modules/Storage/Module.php similarity index 100% rename from src/Appwrite/Platform/Modules/Tokens/Module.php rename to src/Appwrite/Platform/Modules/Storage/Module.php diff --git a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php b/src/Appwrite/Platform/Modules/Storage/Services/Http.php similarity index 58% rename from src/Appwrite/Platform/Modules/Tokens/Services/Http.php rename to src/Appwrite/Platform/Modules/Storage/Services/Http.php index 35f9b89b80..ccc3aed51c 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Storage/Services/Http.php @@ -2,12 +2,12 @@ namespace Appwrite\Platform\Modules\Tokens\Services; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\CreateFileToken; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\Buckets\Files\ListFileTokens; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\DeleteToken; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetToken; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\GetTokenJWT; -use Appwrite\Platform\Modules\Tokens\Http\Tokens\UpdateToken; +use Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files\Create as CreateFileToken; +use Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files\XList as ListFileTokens; +use Appwrite\Platform\Modules\Storage\Http\Tokens\Delete as DeleteToken; +use Appwrite\Platform\Modules\Storage\Http\Tokens\Get as GetToken; +use Appwrite\Platform\Modules\Storage\Http\Tokens\JWT\Get as GetTokenJWT; +use Appwrite\Platform\Modules\Storage\Http\Tokens\Update as UpdateToken; use Utopia\Platform\Service; class Http extends Service @@ -17,11 +17,11 @@ class Http extends Service $this->type = Service::TYPE_HTTP; $this ->addAction(CreateFileToken::getName(), new CreateFileToken()) - ->addAction(DeleteToken::getName(), new DeleteToken()) ->addAction(GetToken::getName(), new GetToken()) ->addAction(GetTokenJWT::getName(), new GetTokenJWT()) ->addAction(ListFileTokens::getName(), new ListFileTokens()) ->addAction(UpdateToken::getName(), new UpdateToken()) + ->addAction(DeleteToken::getName(), new DeleteToken()) ; } From 4f63c520eceed5890ee77b2edc494ec01cf491e8 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 13:36:34 +0000 Subject: [PATCH 110/169] chore: remove extra space --- tests/e2e/Services/Storage/StorageBase.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 79e8083552..2b2c884283 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -752,7 +752,6 @@ trait StorageBase return $data; } - /** * @depends testCreateBucketFileZstdCompression */ From 97ed0dc89c0e40aca8d1a8738324f5f41d8be34f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 13:42:19 +0000 Subject: [PATCH 111/169] chore: fix directory naming --- src/Appwrite/Platform/Appwrite.php | 4 ++-- src/Appwrite/Platform/Modules/Storage/Module.php | 4 ++-- src/Appwrite/Platform/Modules/Storage/Services/Http.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index a075116d8b..438dc11a2d 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -3,7 +3,7 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Core; -use Appwrite\Platform\Modules\Tokens; +use Appwrite\Platform\Modules\Storage; use Utopia\Platform\Platform; class Appwrite extends Platform @@ -11,6 +11,6 @@ class Appwrite extends Platform public function __construct() { parent::__construct(new Core()); - $this->addModule(new Tokens\Module()); + $this->addModule(new Storage\Module()); } } diff --git a/src/Appwrite/Platform/Modules/Storage/Module.php b/src/Appwrite/Platform/Modules/Storage/Module.php index 9f49ef0111..59eb9e87a6 100644 --- a/src/Appwrite/Platform/Modules/Storage/Module.php +++ b/src/Appwrite/Platform/Modules/Storage/Module.php @@ -1,8 +1,8 @@ <?php -namespace Appwrite\Platform\Modules\Tokens; +namespace Appwrite\Platform\Modules\Storage; -use Appwrite\Platform\Modules\Tokens\Services\Http; +use Appwrite\Platform\Modules\Storage\Services\Http; use Utopia\Platform; class Module extends Platform\Module diff --git a/src/Appwrite/Platform/Modules/Storage/Services/Http.php b/src/Appwrite/Platform/Modules/Storage/Services/Http.php index ccc3aed51c..5fe4d096b3 100644 --- a/src/Appwrite/Platform/Modules/Storage/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Storage/Services/Http.php @@ -1,6 +1,6 @@ <?php -namespace Appwrite\Platform\Modules\Tokens\Services; +namespace Appwrite\Platform\Modules\Storage\Services; use Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files\Create as CreateFileToken; use Appwrite\Platform\Modules\Storage\Http\Tokens\Buckets\Files\XList as ListFileTokens; From ba0a6f00977eb3cea48ba53f4e0866a2fe3e5c4e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 5 Feb 2025 14:14:03 +0000 Subject: [PATCH 112/169] chore: added requires scopes, fix call method --- tests/e2e/Scopes/ProjectCustom.php | 4 +++- tests/e2e/Services/Tokens/TokensCustomServerTest.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index 7f84ace6f2..2b4073a1d2 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -95,7 +95,9 @@ trait ProjectCustom 'subscribers.write', 'subscribers.read', 'migrations.write', - 'migrations.read' + 'migrations.read', + 'tokens.read', + 'tokens.write', ], ]); diff --git a/tests/e2e/Services/Tokens/TokensCustomServerTest.php b/tests/e2e/Services/Tokens/TokensCustomServerTest.php index 587fc0f531..47c0600623 100644 --- a/tests/e2e/Services/Tokens/TokensCustomServerTest.php +++ b/tests/e2e/Services/Tokens/TokensCustomServerTest.php @@ -83,7 +83,7 @@ class TokensCustomServerTest extends Scope $tokenId = $data['tokenId']; $expiry = DateTime::now(); - $res = $this->client->call(Client::METHOD_PUT, '/tokens/' . $tokenId, array_merge([ + $res = $this->client->call(Client::METHOD_PATCH, '/tokens/' . $tokenId, array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ From fd3da47e8a8fce10399228f8ec0b0d96c3002870 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 6 Feb 2025 09:55:32 +0000 Subject: [PATCH 113/169] chore: added required perms in migrations --- src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php | 2 +- src/Appwrite/Platform/Workers/Migrations.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php index e9979eb6fc..65430e711f 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php @@ -66,7 +66,7 @@ class Update extends Action ->inject('user') ->inject('mode') ->inject('queueForEvents') - ->callback(fn ($tokenId, $expire, $permission, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $expire, $permission, $response, $dbForProject, $queueForEvents)); + ->callback(fn ($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents)); } public function action(string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index cd567f6fa3..2d750476fd 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -226,7 +226,9 @@ class Migrations extends Action 'collections.read', 'collections.write', 'documents.read', - 'documents.write' + 'documents.write', + 'tokens.read', + 'tokens.write', ] ]); From c269fc22ed9119aebcab5c9da9a6fa9f9a6f0f4e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 6 Feb 2025 10:04:03 +0000 Subject: [PATCH 114/169] chore: remove unnecessary injections --- src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php index 65430e711f..39e6e306ae 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php @@ -63,8 +63,6 @@ class Update extends Action ->param('permissions', null, new Permissions(APP_LIMIT_ARRAY_PARAMS_SIZE, [Database::PERMISSION_READ, Database::PERMISSION_UPDATE, Database::PERMISSION_DELETE, Database::PERMISSION_WRITE]), 'An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).', true) ->inject('response') ->inject('dbForProject') - ->inject('user') - ->inject('mode') ->inject('queueForEvents') ->callback(fn ($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents)); } From 1d571e470bec29d46e89620bbc6c67948a992725 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 6 Feb 2025 10:30:00 +0000 Subject: [PATCH 115/169] chore: update module endpoint descriptions --- docs/references/projects/create-dev-key.md | 1 - docs/references/projects/delete-dev-key.md | 1 - docs/references/projects/get-dev-key.md | 1 - docs/references/projects/list-dev-keys.md | 1 - docs/references/projects/update-dev-key.md | 1 - .../Platform/Modules/Projects/Http/DevKeys/Create.php | 4 +++- .../Platform/Modules/Projects/Http/DevKeys/Delete.php | 4 +++- .../Platform/Modules/Projects/Http/DevKeys/Get.php | 4 +++- .../Platform/Modules/Projects/Http/DevKeys/Update.php | 4 +++- .../Platform/Modules/Projects/Http/DevKeys/XList.php | 4 +++- src/Appwrite/SDK/Method.php | 10 ++++++---- src/Appwrite/Specification/Format/OpenAPI3.php | 5 ++++- src/Appwrite/Specification/Format/Swagger2.php | 5 ++++- 13 files changed, 29 insertions(+), 16 deletions(-) delete mode 100644 docs/references/projects/create-dev-key.md delete mode 100644 docs/references/projects/delete-dev-key.md delete mode 100644 docs/references/projects/get-dev-key.md delete mode 100644 docs/references/projects/list-dev-keys.md delete mode 100644 docs/references/projects/update-dev-key.md diff --git a/docs/references/projects/create-dev-key.md b/docs/references/projects/create-dev-key.md deleted file mode 100644 index 4d6afd789b..0000000000 --- a/docs/references/projects/create-dev-key.md +++ /dev/null @@ -1 +0,0 @@ -Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only. \ No newline at end of file diff --git a/docs/references/projects/delete-dev-key.md b/docs/references/projects/delete-dev-key.md deleted file mode 100644 index f78b373739..0000000000 --- a/docs/references/projects/delete-dev-key.md +++ /dev/null @@ -1 +0,0 @@ -Delete a project's dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors. \ No newline at end of file diff --git a/docs/references/projects/get-dev-key.md b/docs/references/projects/get-dev-key.md deleted file mode 100644 index ad7ede3cfa..0000000000 --- a/docs/references/projects/get-dev-key.md +++ /dev/null @@ -1 +0,0 @@ -Get a project's dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. \ No newline at end of file diff --git a/docs/references/projects/list-dev-keys.md b/docs/references/projects/list-dev-keys.md deleted file mode 100644 index 7fcf3fa9f4..0000000000 --- a/docs/references/projects/list-dev-keys.md +++ /dev/null @@ -1 +0,0 @@ -List all the project's dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. \ No newline at end of file diff --git a/docs/references/projects/update-dev-key.md b/docs/references/projects/update-dev-key.md deleted file mode 100644 index 55ea27f9c1..0000000000 --- a/docs/references/projects/update-dev-key.md +++ /dev/null @@ -1 +0,0 @@ -Update a project's dev key by its unique ID. Use this endpoint to update a project's dev key name or expiration time. \ No newline at end of file diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index c29515d3b1..778f87e417 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -38,7 +38,9 @@ class Create extends Action ->label('sdk', new Method( namespace: 'projects', name: 'createDevKey', - description: '/docs/references/projects/create-dev-key.md', + description: <<<EOT + Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only. + EOT, auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index 4f4a021a75..635a0e77b9 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -33,7 +33,9 @@ class Delete extends Action ->label('sdk', new Method( namespace: 'projects', name: 'deleteDevKey', - description: '/docs/references/projects/delete-dev-key.md', + description: <<<EOT + Delete a project\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors. + EOT, auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index f0cec5370d..eda87238d6 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -33,7 +33,9 @@ class Get extends Action ->label('sdk', new Method( namespace: 'projects', name: 'getDevKey', - description: '/docs/references/projects/get-dev-key.md', + description: <<<EOT + Get a project\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. + EOT, auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index 9a8f488864..7941657a44 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -34,7 +34,9 @@ class Update extends Action ->label('sdk', new Method( namespace: 'projects', name: 'updateDevKey', - description: '/docs/references/projects/update-dev-key.md', + description: <<<EOT + Update a project\'s dev key by its unique ID. Use this endpoint to update a project\'s dev key name or expiration time.' + EOT, auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 9d86b8bdd0..77315a1522 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -34,7 +34,9 @@ class XList extends Action ->label('sdk', new Method( namespace: 'projects', name: 'listDevKeys', - description: '/docs/references/projects/list-dev-keys.md', + description: <<<EOT + List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.' + EOT, auth: [AuthType::ADMIN], responses: [ new SDKResponse( diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 626459ea7f..8d85f158cb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -87,11 +87,13 @@ class Method return; } - $descPath = $this->getDescriptionFilePath(); + if (\str_ends_with($desc, '.md')) { + $descPath = $this->getDescriptionFilePath(); - if (empty($descPath)) { - self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; - return; + if (empty($descPath)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; + return; + } } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index bd5405539d..6785afa868 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -177,11 +177,14 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : ''; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7277e3ab2b..3565b5da75 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -173,13 +173,16 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : ''; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, From 37dbbf226e71e927fa0b2a3b5fcf036a7c89856b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 6 Feb 2025 10:42:33 +0000 Subject: [PATCH 116/169] chore: fix: descContents handling --- src/Appwrite/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index 6785afa868..e60d342b0b 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -178,7 +178,7 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; $desc = $desc ?? ''; - $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ 'summary' => $route->getDesc(), diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 3565b5da75..fae164f0a6 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -174,7 +174,7 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; $desc = $desc ?? ''; - $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ 'summary' => $route->getDesc(), From d1502bc7d64bd6cafd6fc5350c0f3cdb944a34df Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 6 Feb 2025 11:08:58 +0000 Subject: [PATCH 117/169] chore: update descriptions for token endpoints --- .../Storage/Http/Tokens/Buckets/Files/Create.php | 4 +++- .../Storage/Http/Tokens/Buckets/Files/XList.php | 4 +++- .../Platform/Modules/Storage/Http/Tokens/Delete.php | 4 +++- .../Platform/Modules/Storage/Http/Tokens/Get.php | 4 +++- .../Platform/Modules/Storage/Http/Tokens/JWT/Get.php | 4 +++- .../Platform/Modules/Storage/Http/Tokens/Update.php | 4 +++- src/Appwrite/SDK/Method.php | 10 ++++++---- src/Appwrite/Specification/Format/OpenAPI3.php | 5 ++++- src/Appwrite/Specification/Format/Swagger2.php | 5 ++++- 9 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index 847a1d32b1..bf2b198890 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -47,7 +47,9 @@ class Create extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'createFileToken', - description: '', + description: <<<EOT + Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php index 214e349a72..c7746702fa 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php @@ -37,7 +37,9 @@ class XList extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'list', - description: '', + description: <<<EOT + List all the tokens created for a specific file or bucket. You can use the query params to filter your results. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php index dfad05e2d4..fe5387b862 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php @@ -41,7 +41,9 @@ class Delete extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'delete', - description: '', + description: <<<EOT + Delete a token by its unique ID. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php index 2f15a52f4a..2d585e222b 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php @@ -34,7 +34,9 @@ class Get extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'get', - description: '', + description: <<<EOT + Get a token by its unique ID. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php index 986700cb0d..ce9c26e8e6 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php @@ -37,7 +37,9 @@ class Get extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'getJWT', - description: '', + description: <<<EOT + Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php index 39e6e306ae..81e53f6c9e 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php @@ -48,7 +48,9 @@ class Update extends Action ->label('sdk', new Method( namespace: 'tokens', name: 'update', - description: '', + description: <<<EOT + Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions. + EOT, auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 626459ea7f..8d85f158cb 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -87,11 +87,13 @@ class Method return; } - $descPath = $this->getDescriptionFilePath(); + if (\str_ends_with($desc, '.md')) { + $descPath = $this->getDescriptionFilePath(); - if (empty($descPath)) { - self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; - return; + if (empty($descPath)) { + self::$errors[] = "Error with {$this->getRouteName()} method: Description file not found at {$desc}"; + return; + } } } diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index bd5405539d..e60d342b0b 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -177,11 +177,14 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 7277e3ab2b..fae164f0a6 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -173,13 +173,16 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; + $desc = $desc ?? ''; + $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; + $temp = [ 'summary' => $route->getDesc(), 'operationId' => $namespace . ucfirst($method), 'consumes' => [], 'produces' => [], 'tags' => [$namespace], - 'description' => ($desc) ? \file_get_contents($desc) : '', + 'description' => $descContents, 'responses' => [], 'x-appwrite' => [ // Appwrite related metadata 'method' => $method, From a0138455bcaeb124c5ef858dcc325b403d4927c1 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 13 Feb 2025 19:21:15 +0000 Subject: [PATCH 118/169] fix: queueForStats naming --- app/controllers/general.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 18a9736e3c..324de05e6e 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -508,7 +508,7 @@ App::init() ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('devKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, Usage $queueForUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked, string $previewHostname, Document $devKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, callable $isResourceBlocked, string $previewHostname, Document $devKey) { /* * Appwrite Router */ @@ -742,7 +742,7 @@ App::options() ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('devKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $devKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $devKey) { /* * Appwrite Router */ @@ -777,7 +777,7 @@ App::error() ->inject('log') ->inject('queueForUsage') ->inject('devKey') - ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, Usage $queueForUsage) { + ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, StatsUsage $queueForStatsUsage) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); $route = $utopia->getRoute(); $class = \get_class($error); From 392803b5e88fcdd4d15aab035e21d833cda44df2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 13 Feb 2025 19:24:00 +0000 Subject: [PATCH 119/169] chore: fix merge conflicts --- app/controllers/general.php | 2 +- app/controllers/shared/api.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 324de05e6e..ea27e8633e 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -775,7 +775,7 @@ App::error() ->inject('project') ->inject('logger') ->inject('log') - ->inject('queueForUsage') + ->inject('queueForStatsUsage') ->inject('devKey') ->action(function (Throwable $error, App $utopia, Request $request, Response $response, Document $project, ?Logger $logger, Log $log, StatsUsage $queueForStatsUsage) { $version = System::getEnv('_APP_VERSION', 'UNKNOWN'); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 43a1d88536..9dd804ea2f 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -441,7 +441,7 @@ App::init() ->inject('timelimit') ->inject('mode') ->inject('devKey') - ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, Usage $queueForUsage, Database $dbForProject, callable $timelimit, string $mode, Document $devKey) use ($usageDatabaseListener, $eventDatabaseListener) { + ->action(function (App $utopia, Request $request, Response $response, Document $project, Document $user, Publisher $publisher, Event $queueForEvents, Messaging $queueForMessaging, Audit $queueForAudits, Delete $queueForDeletes, EventDatabase $queueForDatabase, Build $queueForBuilds, StatsUsage $queueForStatsUsage, Database $dbForProject, callable $timelimit, string $mode, Document $devKey) use ($usageDatabaseListener, $eventDatabaseListener) { $route = $utopia->getRoute(); From f67d32fd3510a951d4dfb8813e4f5e2f6879984f Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 13 Feb 2025 19:32:33 +0000 Subject: [PATCH 120/169] chore: updated devkeys test for shared mode --- .github/workflows/tests.yml | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a70389a8c..97b2af35ab 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -176,7 +176,7 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys e2e_shared_mode_test: name: E2E Shared Mode Service Test @@ -250,11 +250,46 @@ jobs: name: E2E Service Test (Dev Keys) runs-on: ubuntu-latest needs: setup + strategy: + fail-fast: false + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env + docker compose up -d + sleep 30 + + - name: Run Projects tests with dev keys in ${{ matrix.tables-mode }} table mode + run: | + echo "Using project tables" + export _APP_DATABASE_SHARED_TABLES= + export _APP_DATABASE_SHARED_TABLES_V1= + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys + + e2e_dev_keys_shared_mode: + name: E2E Shared Mode Test (Dev Keys) + runs-on: ubuntu-latest + needs: [ setup, check_database_changes ] + if: needs.check_database_changes.outputs.database_changed == 'true' strategy: fail-fast: false matrix: tables-mode: [ - 'Project', 'Shared V1', 'Shared V2', ] @@ -286,10 +321,6 @@ jobs: echo "Using shared tables V2" export _APP_DATABASE_SHARED_TABLES=database_db_main export _APP_DATABASE_SHARED_TABLES_V1= - else - echo "Using project tables" - export _APP_DATABASE_SHARED_TABLES= - export _APP_DATABASE_SHARED_TABLES_V1= fi docker compose exec -T \ From 46c4c7b28b9e92341b718ed40c2464596efe2c57 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 13 Feb 2025 19:36:01 +0000 Subject: [PATCH 121/169] chore: fix name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97b2af35ab..8bbeaaf8a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -282,7 +282,7 @@ jobs: appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys e2e_dev_keys_shared_mode: - name: E2E Shared Mode Test (Dev Keys) + name: E2E Shared Mode Service Test (Dev Keys) runs-on: ubuntu-latest needs: [ setup, check_database_changes ] if: needs.check_database_changes.outputs.database_changed == 'true' From f5172f8462c846bbc2709713587b0748857ca2e7 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Tue, 25 Feb 2025 12:30:11 +0000 Subject: [PATCH 122/169] chore: regenerate specs --- app/config/specs/open-api3-latest-client.json | 10 +- .../specs/open-api3-latest-console.json | 627 ++++++++++++++--- app/config/specs/open-api3-latest-server.json | 178 ++--- app/config/specs/swagger2-latest-client.json | 10 +- app/config/specs/swagger2-latest-console.json | 630 +++++++++++++++--- app/config/specs/swagger2-latest-server.json | 180 ++--- 6 files changed, 1295 insertions(+), 340 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 820b1f55e0..316fe13116 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -3383,7 +3383,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3404,7 +3404,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3423,7 +3424,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ] }, "in": "path" @@ -4365,7 +4367,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 7f57dfc437..fc448d8ae8 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -3387,7 +3387,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3408,7 +3408,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3427,7 +3428,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ] }, "in": "path" @@ -7823,7 +7825,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", @@ -11585,7 +11587,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11692,7 +11694,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11718,54 +11720,6 @@ ] } }, - "\/health\/queue": { - "get": { - "summary": "Get queue", - "operationId": "healthGetQueue", - "tags": [ - "health" - ], - "description": "Check the Appwrite queue messaging servers are up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthStatus" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueue", - "weight": 129, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ] - } - }, "\/health\/queue\/builds": { "get": { "summary": "Get builds queue", @@ -11788,7 +11742,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11849,7 +11803,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11910,7 +11864,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11982,7 +11936,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12081,8 +12035,9 @@ "v1-audits", "v1-mails", "v1-functions", - "v1-usage", - "v1-usage-dump", + "v1-stats-resources", + "v1-stats-usage", + "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12130,7 +12085,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12191,7 +12146,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12252,7 +12207,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12313,7 +12268,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12374,7 +12329,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12413,14 +12368,14 @@ ] } }, - "\/health\/queue\/usage": { + "\/health\/queue\/stats-resources": { "get": { - "summary": "Get usage queue", - "operationId": "healthGetQueueUsage", + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", "tags": [ "health" ], - "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", "responses": { "200": { "description": "Health Queue", @@ -12434,13 +12389,13 @@ } }, "x-appwrite": { - "method": "getQueueUsage", - "weight": 143, + "method": "getQueueStatsResources", + "weight": 142, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12474,10 +12429,71 @@ ] } }, - "\/health\/queue\/usage-dump": { + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage-dump": { "get": { "summary": "Get usage dump queue", - "operationId": "healthGetQueueUsageDump", + "operationId": "healthGetQueueStatsUsageDump", "tags": [ "health" ], @@ -12495,13 +12511,13 @@ } }, "x-appwrite": { - "method": "getQueueUsageDump", + "method": "getQueueStatsUsageDump", "weight": 144, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md", + "demo": "health\/get-queue-stats-usage-dump.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12557,7 +12573,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12714,7 +12730,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -17609,17 +17625,17 @@ }, "endpoint": { "type": "string", - "description": "Source's Appwrite Endpoint", + "description": "Source Appwrite endpoint", "x-example": "https:\/\/example.com" }, "projectId": { "type": "string", - "description": "Source's Project ID", + "description": "Source Project ID", "x-example": "<PROJECT_ID>" }, "apiKey": { "type": "string", - "description": "Source's API Key", + "description": "Source API Key", "x-example": "<API_KEY>" } }, @@ -20322,6 +20338,368 @@ } } }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "Dev Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKeyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "tags": [ + "projects" + ], + "description": "", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "File" + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, "\/projects\/{projectId}\/jwts": { "post": { "summary": "Create JWT", @@ -31084,6 +31462,30 @@ "keys" ] }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ] + }, "platformList": { "description": "Platforms List", "type": "object", @@ -34797,6 +35199,14 @@ }, "x-example": {} }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": {} + }, "smtpEnabled": { "type": "boolean", "description": "Status for custom SMTP", @@ -34975,6 +35385,7 @@ "platforms", "webhooks", "keys", + "devKeys", "smtpEnabled", "smtpSenderName", "smtpSenderEmail", @@ -35164,6 +35575,56 @@ "sdks" ] }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt" + ] + }, "mockNumber": { "description": "Mock Number", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 68d408762a..280c080514 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -3077,7 +3077,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "schema": { "type": "string", @@ -3098,7 +3098,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3117,7 +3118,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ] }, "in": "path" @@ -7381,7 +7383,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", @@ -10461,7 +10463,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -10570,7 +10572,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -10597,55 +10599,6 @@ ] } }, - "\/health\/queue": { - "get": { - "summary": "Get queue", - "operationId": "healthGetQueue", - "tags": [ - "health" - ], - "description": "Check the Appwrite queue messaging servers are up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "content": { - "application\/json": { - "schema": { - "$ref": "#\/components\/schemas\/healthStatus" - } - } - } - } - }, - "x-appwrite": { - "method": "getQueue", - "weight": 129, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ] - } - }, "\/health\/queue\/builds": { "get": { "summary": "Get builds queue", @@ -10668,7 +10621,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -10730,7 +10683,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -10792,7 +10745,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -10865,7 +10818,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -10966,8 +10919,9 @@ "v1-audits", "v1-mails", "v1-functions", - "v1-usage", - "v1-usage-dump", + "v1-stats-resources", + "v1-stats-usage", + "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11015,7 +10969,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11077,7 +11031,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11139,7 +11093,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11201,7 +11155,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11263,7 +11217,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11303,14 +11257,14 @@ ] } }, - "\/health\/queue\/usage": { + "\/health\/queue\/stats-resources": { "get": { - "summary": "Get usage queue", - "operationId": "healthGetQueueUsage", + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", "tags": [ "health" ], - "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", "responses": { "200": { "description": "Health Queue", @@ -11324,13 +11278,13 @@ } }, "x-appwrite": { - "method": "getQueueUsage", - "weight": 143, + "method": "getQueueStatsResources", + "weight": 142, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11365,10 +11319,72 @@ ] } }, - "\/health\/queue\/usage-dump": { + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage-dump": { "get": { "summary": "Get usage dump queue", - "operationId": "healthGetQueueUsageDump", + "operationId": "healthGetQueueStatsUsageDump", "tags": [ "health" ], @@ -11386,13 +11402,13 @@ } }, "x-appwrite": { - "method": "getQueueUsageDump", + "method": "getQueueStatsUsageDump", "weight": 144, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md", + "demo": "health\/get-queue-stats-usage-dump.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11449,7 +11465,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11609,7 +11625,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 130, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index c0980c44ce..8960bfaa5c 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -3557,7 +3557,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3577,7 +3577,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3596,7 +3597,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ], "in": "path" }, @@ -4547,7 +4549,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 94b0d55199..284e863880 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -3577,7 +3577,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3597,7 +3597,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3616,7 +3617,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ], "in": "path" }, @@ -8012,7 +8014,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", @@ -11810,7 +11812,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -11919,7 +11921,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -11945,56 +11947,6 @@ ] } }, - "\/health\/queue": { - "get": { - "summary": "Get queue", - "operationId": "healthGetQueue", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Check the Appwrite queue messaging servers are up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "schema": { - "$ref": "#\/definitions\/healthStatus" - } - } - }, - "x-appwrite": { - "method": "getQueue", - "weight": 129, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ] - } - }, "\/health\/queue\/builds": { "get": { "summary": "Get builds queue", @@ -12019,7 +11971,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12080,7 +12032,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12141,7 +12093,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12211,7 +12163,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12309,8 +12261,9 @@ "v1-audits", "v1-mails", "v1-functions", - "v1-usage", - "v1-usage-dump", + "v1-stats-resources", + "v1-stats-usage", + "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -12357,7 +12310,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12418,7 +12371,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12479,7 +12432,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12540,7 +12493,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12601,7 +12554,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12638,10 +12591,10 @@ ] } }, - "\/health\/queue\/usage": { + "\/health\/queue\/stats-resources": { "get": { - "summary": "Get usage queue", - "operationId": "healthGetQueueUsage", + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", "consumes": [ "application\/json" ], @@ -12651,7 +12604,7 @@ "tags": [ "health" ], - "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", "responses": { "200": { "description": "Health Queue", @@ -12661,13 +12614,13 @@ } }, "x-appwrite": { - "method": "getQueueUsage", - "weight": 143, + "method": "getQueueStatsResources", + "weight": 142, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12699,10 +12652,71 @@ ] } }, - "\/health\/queue\/usage-dump": { + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage-dump": { "get": { "summary": "Get usage dump queue", - "operationId": "healthGetQueueUsageDump", + "operationId": "healthGetQueueStatsUsageDump", "consumes": [ "application\/json" ], @@ -12722,13 +12736,13 @@ } }, "x-appwrite": { - "method": "getQueueUsageDump", + "method": "getQueueStatsUsageDump", "weight": 144, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md", + "demo": "health\/get-queue-stats-usage-dump.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -12784,7 +12798,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12945,7 +12959,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -18070,19 +18084,19 @@ }, "endpoint": { "type": "string", - "description": "Source's Appwrite Endpoint", + "description": "Source Appwrite endpoint", "default": null, "x-example": "https:\/\/example.com" }, "projectId": { "type": "string", - "description": "Source's Project ID", + "description": "Source Project ID", "default": null, "x-example": "<PROJECT_ID>" }, "apiKey": { "type": "string", - "description": "Source's API Key", + "description": "Source API Key", "default": null, "x-example": "<API_KEY>" } @@ -20797,6 +20811,367 @@ ] } }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "Dev Keys List", + "schema": { + "$ref": "#\/definitions\/devKeyList" + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "", + "responses": { + "201": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + } + }, "\/projects\/{projectId}\/jwts": { "post": { "summary": "Create JWT", @@ -31590,6 +31965,31 @@ "keys" ] }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ] + }, "platformList": { "description": "Platforms List", "type": "object", @@ -35334,6 +35734,15 @@ }, "x-example": {} }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": {} + }, "smtpEnabled": { "type": "boolean", "description": "Status for custom SMTP", @@ -35512,6 +35921,7 @@ "platforms", "webhooks", "keys", + "devKeys", "smtpEnabled", "smtpSenderName", "smtpSenderEmail", @@ -35701,6 +36111,56 @@ "sdks" ] }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt" + ] + }, "mockNumber": { "description": "Mock Number", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index e38495629c..749f87553b 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -3261,7 +3261,7 @@ "parameters": [ { "name": "code", - "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", "required": true, "type": "string", "x-example": "amex", @@ -3281,7 +3281,8 @@ "union-china-pay", "visa", "mir", - "maestro" + "maestro", + "rupay" ], "x-enum-name": "CreditCard", "x-enum-keys": [ @@ -3300,7 +3301,8 @@ "Union China Pay", "Visa", "MIR", - "Maestro" + "Maestro", + "Rupay" ], "in": "path" }, @@ -7552,7 +7554,7 @@ "tags": [ "databases" ], - "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", "responses": { "201": { "description": "Document", @@ -10689,7 +10691,7 @@ }, "x-appwrite": { "method": "getCertificate", - "weight": 134, + "weight": 133, "cookies": false, "type": "", "deprecated": false, @@ -10800,7 +10802,7 @@ }, "x-appwrite": { "method": "getPubSub", - "weight": 130, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -10827,57 +10829,6 @@ ] } }, - "\/health\/queue": { - "get": { - "summary": "Get queue", - "operationId": "healthGetQueue", - "consumes": [ - "application\/json" - ], - "produces": [ - "application\/json" - ], - "tags": [ - "health" - ], - "description": "Check the Appwrite queue messaging servers are up and connection is successful.", - "responses": { - "200": { - "description": "Health Status", - "schema": { - "$ref": "#\/definitions\/healthStatus" - } - } - }, - "x-appwrite": { - "method": "getQueue", - "weight": 129, - "cookies": false, - "type": "", - "deprecated": false, - "demo": "health\/get-queue.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue.md", - "rate-limit": 0, - "rate-time": 3600, - "rate-key": "url:{url},ip:{ip}", - "scope": "health.read", - "platforms": [ - "server" - ], - "packaging": false, - "auth": { - "Project": [], - "Key": [] - } - }, - "security": [ - { - "Project": [], - "Key": [] - } - ] - } - }, "\/health\/queue\/builds": { "get": { "summary": "Get builds queue", @@ -10902,7 +10853,7 @@ }, "x-appwrite": { "method": "getQueueBuilds", - "weight": 136, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -10964,7 +10915,7 @@ }, "x-appwrite": { "method": "getQueueCertificates", - "weight": 135, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11026,7 +10977,7 @@ }, "x-appwrite": { "method": "getQueueDatabases", - "weight": 137, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11097,7 +11048,7 @@ }, "x-appwrite": { "method": "getQueueDeletes", - "weight": 138, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -11197,8 +11148,9 @@ "v1-audits", "v1-mails", "v1-functions", - "v1-usage", - "v1-usage-dump", + "v1-stats-resources", + "v1-stats-usage", + "v1-stats-usage-dump", "v1-webhooks", "v1-certificates", "v1-builds", @@ -11245,7 +11197,7 @@ }, "x-appwrite": { "method": "getQueueFunctions", - "weight": 142, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11307,7 +11259,7 @@ }, "x-appwrite": { "method": "getQueueLogs", - "weight": 133, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11369,7 +11321,7 @@ }, "x-appwrite": { "method": "getQueueMails", - "weight": 139, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -11431,7 +11383,7 @@ }, "x-appwrite": { "method": "getQueueMessaging", - "weight": 140, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11493,7 +11445,7 @@ }, "x-appwrite": { "method": "getQueueMigrations", - "weight": 141, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11531,10 +11483,10 @@ ] } }, - "\/health\/queue\/usage": { + "\/health\/queue\/stats-resources": { "get": { - "summary": "Get usage queue", - "operationId": "healthGetQueueUsage", + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", "consumes": [ "application\/json" ], @@ -11544,7 +11496,7 @@ "tags": [ "health" ], - "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", "responses": { "200": { "description": "Health Queue", @@ -11554,13 +11506,13 @@ } }, "x-appwrite": { - "method": "getQueueUsage", - "weight": 143, + "method": "getQueueStatsResources", + "weight": 142, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md", + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11593,10 +11545,72 @@ ] } }, - "\/health\/queue\/usage-dump": { + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage-dump": { "get": { "summary": "Get usage dump queue", - "operationId": "healthGetQueueUsageDump", + "operationId": "healthGetQueueStatsUsageDump", "consumes": [ "application\/json" ], @@ -11616,13 +11630,13 @@ } }, "x-appwrite": { - "method": "getQueueUsageDump", + "method": "getQueueStatsUsageDump", "weight": 144, "cookies": false, "type": "", "deprecated": false, - "demo": "health\/get-queue-usage-dump.md", - "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage-dump.md", + "demo": "health\/get-queue-stats-usage-dump.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage-dump.md", "rate-limit": 0, "rate-time": 3600, "rate-key": "url:{url},ip:{ip}", @@ -11679,7 +11693,7 @@ }, "x-appwrite": { "method": "getQueueWebhooks", - "weight": 132, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -11843,7 +11857,7 @@ }, "x-appwrite": { "method": "getTime", - "weight": 131, + "weight": 130, "cookies": false, "type": "", "deprecated": false, From a62c489a720ad9bfcdd534bc0c3a4d372d76cbad Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Sat, 22 Mar 2025 18:38:12 +0530 Subject: [PATCH 123/169] fix: missing import. --- app/init/resources.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/init/resources.php b/app/init/resources.php index f2dcb7d73b..4f64db1ca6 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -28,6 +28,7 @@ use Utopia\Cache\Cache; use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; +use Utopia\Database\DateTime as DatabaseDateTime; use Utopia\Database\Document; use Utopia\Database\Helpers\ID; use Utopia\Database\Query; From 26142f4f21d3dffcbd3bb3bf426a7d0e20d6a700 Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Sat, 22 Mar 2025 18:46:13 +0530 Subject: [PATCH 124/169] =?UTF-8?q?revert:=20local=20dockerfile=20changes!?= =?UTF-8?q?=20=F0=9F=A4=A6=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b16568e955..88d5ed030b 100755 --- a/Dockerfile +++ b/Dockerfile @@ -38,12 +38,10 @@ COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor COPY ./app /usr/src/code/app COPY ./public /usr/src/code/public COPY ./bin /usr/local/bin -#COPY ./docs /usr/src/code/docs -COPY ./src /usr/src/code/srcs +COPY ./docs /usr/src/code/docs +COPY ./src /usr/src/code/src COPY ./dev /usr/src/code/dev -COPY ./vendor/utopia-php/framework/src/App.php /usr/src/code/vendor/utopia-php/framework/src/App.php - # Set Volumes RUN mkdir -p /storage/uploads && \ mkdir -p /storage/cache && \ From 7b7fd218f540f819ceaf7f6f7c036f50bbf55554 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 24 Mar 2025 05:06:18 +0000 Subject: [PATCH 125/169] chore: formatting + updating specs --- .github/workflows/tests.yml | 2 +- app/config/specs/open-api3-latest-client.json | 2 +- .../specs/open-api3-latest-console.json | 21 ++++++++++++++--- app/config/specs/open-api3-latest-server.json | 13 ++++++++++- app/config/specs/swagger2-latest-client.json | 2 +- app/config/specs/swagger2-latest-console.json | 23 ++++++++++++++++--- app/config/specs/swagger2-latest-server.json | 14 ++++++++++- app/controllers/general.php | 2 +- 8 files changed, 67 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8bbeaaf8a3..d4dcd7cac2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -240,7 +240,7 @@ jobs: export _APP_DATABASE_SHARED_TABLES=database_db_main export _APP_DATABASE_SHARED_TABLES_V1= fi - + docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 316fe13116..d74fc6ffe5 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index d6e3b6c2e3..691140ddd9 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -11080,6 +11080,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -18712,6 +18717,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -19056,8 +19066,7 @@ "description": "Project Region.", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -35776,6 +35785,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -35793,6 +35807,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 3d32d3e978..2a89cc56e0 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -9946,6 +9946,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -25525,6 +25530,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -25542,6 +25552,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 8960bfaa5c..78e8b71ad1 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index a0149a39a0..76497471ca 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -11258,6 +11258,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -19171,6 +19177,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -19522,8 +19534,7 @@ "default": "default", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -36312,6 +36323,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -36329,6 +36345,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 83757c94f4..2a2a86281e 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "1.6.1", + "version": "1.6.2", "title": "Appwrite", "description": "Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)", "termsOfService": "https:\/\/appwrite.io\/policy\/terms", @@ -10127,6 +10127,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -26037,6 +26043,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -26054,6 +26065,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/controllers/general.php b/app/controllers/general.php index 1752ef24b3..f37504d90f 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1009,7 +1009,7 @@ App::error() $type = $error->getType(); - $output = (App::isDevelopment()) ? [ + $output = App::isDevelopment() ? [ 'message' => $message, 'code' => $code, 'file' => $file, From 7aecd3814aede58d88cb0675f3863439feb364e9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 09:15:36 +0000 Subject: [PATCH 126/169] fix: minor mistakes in devkeys naming and initialization --- app/config/collections/platform.php | 2 +- app/init/constants.php | 1 + .../Platform/Modules/Projects/Http/DevKeys/Create.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/Delete.php | 4 ++-- src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/Update.php | 4 ++-- .../Platform/Modules/Projects/Http/DevKeys/XList.php | 6 +++--- src/Appwrite/Utopia/Response.php | 2 +- src/Appwrite/Utopia/Response/Model/DevKey.php | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 24223acbd3..39a5889b67 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -722,7 +722,7 @@ return [ 'format' => '', 'size' => Database::LENGTH_KEY, 'signed' => true, - 'required' => false, + 'required' => true, 'default' => 0, 'array' => false, 'filters' => [], diff --git a/app/init/constants.php b/app/init/constants.php index 5e4edfd97d..9d3a08ed76 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -26,6 +26,7 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls +const APP_LIMIT_DEV_KEYS = 5000; // Default maximum number of dev keys to return in list API calls const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index 778f87e417..baf126cf5b 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -55,7 +55,7 @@ class Create extends Action ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) ->inject('response') ->inject('dbForPlatform') - ->callback(fn ($projectId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $name, $expire, $response, $dbForPlatform)); + ->callback([$this, 'action']); } public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index 635a0e77b9..4fabcc4db1 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -39,7 +39,7 @@ class Delete extends Action auth: [AuthType::ADMIN], responses: [ new SDKResponse( - code: Response::STATUS_CODE_CREATED, + code: Response::STATUS_CODE_NOCONTENT, model: Response::MODEL_NONE ) ], @@ -49,7 +49,7 @@ class Delete extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform)); + ->callback([$this, 'action']); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index eda87238d6..bfbfd6e76c 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback(fn ($projectId, $keyId, $response, $dbForPlatform) => $this->action($projectId, $keyId, $response, $dbForPlatform)); + ->callback([$this, 'action']); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index 7941657a44..7513805913 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -40,7 +40,7 @@ class Update extends Action auth: [AuthType::ADMIN], responses: [ new SDKResponse( - code: Response::STATUS_CODE_CREATED, + code: Response::STATUS_CODE_OK, model: Response::MODEL_DEV_KEY ) ], @@ -52,7 +52,7 @@ class Update extends Action ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.') ->inject('response') ->inject('dbForPlatform') - ->callback(fn ($projectId, $keyId, $name, $expire, $response, $dbForPlatform) => $this->action($projectId, $keyId, $name, $expire, $response, $dbForPlatform)); + ->callback([$this, 'action']); } public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform) { diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 77315a1522..7221d54cda 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -40,7 +40,7 @@ class XList extends Action auth: [AuthType::ADMIN], responses: [ new SDKResponse( - code: Response::STATUS_CODE_CREATED, + code: Response::STATUS_CODE_OK, model: Response::MODEL_DEV_KEY_LIST ) ], @@ -49,7 +49,7 @@ class XList extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback(fn ($projectId, $response, $dbForPlatform) => $this->action($projectId, $response, $dbForPlatform)); + ->callback([$this, 'action']); } public function action(string $projectId, Response $response, Database $dbForPlatform) @@ -63,7 +63,7 @@ class XList extends Action $keys = $dbForPlatform->find('devKeys', [ Query::equal('projectInternalId', [$project->getInternalId()]), - Query::limit(5000), + Query::limit(APP_LIMIT_DEV_KEYS), ]); $response->dynamic(new Document([ diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index c196331346..55270f5ff9 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -366,7 +366,7 @@ class Response extends SwooleResponse ->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false)) ->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false)) ->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false)) - ->setModel(new BaseList('Dev Keys List', self::MODEL_DEV_KEY_LIST, 'keys', self::MODEL_DEV_KEY, true, false)) + ->setModel(new BaseList('Dev Keys List', self::MODEL_DEV_KEY_LIST, 'devKeys', self::MODEL_DEV_KEY, true, false)) ->setModel(new BaseList('Auth Providers List', self::MODEL_AUTH_PROVIDER_LIST, 'platforms', self::MODEL_AUTH_PROVIDER, true, false)) ->setModel(new BaseList('Platforms List', self::MODEL_PLATFORM_LIST, 'platforms', self::MODEL_PLATFORM, true, false)) ->setModel(new BaseList('Countries List', self::MODEL_COUNTRY_LIST, 'countries', self::MODEL_COUNTRY)) diff --git a/src/Appwrite/Utopia/Response/Model/DevKey.php b/src/Appwrite/Utopia/Response/Model/DevKey.php index 50ce750b6a..d1074bd7d3 100644 --- a/src/Appwrite/Utopia/Response/Model/DevKey.php +++ b/src/Appwrite/Utopia/Response/Model/DevKey.php @@ -37,7 +37,7 @@ class DevKey extends Model 'type' => self::TYPE_STRING, 'description' => 'Key name.', 'default' => '', - 'example' => 'My API Key', + 'example' => 'Dev API Key', ]) ->addRule('expire', [ 'type' => self::TYPE_DATETIME, From 84595e625db50dabcc8f8f3023435b113203ed1c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 09:31:05 +0000 Subject: [PATCH 127/169] chore: use getDocument instead to fetch devKey --- .../Platform/Modules/Projects/Http/DevKeys/Delete.php | 10 +++++----- .../Platform/Modules/Projects/Http/DevKeys/Get.php | 10 +++++----- .../Platform/Modules/Projects/Http/DevKeys/Update.php | 8 ++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index 4fabcc4db1..cce26a8de6 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -9,7 +9,6 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; -use Utopia\Database\Query; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -61,10 +60,11 @@ class Delete extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForPlatform->findOne('devKeys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); + $key = $dbForPlatform->getDocument('devKeys', $keyId); + + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } if ($key === false || $key->isEmpty()) { throw new Exception(Exception::KEY_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index bfbfd6e76c..ebc0c1bcbb 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -9,7 +9,6 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; -use Utopia\Database\Query; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -61,10 +60,11 @@ class Get extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForPlatform->findOne('devKeys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); + $key = $dbForPlatform->getDocument('devKeys', $keyId); + + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { + throw new Exception(Exception::KEY_NOT_FOUND); + } if ($key === false || $key->isEmpty()) { throw new Exception(Exception::KEY_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index 7513805913..c8560098cd 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -9,7 +9,6 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; -use Utopia\Database\Query; use Utopia\Database\Validator\Datetime as DatetimeValidator; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -63,12 +62,9 @@ class Update extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $key = $dbForPlatform->findOne('devKeys', [ - Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), - ]); + $key = $dbForPlatform->getDocument('devKeys', $keyId); - if ($key === false || $key->isEmpty()) { + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { throw new Exception(Exception::KEY_NOT_FOUND); } From 4a1bf2eb74b236a6e4a54388151f2327086aa1f9 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 09:44:30 +0000 Subject: [PATCH 128/169] fix: permissions on create devKey --- .../Platform/Modules/Projects/Http/DevKeys/Create.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index baf126cf5b..df1cb069e0 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -53,12 +53,13 @@ class Create extends Action ->param('projectId', '', new UID(), 'Project unique ID.') ->param('name', null, new Text(128), 'Key name. Max length: 128 chars.') ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.', false) + ->inject('user') ->inject('response') ->inject('dbForPlatform') ->callback([$this, 'action']); } - public function action(string $projectId, string $name, ?string $expire, Response $response, Database $dbForPlatform) + public function action(string $projectId, string $name, ?string $expire, Document $user, Response $response, Database $dbForPlatform) { $project = $dbForPlatform->getDocument('projects', $projectId); @@ -69,9 +70,9 @@ class Create extends Action $key = new Document([ '$id' => ID::unique(), '$permissions' => [ - Permission::read(Role::any()), - Permission::update(Role::any()), - Permission::delete(Role::any()), + Permission::read(Role::user($user->getId())), + Permission::update(Role::user($user->getId())), + Permission::delete(Role::user($user->getId())), ], 'projectInternalId' => $project->getInternalId(), 'projectId' => $project->getId(), From b4b356e61f3c09b4490d2a1b2a692e5a2f3acbcb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 11:14:02 +0000 Subject: [PATCH 129/169] chore: add queries and search to listing devkeys --- .env | 2 +- app/config/collections/platform.php | 18 +++++ app/init/constants.php | 1 - .../Modules/Projects/Http/DevKeys/Create.php | 4 +- .../Modules/Projects/Http/DevKeys/Update.php | 3 +- .../Modules/Projects/Http/DevKeys/XList.php | 29 +++++-- .../e2e/Services/Projects/ProjectsDevKeys.php | 75 ++++++++++++++++++- 7 files changed, 121 insertions(+), 11 deletions(-) diff --git a/.env b/.env index c10c12613b..d18e63c56e 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_ABUSE=enabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 39a5889b67..7dff5ae547 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -782,6 +782,17 @@ return [ 'array' => true, 'filters' => [], ], + [ + '$id' => ID::custom('search'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 16384, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => false, + 'filters' => [], + ], ], 'indexes' => [ [ @@ -798,6 +809,13 @@ return [ 'lengths' => [], 'orders' => [], ], + [ + '$id' => ID::custom('_key_search'), + 'type' => Database::INDEX_FULLTEXT, + 'attributes' => ['search'], + 'lengths' => [], + 'orders' => [], + ], ], ], diff --git a/app/init/constants.php b/app/init/constants.php index 9d3a08ed76..5e4edfd97d 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -26,7 +26,6 @@ const APP_LIMIT_SUBSCRIBERS_SUBQUERY = 1_000_000; const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate period const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls -const APP_LIMIT_DEV_KEYS = 5000; // Default maximum number of dev keys to return in list API calls const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index df1cb069e0..9636a166c1 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -67,8 +67,9 @@ class Create extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } + $devKeyId = ID::unique(); $key = new Document([ - '$id' => ID::unique(), + '$id' => $devKeyId, '$permissions' => [ Permission::read(Role::user($user->getId())), Permission::update(Role::user($user->getId())), @@ -79,6 +80,7 @@ class Create extends Action 'name' => $name, 'expire' => $expire, 'sdks' => [], + 'search' => implode('', [$name, $project->getId(), $devKeyId]), 'accessedAt' => null, 'secret' => \bin2hex(\random_bytes(128)), ]); diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index c8560098cd..c556578bc2 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -70,7 +70,8 @@ class Update extends Action $key ->setAttribute('name', $name) - ->setAttribute('expire', $expire); + ->setAttribute('expire', $expire) + ->setAttribute('search', implode('', [$name, $project->getId(), $key->getId()])); $dbForPlatform->updateDocument('devKeys', $key->getId(), $key); diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 7221d54cda..71511488f5 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -10,10 +10,16 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; +use Utopia\Database\Validator\Queries; +use Utopia\Database\Validator\Query\Cursor; +use Utopia\Database\Validator\Query\Limit; +use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; +use Utopia\Validator\Text; class XList extends Action { @@ -47,12 +53,14 @@ class XList extends Action contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') + ->param('queries', [], new Queries([new Limit(), new Offset(), new Cursor()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset and cursor', true) + ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForPlatform') ->callback([$this, 'action']); } - public function action(string $projectId, Response $response, Database $dbForPlatform) + public function action(string $projectId, ?array $queries, ?string $search, Response $response, Database $dbForPlatform) { $project = $dbForPlatform->getDocument('projects', $projectId); @@ -61,13 +69,22 @@ class XList extends Action throw new Exception(Exception::PROJECT_NOT_FOUND); } - $keys = $dbForPlatform->find('devKeys', [ - Query::equal('projectInternalId', [$project->getInternalId()]), - Query::limit(APP_LIMIT_DEV_KEYS), - ]); + try { + $queries = Query::parseQueries($queries); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); + } + + if (!empty($search)) { + $queries[] = Query::search('search', $search); + } + + $queries[] = Query::equal('projectInternalId', [$project->getInternalId()]); + + $keys = $dbForPlatform->find('devKeys', $queries); $response->dynamic(new Document([ - 'keys' => $keys, + 'devKeys' => $keys, 'total' => count($keys), ]), Response::MODEL_DEV_KEY_LIST); } diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index fbbdda6e93..54a7e907a5 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -4,6 +4,7 @@ namespace Tests\E2E\Services\Projects; use Tests\E2E\Client; use Utopia\Database\DateTime; +use Utopia\Database\Query; trait ProjectsDevKeys { @@ -13,6 +14,9 @@ trait ProjectsDevKeys */ public function testCreateProjectDevKey($data): array { + /** + * Test for SUCCESS + */ $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ @@ -30,6 +34,26 @@ trait ProjectsDevKeys $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); + /** Create a second dev key */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('Dev Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + /** + * Test for FAILURE + */ + /** TEST expiry date is required */ $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ 'content-type' => 'application/json', @@ -55,6 +79,11 @@ trait ProjectsDevKeys */ public function testListProjectDevKey($data): array { + /** + * Test for SUCCESS + */ + + /** List all dev keys */ $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ @@ -62,10 +91,51 @@ trait ProjectsDevKeys 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), []); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + /** List dev keys with limit */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(1)->toString() + ] + ]); $this->assertEquals(200, $response['headers']['status-code']); $this->assertEquals(1, $response['body']['total']); + /** List dev keys with search */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Dev' + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('Dev Key Test', $response['body']['devKeys'][0]['name']); + + /** + * Test for FAILURE + */ + + /** Test for search with invalid query */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('name', 'Invalid')->toString() + ] + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `queries` param: Invalid query method: search', $response['body']['message']); + return $data; } @@ -76,6 +146,9 @@ trait ProjectsDevKeys */ public function testGetProjectDevKey($data): array { + /** + * Test for SUCCESS + */ $id = $data['projectId'] ?? ''; $keyId = $data['keyId'] ?? ''; @@ -87,7 +160,7 @@ trait ProjectsDevKeys $this->assertEquals(200, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); $this->assertEquals($keyId, $response['body']['$id']); - $this->assertEquals('Key Test', $response['body']['name']); + $this->assertEquals('Dev Key Test', $response['body']['name']); $this->assertNotEmpty($response['body']['secret']); $this->assertArrayHasKey('accessedAt', $response['body']); $this->assertEmpty($response['body']['accessedAt']); From e8a0425cc3a46fa5a8eb77922db59136b5855249 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 13:03:56 +0000 Subject: [PATCH 130/169] chore: add allowed attributes to query --- .env | 2 +- .../Modules/Projects/Http/DevKeys/XList.php | 8 ++----- .../Database/Validator/Queries/DevKeys.php | 21 +++++++++++++++++++ .../e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php diff --git a/.env b/.env index d18e63c56e..c10c12613b 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=enabled +_APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 71511488f5..36b63c721e 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -12,15 +12,11 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Query as QueryException; use Utopia\Database\Query; -use Utopia\Database\Validator\Queries; -use Utopia\Database\Validator\Query\Cursor; -use Utopia\Database\Validator\Query\Limit; -use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; - +use Appwrite\Utopia\Database\Validator\Queries\DevKeys; class XList extends Action { use HTTP; @@ -53,7 +49,7 @@ class XList extends Action contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('queries', [], new Queries([new Limit(), new Offset(), new Cursor()]), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset and cursor', true) + ->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset and cursor', true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForPlatform') diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php b/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php new file mode 100644 index 0000000000..83d49ac2ae --- /dev/null +++ b/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php @@ -0,0 +1,21 @@ +<?php + +namespace Appwrite\Utopia\Database\Validator\Queries; + +class DevKeys extends Base +{ + public const ALLOWED_ATTRIBUTES = [ + 'name', + 'accessedAt', + 'expire' + ]; + + /** + * Expression constructor + * + */ + public function __construct() + { + parent::__construct('devKeys', self::ALLOWED_ATTRIBUTES); + } +} diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 54a7e907a5..2e3532acc2 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -134,7 +134,7 @@ trait ProjectsDevKeys ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `queries` param: Invalid query method: search', $response['body']['message']); + $this->assertEquals('Searching by attribute "name" requires a fulltext index.', $response['body']['message']); return $data; } From c6399a2a013f30b2f2157e209c797bd423c82026 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 13:11:48 +0000 Subject: [PATCH 131/169] chore: update specs and tests --- .../specs/open-api3-latest-console.json | 39 +++++++++++++---- app/config/specs/swagger2-latest-console.json | 42 +++++++++++++------ .../e2e/Services/Projects/ProjectsDevKeys.php | 11 +++++ 3 files changed, 71 insertions(+), 21 deletions(-) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a304a821fe..6538b21d8b 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -20352,7 +20352,7 @@ ], "description": "", "responses": { - "201": { + "200": { "description": "Dev Keys List", "content": { "application\/json": { @@ -20398,6 +20398,27 @@ "x-example": "<PROJECT_ID>" }, "in": "path" + }, + { + "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). Only supported methods are limit, offset and cursor", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" } ] }, @@ -20560,7 +20581,7 @@ ], "description": "", "responses": { - "201": { + "200": { "description": "DevKey", "content": { "application\/json": { @@ -20652,8 +20673,8 @@ ], "description": "", "responses": { - "201": { - "description": "File" + "204": { + "description": "No content" } }, "x-appwrite": { @@ -31497,13 +31518,13 @@ "properties": { "total": { "type": "integer", - "description": "Total number of keys documents that matched your query.", + "description": "Total number of devKeys documents that matched your query.", "x-example": 5, "format": "int32" }, - "keys": { + "devKeys": { "type": "array", - "description": "List of keys.", + "description": "List of devKeys.", "items": { "$ref": "#\/components\/schemas\/devKey" }, @@ -31512,7 +31533,7 @@ }, "required": [ "total", - "keys" + "devKeys" ] }, "platformList": { @@ -35626,7 +35647,7 @@ "name": { "type": "string", "description": "Key name.", - "x-example": "My API Key" + "x-example": "Dev API Key" }, "expire": { "type": "string", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 4af69d9c4c..0059fd1a4d 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -20833,7 +20833,7 @@ ], "description": "", "responses": { - "201": { + "200": { "description": "Dev Keys List", "schema": { "$ref": "#\/definitions\/devKeyList" @@ -20873,6 +20873,27 @@ "type": "string", "x-example": "<PROJECT_ID>", "in": "path" + }, + { + "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). Only supported methods are limit, offset and cursor", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" } ] }, @@ -21039,7 +21060,7 @@ ], "description": "", "responses": { - "201": { + "200": { "description": "DevKey", "schema": { "$ref": "#\/definitions\/devKey" @@ -21127,11 +21148,8 @@ ], "description": "", "responses": { - "201": { - "description": "File", - "schema": { - "type": "file" - } + "204": { + "description": "No content" } }, "x-appwrite": { @@ -31999,13 +32017,13 @@ "properties": { "total": { "type": "integer", - "description": "Total number of keys documents that matched your query.", + "description": "Total number of devKeys documents that matched your query.", "x-example": 5, "format": "int32" }, - "keys": { + "devKeys": { "type": "array", - "description": "List of keys.", + "description": "List of devKeys.", "items": { "type": "object", "$ref": "#\/definitions\/devKey" @@ -32015,7 +32033,7 @@ }, "required": [ "total", - "keys" + "devKeys" ] }, "platformList": { @@ -36161,7 +36179,7 @@ "name": { "type": "string", "description": "Key name.", - "x-example": "My API Key" + "x-example": "Dev API Key" }, "expire": { "type": "string", diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 2e3532acc2..83b4927425 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -119,6 +119,17 @@ trait ProjectsDevKeys $this->assertEquals(1, $response['body']['total']); $this->assertEquals('Dev Key Test', $response['body']['devKeys'][0]['name']); + /** List dev keys with querying `expire` */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(0, $response['body']['total']); // No dev keys expired + /** * Test for FAILURE */ From 3c78e7efff868957a1684f64d03b6f4040bd48f1 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 13:15:59 +0000 Subject: [PATCH 132/169] fix: query description --- app/config/specs/open-api3-latest-console.json | 2 +- app/config/specs/swagger2-latest-console.json | 2 +- .../Platform/Modules/Projects/Http/DevKeys/XList.php | 5 +++-- src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php | 3 +-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 6538b21d8b..0cc41f4125 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -20401,7 +20401,7 @@ }, { "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). Only supported methods are limit, offset and cursor", + "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: accessedAt, expire", "required": false, "schema": { "type": "string", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 0059fd1a4d..28f244b3b7 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -20876,7 +20876,7 @@ }, { "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). Only supported methods are limit, offset and cursor", + "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: accessedAt, expire", "required": false, "type": "array", "collectionFormat": "multi", diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 36b63c721e..0d3516558e 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -7,6 +7,7 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; +use Appwrite\Utopia\Database\Validator\Queries\DevKeys; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; @@ -16,7 +17,7 @@ use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; use Utopia\Validator\Text; -use Appwrite\Utopia\Database\Validator\Queries\DevKeys; + class XList extends Action { use HTTP; @@ -49,7 +50,7 @@ class XList extends Action contentType: ContentType::JSON )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit, offset and cursor', true) + ->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', DevKeys::ALLOWED_ATTRIBUTES), true) ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForPlatform') diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php b/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php index 83d49ac2ae..d9dbbeadc4 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/DevKeys.php @@ -5,9 +5,8 @@ namespace Appwrite\Utopia\Database\Validator\Queries; class DevKeys extends Base { public const ALLOWED_ATTRIBUTES = [ - 'name', 'accessedAt', - 'expire' + 'expire', ]; /** From b9f50d9f01f5e35c5cb4c63b4bafc96b2d5cf871 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 13:21:06 +0000 Subject: [PATCH 133/169] chore: fix test --- tests/e2e/Services/Projects/ProjectsDevKeys.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 83b4927425..39ce495c0e 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -145,7 +145,7 @@ trait ProjectsDevKeys ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Searching by attribute "name" requires a fulltext index.', $response['body']['message']); + $this->assertEquals('Invalid `queries` param: Invalid query: Attribute not found in schema: name', $response['body']['message']); return $data; } From 013555cc8e0601d26b95b06b77e787399a05da0c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 14:21:56 +0000 Subject: [PATCH 134/169] chore: add tests for hostname check with devkeys --- .env | 2 +- .../e2e/Services/Projects/ProjectsDevKeys.php | 70 ++++++++++++++++++- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/.env b/.env index c10c12613b..d18e63c56e 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_ABUSE=enabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 39ce495c0e..5fe39798c8 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -4,6 +4,7 @@ namespace Tests\E2E\Services\Projects; use Tests\E2E\Client; use Utopia\Database\DateTime; +use Utopia\Database\Helpers\ID; use Utopia\Database\Query; trait ProjectsDevKeys @@ -189,6 +190,74 @@ trait ProjectsDevKeys return $data; } + /** + * @depends testCreateProject + * @group devKeys + */ + public function testNoHostValidationWithDevKey($data): void + { + $id = $data['projectId'] ?? ''; + + /** Create a dev key */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + $devKey = $response['body']['secret']; + + /** Test oauth2 and get invalid `success` URL */ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id + ], [ + 'success' => 'https://example.com', + 'failure' => 'https://example.com' + ]); + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); + + /** Test oauth2 with devKey and now get oauth2 is disabled */ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $devKey + ], [ + 'success' => 'https://example.com', + 'failure' => 'https://example.com' + ]); + $this->assertEquals(412, $response['headers']['status-code']); + $this->assertEquals('This provider is disabled. Please enable the provider from your Appwrite console to continue.', $response['body']['message']); + + /** Test hostname in Magic URL */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + ], [ + 'userId' => ID::unique(), + 'email' => 'user@appwrite.io', + 'url' => 'https://example.com', + ]); + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `url` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); + + /** Test hostname in Magic URL with devKey */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $devKey + ], [ + 'userId' => ID::unique(), + 'email' => 'user@appwrite.io', + 'url' => 'https://example.com', + ]); + $this->assertEquals(201, $response['headers']['status-code']); + } + /** * @depends testCreateProject * @group devKeys @@ -296,7 +365,6 @@ trait ProjectsDevKeys $this->assertEquals(429, $res['headers']['status-code']); } - /** * @depends testCreateProjectDevKey * @group devKeys From 45df0ef85466295246c96ed1f2ad4369b0667967 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Wed, 9 Apr 2025 16:24:24 +0000 Subject: [PATCH 135/169] chore: add cors test --- .../e2e/Services/Projects/ProjectsDevKeys.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index 5fe39798c8..a17c3fbe99 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -258,6 +258,63 @@ trait ProjectsDevKeys $this->assertEquals(201, $response['headers']['status-code']); } + /** + * @depends testCreateProjectDevKey + * @group devKeys + */ + public function testCorsWithDevKey($data): void + { + $projectId = $data['projectId'] ?? ''; + + $id = $data['projectId'] ?? ''; + + /** Create a dev key */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 3600), + ]); + $this->assertEquals(201, $response['headers']['status-code']); + + $devKey = $response['body']['secret']; + $origin = 'http://example.com'; + + /** + * Test CORS without Dev Key (should fail due to origin) + */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => $origin, + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + + $this->assertEquals(403, $response['headers']['status-code']); + $this->assertNotEquals($origin, $response['headers']['access-control-allow-origin'] ?? null); + $this->assertEquals('http://localhost', $response['headers']['access-control-allow-origin'] ?? null); + + + /** + * Test CORS with Dev Key (should bypass origin check) + */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => $origin, + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('*', $response['headers']['access-control-allow-origin'] ?? null); + } + /** * @depends testCreateProject * @group devKeys From 0479f4cca7e1039cc0039a9a43238d4bb88618e0 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 10 Apr 2025 07:29:24 +0000 Subject: [PATCH 136/169] chore: change abuse back to disabled --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index d18e63c56e..c10c12613b 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=enabled +_APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled From 3b8354d2ea36fbb5c600fce2a3201516dd5789ba Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 03:55:04 +0000 Subject: [PATCH 137/169] chore: add sdk to key --- app/init/resources.php | 45 +++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index 81d80092c4..38edfc177d 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -50,6 +50,7 @@ use Utopia\Storage\Device\Wasabi; use Utopia\Storage\Storage; use Utopia\System\System; use Utopia\Validator\Hostname; +use Utopia\Validator\WhiteList; use Utopia\VCS\Adapter\Git\GitHub as VcsGitHub; // Runtime Execution @@ -782,26 +783,48 @@ App::setResource('smsRates', function () { return []; }); -App::setResource('devKey', function (Request $request, Document $project, Database $dbForPlatform) { +App::setResource('devKey', function (Request $request, Document $project, array $servers, Database $dbForPlatform) { $devKey = $request->getHeader('x-appwrite-dev-key', $request->getParam('devKey', '')); + // Check if given key match project's development keys $key = $project->find('secret', $devKey, 'devKeys'); - if ($key) { - $expire = $key->getAttribute('expire'); - if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { - return new Document([]); - } + if (!$key) { + return new Document([]); + } - $accessedAt = $key->getAttribute('accessedAt', ''); - if (DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { + // check expiration + $expire = $key->getAttribute('expire'); + if (!empty($expire) && $expire < DatabaseDateTime::formatTz(DatabaseDateTime::now())) { + return new Document([]); + } + + // update access time + $accessedAt = $key->getAttribute('accessedAt', ''); + if (DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { + $key->setAttribute('accessedAt', DatabaseDateTime::now()); + Authorization::skip(fn () => $dbForPlatform->updateDocument('keys', $key->getId(), $key)); + $dbForPlatform->purgeCachedDocument('projects', $project->getId()); + } + + // add sdk to key + $sdkValidator = new WhiteList($servers, true); + $sdk = $request->getHeader('x-sdk-name', 'UNKNOWN'); + + if ($sdkValidator->isValid($sdk)) { + $sdks = $key->getAttribute('sdks', []); + + if (!in_array($sdk, $sdks)) { + $sdks[] = $sdk; + $key->setAttribute('sdks', $sdks); + + /** Update access time as well */ $key->setAttribute('accessedAt', DatabaseDateTime::now()); Authorization::skip(fn () => $dbForPlatform->updateDocument('keys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } - return $key; } - return new Document([]); -}, ['request', 'project', 'dbForPlatform']); + return $key; +}, ['request', 'project', 'servers', 'dbForPlatform']); App::setResource('team', function (Document $project, Database $dbForPlatform, App $utopia, Request $request) { $teamInternalId = ''; From f31cb0cdfcdfe289b9ec63f7ed140ce8c6175e3b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 07:34:05 +0000 Subject: [PATCH 138/169] chore: added tests for checking if sdks are updated in devkeys --- .env | 2 +- app/init/resources.php | 4 +- src/Appwrite/Utopia/Response/Model/DevKey.php | 7 ++ .../e2e/Services/Projects/ProjectsDevKeys.php | 97 +++++++++++-------- 4 files changed, 66 insertions(+), 44 deletions(-) diff --git a/.env b/.env index c10c12613b..d18e63c56e 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_ABUSE=enabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/app/init/resources.php b/app/init/resources.php index 38edfc177d..f1a743f1f8 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -802,7 +802,7 @@ App::setResource('devKey', function (Request $request, Document $project, array $accessedAt = $key->getAttribute('accessedAt', ''); if (DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { $key->setAttribute('accessedAt', DatabaseDateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('keys', $key->getId(), $key)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } @@ -819,7 +819,7 @@ App::setResource('devKey', function (Request $request, Document $project, array /** Update access time as well */ $key->setAttribute('accessedAt', DatabaseDateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('keys', $key->getId(), $key)); + Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } } diff --git a/src/Appwrite/Utopia/Response/Model/DevKey.php b/src/Appwrite/Utopia/Response/Model/DevKey.php index d1074bd7d3..b8da6c0cfc 100644 --- a/src/Appwrite/Utopia/Response/Model/DevKey.php +++ b/src/Appwrite/Utopia/Response/Model/DevKey.php @@ -57,6 +57,13 @@ class DevKey extends Model 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE ]) + ->addRule('sdks', [ + 'type' => self::TYPE_STRING, + 'description' => 'List of SDK user agents that used this key.', + 'default' => null, + 'example' => 'appwrite:flutter', + 'array' => true + ]) ; } diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php index a17c3fbe99..57c832750e 100644 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ b/tests/e2e/Services/Projects/ProjectsDevKeys.php @@ -191,24 +191,62 @@ trait ProjectsDevKeys } /** - * @depends testCreateProject + * @depends testCreateProjectDevKey + * @group devKeys + */ + public function testGetDevKeyWithSdks($data): array + { + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; + $devKey = $data['secret'] ?? ''; + + /** Use dev key with python sdk */ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $devKey, + 'x-sdk-name' => 'python' + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $res['headers']['status-code']); + + /** Use dev key with php sdk */ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-dev-key' => $devKey, + 'x-sdk-name' => 'php' + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $res['headers']['status-code']); + + /** Get the dev key */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertCount(2, $response['body']['sdks']); + $this->assertContains('python', $response['body']['sdks']); + $this->assertContains('php', $response['body']['sdks']); + + return $data; + } + + /** + * @depends testCreateProjectDevKey * @group devKeys */ public function testNoHostValidationWithDevKey($data): void { $id = $data['projectId'] ?? ''; - - /** Create a dev key */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 3600), - ]); - $this->assertEquals(201, $response['headers']['status-code']); - - $devKey = $response['body']['secret']; + $devKey = $data['secret'] ?? ''; /** Test oauth2 and get invalid `success` URL */ $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ @@ -265,20 +303,7 @@ trait ProjectsDevKeys public function testCorsWithDevKey($data): void { $projectId = $data['projectId'] ?? ''; - - $id = $data['projectId'] ?? ''; - - /** Create a dev key */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 3600), - ]); - $this->assertEquals(201, $response['headers']['status-code']); - - $devKey = $response['body']['secret']; + $devKey = $data['secret'] ?? ''; $origin = 'http://example.com'; /** @@ -316,26 +341,17 @@ trait ProjectsDevKeys } /** - * @depends testCreateProject + * @depends testCreateProjectDevKey * @group devKeys */ public function testNoRateLimitWithDevKey($data): void { $id = $data['projectId'] ?? ''; + $devKey = $data['secret'] ?? ''; /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 3600), - ]); - - $devKey = $response['body']['secret']; - for ($i = 0; $i < 10; $i++) { $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ 'content-type' => 'application/json', @@ -365,7 +381,6 @@ trait ProjectsDevKeys ]); $this->assertEquals(401, $res['headers']['status-code']); - /** * Test for FAILURE */ @@ -444,7 +459,7 @@ trait ProjectsDevKeys $this->assertEquals($keyId, $response['body']['$id']); $this->assertEquals('Key Test Update', $response['body']['name']); $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertEmpty($response['body']['accessedAt']); + $this->assertNotEmpty($response['body']['accessedAt']); $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ 'content-type' => 'application/json', @@ -456,7 +471,7 @@ trait ProjectsDevKeys $this->assertEquals($keyId, $response['body']['$id']); $this->assertEquals('Key Test Update', $response['body']['name']); $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertEmpty($response['body']['accessedAt']); + $this->assertNotEmpty($response['body']['accessedAt']); return $data; } From a1aabd351c6bee1a354278b84ed53cc4ea6bdde1 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 07:34:52 +0000 Subject: [PATCH 139/169] fix: env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index d18e63c56e..c10c12613b 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=enabled +_APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled From 6372180537d479945f7aeb64521dfb14b6a23745 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 08:22:42 +0000 Subject: [PATCH 140/169] chore: update specs --- app/config/specs/open-api3-latest-console.json | 11 ++++++++++- app/config/specs/swagger2-latest-console.json | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 0cc41f4125..498f30d671 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -35663,6 +35663,14 @@ "type": "string", "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" } }, "required": [ @@ -35672,7 +35680,8 @@ "name", "expire", "secret", - "accessedAt" + "accessedAt", + "sdks" ] }, "mockNumber": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 28f244b3b7..ecacbaf897 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -36195,6 +36195,14 @@ "type": "string", "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" } }, "required": [ @@ -36204,7 +36212,8 @@ "name", "expire", "secret", - "accessedAt" + "accessedAt", + "sdks" ] }, "mockNumber": { From 74abf4897b769ca6562fd3e856b98c7785d275a2 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 08:47:57 +0000 Subject: [PATCH 141/169] chore: fix teamCreateMembership --- app/controllers/api/teams.php | 1 + tests/e2e/Services/Teams/TeamsBaseClient.php | 12 ---------- .../Services/Teams/TeamsConsoleClientTest.php | 24 +++++++++++++++++++ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index ef589233f2..f58be39857 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -51,6 +51,7 @@ use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; use Utopia\Validator\Host; use Utopia\Validator\Text; +use Utopia\Validator\URL; use Utopia\Validator\WhiteList; App::post('/v1/teams') diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 3fcd9c043d..1858fd50ad 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -337,18 +337,6 @@ trait TeamsBaseClient $this->assertEquals(400, $response['headers']['status-code']); - $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'email' => $email, - 'name' => $name, - 'roles' => ['developer'], - 'url' => 'http://example.com/join-us#title' // bad url - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - return [ 'teamUid' => $teamUid, 'teamName' => $teamName, diff --git a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php index 4b5ade7cbf..dec61d5258 100644 --- a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php +++ b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php @@ -14,6 +14,30 @@ class TeamsConsoleClientTest extends Scope use ProjectConsole; use SideClient; + /** + * @depends testCreateTeam + */ + public function testTeamCreateMembershipConsole($data): array + { + $teamUid = $data['teamUid'] ?? ''; + $email = uniqid() . 'friend@localhost.test'; + $name = 'Friend User'; + + $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'email' => $email, + 'name' => $name, + 'roles' => ['developer'], + 'url' => 'http://example.com/join-us#title' // bad url + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + + return $data; + } + /** * @depends testCreateTeam */ From 65965692591731ded1903fb5b22ea38b062d3d43 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 18:01:40 +0000 Subject: [PATCH 142/169] chore: make devkeys test dependence free --- .env | 2 +- tests/e2e/Services/Projects/ProjectsBase.php | 42 ++ .../Projects/ProjectsConsoleClientTest.php | 593 +++++++++++++++++- .../e2e/Services/Projects/ProjectsDevKeys.php | 529 ---------------- 4 files changed, 635 insertions(+), 531 deletions(-) delete mode 100644 tests/e2e/Services/Projects/ProjectsDevKeys.php diff --git a/.env b/.env index c10c12613b..d18e63c56e 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=disabled +_APP_OPTIONS_ABUSE=enabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled diff --git a/tests/e2e/Services/Projects/ProjectsBase.php b/tests/e2e/Services/Projects/ProjectsBase.php index 53d9626252..0d1d6a5a44 100644 --- a/tests/e2e/Services/Projects/ProjectsBase.php +++ b/tests/e2e/Services/Projects/ProjectsBase.php @@ -2,6 +2,48 @@ namespace Tests\E2E\Services\Projects; +use Tests\E2E\Client; +use Utopia\Database\Helpers\ID; + trait ProjectsBase { + protected function setupProject(mixed $params): string + { + $team = $this->client->call(Client::METHOD_POST, '/teams', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'teamId' => ID::unique(), + 'name' => 'Project Test', + ]); + + $this->assertEquals(201, $team['headers']['status-code'], 'Setup team failed with status code: ' . $team['headers']['status-code'] . ' and response: ' . json_encode($team['body'], JSON_PRETTY_PRINT)); + + $project = $this->client->call(Client::METHOD_POST, '/projects', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + ...$params, + 'teamId' => $team['body']['$id'], + ]); + + $this->assertEquals(201, $project['headers']['status-code'], 'Setup project failed with status code: ' . $project['headers']['status-code'] . ' and response: ' . json_encode($project['body'], JSON_PRETTY_PRINT)); + + return $project['body']['$id']; + } + + protected function setupDevKey(mixed $params): array + { + $devKey = $this->client->call(Client::METHOD_POST, '/projects/' . $params['projectId'] . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), $params); + + $this->assertEquals(201, $devKey['headers']['status-code'], 'Setup devKey failed with status code: ' . $devKey['headers']['status-code'] . ' and response: ' . json_encode($devKey['body'], JSON_PRETTY_PRINT)); + + return [ + '$id' => $devKey['body']['$id'], + 'secret' => $devKey['body']['secret'], + ]; + } } diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 34ecba242f..491e0371b0 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -22,7 +22,6 @@ class ProjectsConsoleClientTest extends Scope use ProjectConsole; use SideClient; use Async; - use ProjectsDevKeys; /** * @group devKeys @@ -4241,4 +4240,596 @@ class ProjectsConsoleClientTest extends Scope return $data; } + + /** + * Devkeys Tests starts here ------------------------------------------------ + */ + + /** + * @group devKeys + */ + public function testCreateProjectDevKey(): void + { + /** + * Test for SUCCESS + */ + $id = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testCreateProjectDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + /** Create a second dev key */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals('Dev Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + /** + * Test for FAILURE + */ + + /** TEST expiry date is required */ + $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test' + ]); + + $this->assertEquals(400, $res['headers']['status-code']); + } + + + /** + * @group devKeys + */ + public function testListProjectDevKey(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testListProjectDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + /** Create devKey 1 */ + $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + /** Create devKey 2 */ + $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + /** List all dev keys */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + /** List dev keys with limit */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::limit(1)->toString() + ] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + + /** List dev keys with search */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'search' => 'Dev' + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(1, $response['body']['total']); + $this->assertEquals('Dev Key Test', $response['body']['devKeys'][0]['name']); + + /** List dev keys with querying `expire` */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString()] + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(0, $response['body']['total']); // No dev keys expired + + /** + * Test for FAILURE + */ + + /** Test for search with invalid query */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::search('name', 'Invalid')->toString() + ] + ]); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `queries` param: Invalid query: Attribute not found in schema: name', $response['body']['message']); + } + + + /** + * @group devKeys + */ + public function testGetProjectDevKey(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testGetProjectDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($devKey['$id'], $response['body']['$id']); + $this->assertEquals('Dev Key Test', $response['body']['name']); + $this->assertNotEmpty($response['body']['secret']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys/error', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + } + + /** + * @group devKeys + */ + public function testGetDevKeyWithSdks(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testGetDevKeyWithSdks', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + /** Use dev key with python sdk */ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'], + 'x-sdk-name' => 'python' + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $res['headers']['status-code']); + + /** Use dev key with php sdk */ + $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'], + 'x-sdk-name' => 'php' + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $res['headers']['status-code']); + + /** Get the dev key */ + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertArrayHasKey('sdks', $response['body']); + $this->assertCount(2, $response['body']['sdks']); + $this->assertContains('python', $response['body']['sdks']); + $this->assertContains('php', $response['body']['sdks']); + } + + /** + * @group devKeys + */ + public function testNoHostValidationWithDevKey(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testNoHostValidationWithDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + /** Test oauth2 and get invalid `success` URL */ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'success' => 'https://example.com', + 'failure' => 'https://example.com' + ]); + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); + + /** Test oauth2 with devKey and now get oauth2 is disabled */ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'success' => 'https://example.com', + 'failure' => 'https://example.com' + ]); + $this->assertEquals(412, $response['headers']['status-code']); + $this->assertEquals('This provider is disabled. Please enable the provider from your Appwrite console to continue.', $response['body']['message']); + + /** Test hostname in Magic URL */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'userId' => ID::unique(), + 'email' => 'user@appwrite.io', + 'url' => 'https://example.com', + ]); + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('Invalid `url` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); + + /** Test hostname in Magic URL with devKey */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'userId' => ID::unique(), + 'email' => 'user@appwrite.io', + 'url' => 'https://example.com', + ]); + $this->assertEquals(201, $response['headers']['status-code']); + } + + /** + * @group devKeys + */ + public function testCorsWithDevKey(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testCorsWithDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $origin = 'http://example.com'; + + /** + * Test CORS without Dev Key (should fail due to origin) + */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => $origin, + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + + $this->assertEquals(403, $response['headers']['status-code']); + $this->assertNotEquals($origin, $response['headers']['access-control-allow-origin'] ?? null); + $this->assertEquals('http://localhost', $response['headers']['access-control-allow-origin'] ?? null); + + + /** + * Test CORS with Dev Key (should bypass origin check) + */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'origin' => $origin, + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('*', $response['headers']['access-control-allow-origin'] ?? null); + } + + /** + * @group devKeys + */ + public function testNoRateLimitWithDevKey(): void + { + /** + * Test for SUCCESS + */ + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testNoRateLimitWithDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + /** + * Test for SUCCESS + */ + for ($i = 0; $i < 10; $i++) { + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $response['headers']['status-code']); + } + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $projectId . '/dev-keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), -3600), + ]); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $response['body']['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $response['headers']['status-code']); + + /** + * Test for FAILURE after expire + */ + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test Expire 5 seconds', + 'expire' => DateTime::addSeconds(new \DateTime(), 5) + ]); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(401, $response['headers']['status-code']); + + sleep(5); + + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $response['headers']['status-code']); + } + + /** + * @group devKeys + */ + public function testUpdateProjectDevKey(): void + { + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testUpdateProjectDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'name' => 'Key Test Update', + 'expire' => DateTime::addSeconds(new \DateTime(), 360), + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($devKey['$id'], $response['body']['$id']); + $this->assertEquals('Key Test Update', $response['body']['name']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals($devKey['$id'], $response['body']['$id']); + $this->assertEquals('Key Test Update', $response['body']['name']); + $this->assertArrayHasKey('accessedAt', $response['body']); + $this->assertEmpty($response['body']['accessedAt']); + } + + /** + * @group devKeys + */ + public function testDeleteProjectDevKey(): void + { + $projectId = $this->setupProject([ + 'projectId' => ID::unique(), + 'name' => 'testDeleteProjectDevKey', + 'region' => System::getEnv('_APP_REGION', 'default') + ]); + + $devKey = $this->setupDevKey([ + 'projectId' => $projectId, + 'name' => 'Dev Key Test', + 'expire' => DateTime::addSeconds(new \DateTime(), 36000) + ]); + + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEmpty($response['body']); + + /** + * Get rate limit trying to use the deleted key + */ + $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $projectId, + 'x-appwrite-dev-key' => $devKey['secret'] + ], [ + 'email' => 'user@appwrite.io', + 'password' => 'password' + ]); + $this->assertEquals(429, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $projectId . '/dev-keys/' . $devKey['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $projectId . '/dev-keys/error', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), []); + + $this->assertEquals(404, $response['headers']['status-code']); + } + + /** + * Devkeys Tests ends here ------------------------------------------------ + */ } diff --git a/tests/e2e/Services/Projects/ProjectsDevKeys.php b/tests/e2e/Services/Projects/ProjectsDevKeys.php deleted file mode 100644 index 57c832750e..0000000000 --- a/tests/e2e/Services/Projects/ProjectsDevKeys.php +++ /dev/null @@ -1,529 +0,0 @@ -<?php - -namespace Tests\E2E\Services\Projects; - -use Tests\E2E\Client; -use Utopia\Database\DateTime; -use Utopia\Database\Helpers\ID; -use Utopia\Database\Query; - -trait ProjectsDevKeys -{ - /** - * @depends testCreateProject - * @group devKeys - */ - public function testCreateProjectDevKey($data): array - { - /** - * Test for SUCCESS - */ - $id = $data['projectId'] ?? ''; - - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 36000) - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals('Key Test', $response['body']['name']); - $this->assertNotEmpty($response['body']['secret']); - $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertEmpty($response['body']['accessedAt']); - - /** Create a second dev key */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Dev Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 36000) - ]); - - $this->assertEquals(201, $response['headers']['status-code']); - $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals('Dev Key Test', $response['body']['name']); - $this->assertNotEmpty($response['body']['secret']); - $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertEmpty($response['body']['accessedAt']); - - /** - * Test for FAILURE - */ - - /** TEST expiry date is required */ - $res = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test' - ]); - - $this->assertEquals(400, $res['headers']['status-code']); - - $data = array_merge($data, [ - 'keyId' => $response['body']['$id'], - 'secret' => $response['body']['secret'] - ]); - - return $data; - } - - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testListProjectDevKey($data): array - { - /** - * Test for SUCCESS - */ - - /** List all dev keys */ - $id = $data['projectId'] ?? ''; - - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(2, $response['body']['total']); - - /** List dev keys with limit */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::limit(1)->toString() - ] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1, $response['body']['total']); - - /** List dev keys with search */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'search' => 'Dev' - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(1, $response['body']['total']); - $this->assertEquals('Dev Key Test', $response['body']['devKeys'][0]['name']); - - /** List dev keys with querying `expire` */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [Query::lessThan('expire', (new \DateTime())->format('Y-m-d H:i:s'))->toString()] - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(0, $response['body']['total']); // No dev keys expired - - /** - * Test for FAILURE - */ - - /** Test for search with invalid query */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'queries' => [ - Query::search('name', 'Invalid')->toString() - ] - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `queries` param: Invalid query: Attribute not found in schema: name', $response['body']['message']); - - return $data; - } - - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testGetProjectDevKey($data): array - { - /** - * Test for SUCCESS - */ - $id = $data['projectId'] ?? ''; - $keyId = $data['keyId'] ?? ''; - - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals($keyId, $response['body']['$id']); - $this->assertEquals('Dev Key Test', $response['body']['name']); - $this->assertNotEmpty($response['body']['secret']); - $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertEmpty($response['body']['accessedAt']); - - /** - * Test for FAILURE - */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/error', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(404, $response['headers']['status-code']); - - return $data; - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testGetDevKeyWithSdks($data): array - { - $id = $data['projectId'] ?? ''; - $keyId = $data['keyId'] ?? ''; - $devKey = $data['secret'] ?? ''; - - /** Use dev key with python sdk */ - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $devKey, - 'x-sdk-name' => 'python' - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(401, $res['headers']['status-code']); - - /** Use dev key with php sdk */ - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $devKey, - 'x-sdk-name' => 'php' - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(401, $res['headers']['status-code']); - - /** Get the dev key */ - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertArrayHasKey('sdks', $response['body']); - $this->assertCount(2, $response['body']['sdks']); - $this->assertContains('python', $response['body']['sdks']); - $this->assertContains('php', $response['body']['sdks']); - - return $data; - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testNoHostValidationWithDevKey($data): void - { - $id = $data['projectId'] ?? ''; - $devKey = $data['secret'] ?? ''; - - /** Test oauth2 and get invalid `success` URL */ - $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id - ], [ - 'success' => 'https://example.com', - 'failure' => 'https://example.com' - ]); - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); - - /** Test oauth2 with devKey and now get oauth2 is disabled */ - $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $devKey - ], [ - 'success' => 'https://example.com', - 'failure' => 'https://example.com' - ]); - $this->assertEquals(412, $response['headers']['status-code']); - $this->assertEquals('This provider is disabled. Please enable the provider from your Appwrite console to continue.', $response['body']['message']); - - /** Test hostname in Magic URL */ - $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - ], [ - 'userId' => ID::unique(), - 'email' => 'user@appwrite.io', - 'url' => 'https://example.com', - ]); - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `url` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); - - /** Test hostname in Magic URL with devKey */ - $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $devKey - ], [ - 'userId' => ID::unique(), - 'email' => 'user@appwrite.io', - 'url' => 'https://example.com', - ]); - $this->assertEquals(201, $response['headers']['status-code']); - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testCorsWithDevKey($data): void - { - $projectId = $data['projectId'] ?? ''; - $devKey = $data['secret'] ?? ''; - $origin = 'http://example.com'; - - /** - * Test CORS without Dev Key (should fail due to origin) - */ - $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'origin' => $origin, - 'content-type' => 'application/json', - 'x-appwrite-project' => $projectId, - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - - $this->assertEquals(403, $response['headers']['status-code']); - $this->assertNotEquals($origin, $response['headers']['access-control-allow-origin'] ?? null); - $this->assertEquals('http://localhost', $response['headers']['access-control-allow-origin'] ?? null); - - - /** - * Test CORS with Dev Key (should bypass origin check) - */ - $response = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'origin' => $origin, - 'content-type' => 'application/json', - 'x-appwrite-project' => $projectId, - 'x-appwrite-dev-key' => $devKey - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - - $this->assertEquals(401, $response['headers']['status-code']); - $this->assertEquals('*', $response['headers']['access-control-allow-origin'] ?? null); - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testNoRateLimitWithDevKey($data): void - { - $id = $data['projectId'] ?? ''; - $devKey = $data['secret'] ?? ''; - - /** - * Test for SUCCESS - */ - for ($i = 0; $i < 10; $i++) { - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(401, $res['headers']['status-code']); - } - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(429, $res['headers']['status-code']); - - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $devKey - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(401, $res['headers']['status-code']); - - /** - * Test for FAILURE - */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), -3600), - ]); - - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $response['body']['secret'] - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(429, $res['headers']['status-code']); - - - /** - * Test for FAILURE after expire - */ - $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/dev-keys', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test', - 'expire' => DateTime::addSeconds(new \DateTime(), 5), - ]); - - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $response['body']['secret'] - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(401, $res['headers']['status-code']); - - sleep(5); - - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $response['body']['secret'] - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(429, $res['headers']['status-code']); - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testUpdateProjectDevKey($data): array - { - $id = $data['projectId'] ?? ''; - $keyId = $data['keyId'] ?? ''; - - $response = $this->client->call(Client::METHOD_PUT, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'name' => 'Key Test Update', - 'expire' => DateTime::addSeconds(new \DateTime(), 360), - ]); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals($keyId, $response['body']['$id']); - $this->assertEquals('Key Test Update', $response['body']['name']); - $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertNotEmpty($response['body']['accessedAt']); - - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertNotEmpty($response['body']['$id']); - $this->assertEquals($keyId, $response['body']['$id']); - $this->assertEquals('Key Test Update', $response['body']['name']); - $this->assertArrayHasKey('accessedAt', $response['body']); - $this->assertNotEmpty($response['body']['accessedAt']); - - return $data; - } - - /** - * @depends testCreateProjectDevKey - * @group devKeys - */ - public function testDeleteProjectDevKey($data): array - { - $id = $data['projectId'] ?? ''; - $keyId = $data['keyId'] ?? ''; - - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(204, $response['headers']['status-code']); - $this->assertEmpty($response['body']); - - /** - * Get rate limit trying to use the deleted key - */ - $res = $this->client->call(Client::METHOD_POST, '/account/sessions/email', [ - 'content-type' => 'application/json', - 'x-appwrite-project' => $id, - 'x-appwrite-dev-key' => $data['secret'] - ], [ - 'email' => 'user@appwrite.io', - 'password' => 'password' - ]); - $this->assertEquals(429, $res['headers']['status-code']); - - $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/dev-keys/' . $keyId, array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(404, $response['headers']['status-code']); - - - /** - * Test for FAILURE - */ - $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/dev-keys/error', array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), []); - - $this->assertEquals(404, $response['headers']['status-code']); - - return $data; - } -} From 9bec94c976c020b27409c80591c267b86fba62fb Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 14 Apr 2025 18:02:30 +0000 Subject: [PATCH 143/169] fix: env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index d18e63c56e..c10c12613b 100644 --- a/.env +++ b/.env @@ -15,7 +15,7 @@ _APP_SYSTEM_TEAM_EMAIL=team@appwrite.io _APP_EMAIL_SECURITY=security@appwrite.io _APP_EMAIL_CERTIFICATES=certificates@appwrite.io _APP_SYSTEM_RESPONSE_FORMAT= -_APP_OPTIONS_ABUSE=enabled +_APP_OPTIONS_ABUSE=disabled _APP_OPTIONS_ROUTER_PROTECTION=disabled _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled From 40c15077e2bfc0a7ed37d13f1600261541f17a99 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Tue, 15 Apr 2025 10:47:04 +0000 Subject: [PATCH 144/169] chore: update devkey init and make tests use mock oauth --- app/init/resources.php | 2 +- .../Projects/ProjectsConsoleClientTest.php | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index f1a743f1f8..270062e582 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -819,7 +819,7 @@ App::setResource('devKey', function (Request $request, Document $project, array /** Update access time as well */ $key->setAttribute('accessedAt', DatabaseDateTime::now()); - Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); + $key = Authorization::skip(fn () => $dbForPlatform->updateDocument('devKeys', $key->getId(), $key)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); } } diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 491e0371b0..c2ee953044 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -4519,8 +4519,24 @@ class ProjectsConsoleClientTest extends Scope 'expire' => DateTime::addSeconds(new \DateTime(), 36000) ]); + $provider = 'mock'; + $appId = '1'; + $secret = '123456'; + + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $projectId . '/oauth2', array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'provider' => $provider, + 'appId' => $appId, + 'secret' => $secret, + 'enabled' => true, + ]); + $this->assertEquals(200, $response['headers']['status-code']); + /** Test oauth2 and get invalid `success` URL */ - $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/' . $provider, [ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, ], [ @@ -4531,7 +4547,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); /** Test oauth2 with devKey and now get oauth2 is disabled */ - $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/google', [ + $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/' . $provider, [ 'content-type' => 'application/json', 'x-appwrite-project' => $projectId, 'x-appwrite-dev-key' => $devKey['secret'] @@ -4539,8 +4555,7 @@ class ProjectsConsoleClientTest extends Scope 'success' => 'https://example.com', 'failure' => 'https://example.com' ]); - $this->assertEquals(412, $response['headers']['status-code']); - $this->assertEquals('This provider is disabled. Please enable the provider from your Appwrite console to continue.', $response['body']['message']); + $this->assertEquals(200, $response['headers']['status-code']); /** Test hostname in Magic URL */ $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ From c365480aec0f6cf2408a391231d44ef93793820b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Tue, 15 Apr 2025 12:02:55 +0000 Subject: [PATCH 145/169] chore: small changes from review devkeys --- app/controllers/general.php | 12 ++++++++++-- app/init/resources.php | 6 +++--- .../Modules/Projects/Http/DevKeys/Delete.php | 4 ---- src/Appwrite/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 050dda5753..a103451b3b 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -714,9 +714,13 @@ App::init() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $devKey->isEmpty() ? $refDomain : "*") + ->addHeader('Access-Control-Allow-Origin', $refDomain) ->addHeader('Access-Control-Allow-Credentials', 'true'); + if (!$devKey->isEmpty()) { + $response->addHeader('Access-Control-Allow-Origin', '*'); + } + /* * Validate Client Domain - Check to avoid CSRF attack * Adding Appwrite API domains to allow XDOMAIN communication @@ -772,10 +776,14 @@ App::options() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Appwrite-Session, X-Fallback-Cookies, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $devKey->isEmpty() ? $origin : '*') + ->addHeader('Access-Control-Allow-Origin', $origin) ->addHeader('Access-Control-Allow-Credentials', 'true') ->noContent(); + if (!$devKey->isEmpty()) { + $response->addHeader('Access-Control-Allow-Origin', '*'); + } + /** OPTIONS requests in utopia do not execute shutdown handlers, as a result we need to track the OPTIONS requests explicitly * @see https://github.com/utopia-php/http/blob/0.33.16/src/App.php#L825-L855 */ diff --git a/app/init/resources.php b/app/init/resources.php index 270062e582..3a93419e11 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -800,7 +800,7 @@ App::setResource('devKey', function (Request $request, Document $project, array // update access time $accessedAt = $key->getAttribute('accessedAt', ''); - if (DatabaseDateTime::formatTz(DatabaseDateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { + 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)); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); @@ -808,9 +808,9 @@ App::setResource('devKey', function (Request $request, Document $project, array // add sdk to key $sdkValidator = new WhiteList($servers, true); - $sdk = $request->getHeader('x-sdk-name', 'UNKNOWN'); + $sdk = $request->getHeader('x-sdk-name', null); - if ($sdkValidator->isValid($sdk)) { + if ($sdk && $sdkValidator->isValid($sdk)) { $sdks = $key->getAttribute('sdks', []); if (!in_array($sdk, $sdks)) { diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index cce26a8de6..3adf26f816 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -66,10 +66,6 @@ class Delete extends Action throw new Exception(Exception::KEY_NOT_FOUND); } - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - $dbForPlatform->deleteDocument('devKeys', $key->getId()); $dbForPlatform->purgeCachedDocument('projects', $project->getId()); diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index e60d342b0b..157ccc8263 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -177,7 +177,7 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; - $desc = $desc ?? ''; + $desc ??= ''; $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index fae164f0a6..b6536df9df 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -173,7 +173,7 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; - $desc = $desc ?? ''; + $desc ??= ''; $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ From 76c7eb14ebeeecb8cd759ecdce13a82d69f06ac7 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Tue, 15 Apr 2025 12:08:18 +0000 Subject: [PATCH 146/169] chore: fix sdk fallback back to unknown --- app/controllers/shared/api.php | 2 +- app/init/resources.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 35a9499d28..14b8091724 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -250,7 +250,7 @@ App::init() $sdkValidator = new WhiteList($servers, true); $sdk = $request->getHeader('x-sdk-name', 'UNKNOWN'); - if ($sdkValidator->isValid($sdk)) { + if ($sdk !== 'UNKNOWN' && $sdkValidator->isValid($sdk)) { $sdks = $dbKey->getAttribute('sdks', []); if (!in_array($sdk, $sdks)) { diff --git a/app/init/resources.php b/app/init/resources.php index 3a93419e11..c8cd9aaf4f 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -808,9 +808,9 @@ App::setResource('devKey', function (Request $request, Document $project, array // add sdk to key $sdkValidator = new WhiteList($servers, true); - $sdk = $request->getHeader('x-sdk-name', null); + $sdk = $request->getHeader('x-sdk-name', 'UNKNOWN'); - if ($sdk && $sdkValidator->isValid($sdk)) { + if ($sdk !== 'UNKNOWN' && $sdkValidator->isValid($sdk)) { $sdks = $key->getAttribute('sdks', []); if (!in_array($sdk, $sdks)) { From 7172ccfc5b9f9973d70f6e6b8fca681f434fcea7 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 17 Apr 2025 06:25:42 +0000 Subject: [PATCH 147/169] chore: specs + formatting --- app/config/specs/open-api3-latest-client.json | 517 ++++++++++++- .../specs/open-api3-latest-console.json | 718 +++++++++++++++-- app/config/specs/open-api3-latest-server.json | 628 +++++++++++++-- app/config/specs/swagger2-latest-client.json | 518 ++++++++++++- app/config/specs/swagger2-latest-console.json | 726 ++++++++++++++++-- app/config/specs/swagger2-latest-server.json | 630 +++++++++++++-- app/init/resources.php | 2 +- 7 files changed, 3530 insertions(+), 209 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index e0b4e18e99..cc14cffacd 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -5545,7 +5545,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5627,7 +5627,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -7459,6 +7459,451 @@ } } } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } } }, "tags": [ @@ -7704,6 +8149,30 @@ "files" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -8900,6 +9369,50 @@ "chunksUploaded" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 53a8962172..ff447597c2 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -11080,6 +11080,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -13182,7 +13187,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13257,7 +13262,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13400,7 +13405,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13545,7 +13550,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -13718,7 +13723,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13895,7 +13900,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14003,7 +14008,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14114,7 +14119,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14166,7 +14171,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14227,7 +14232,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14301,7 +14306,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14375,7 +14380,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14450,7 +14455,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14554,7 +14559,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14661,7 +14666,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14745,7 +14750,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14832,7 +14837,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14946,7 +14951,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15063,7 +15068,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15157,7 +15162,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15254,7 +15259,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15358,7 +15363,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15465,7 +15470,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -15607,7 +15612,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15751,7 +15756,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15845,7 +15850,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15942,7 +15947,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16036,7 +16041,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16133,7 +16138,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16227,7 +16232,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16324,7 +16329,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16418,7 +16423,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16515,7 +16520,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -16567,7 +16572,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16628,7 +16633,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16702,7 +16707,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16776,7 +16781,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16849,7 +16854,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16931,7 +16936,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16990,7 +16995,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17066,7 +17071,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17127,7 +17132,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17201,7 +17206,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17284,7 +17289,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17373,7 +17378,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17435,7 +17440,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17509,7 +17514,7 @@ }, "x-appwrite": { "method": "list", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -17669,7 +17674,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17739,6 +17744,84 @@ ] } }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + } + } + } + }, "\/migrations\/firebase": { "post": { "summary": "Migrate Firebase data", @@ -17836,7 +17919,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18017,7 +18100,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18253,7 +18336,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18376,7 +18459,7 @@ }, "x-appwrite": { "method": "get", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18433,7 +18516,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18483,7 +18566,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -18712,6 +18795,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -19056,8 +19144,7 @@ "description": "Project Region.", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -26487,6 +26574,451 @@ } } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -30808,6 +31340,30 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -33591,6 +34147,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -35355,6 +35955,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -35372,6 +35977,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 7fd174b6e0..0612ca46a0 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -9946,6 +9946,11 @@ "type": "string", "description": "Variable value. Max length: 8192 chars.", "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "x-example": false } }, "required": [ @@ -12094,7 +12099,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12170,7 +12175,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12314,7 +12319,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12460,7 +12465,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12634,7 +12639,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -12812,7 +12817,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -12921,7 +12926,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13033,7 +13038,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13086,7 +13091,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13148,7 +13153,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13223,7 +13228,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13298,7 +13303,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13374,7 +13379,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13479,7 +13484,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -13587,7 +13592,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13672,7 +13677,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13760,7 +13765,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -13875,7 +13880,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13993,7 +13998,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14088,7 +14093,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14186,7 +14191,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14291,7 +14296,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14399,7 +14404,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14542,7 +14547,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14687,7 +14692,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -14782,7 +14787,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14880,7 +14885,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -14975,7 +14980,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15073,7 +15078,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15168,7 +15173,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15266,7 +15271,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15361,7 +15366,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15459,7 +15464,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15512,7 +15517,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -15574,7 +15579,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -15649,7 +15654,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -15724,7 +15729,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -15798,7 +15803,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -15881,7 +15886,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -15941,7 +15946,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16018,7 +16023,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16080,7 +16085,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16155,7 +16160,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16239,7 +16244,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16330,7 +16335,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16393,7 +16398,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -18711,6 +18716,463 @@ } } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -22285,6 +22747,30 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -24804,6 +25290,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -25549,6 +26079,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -25566,6 +26101,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 2ea4847792..a8f14d1261 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -5770,7 +5770,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -5854,7 +5854,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -7662,6 +7662,451 @@ } ] } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } } }, "tags": [ @@ -7879,6 +8324,31 @@ "files" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -9086,6 +9556,50 @@ "chunksUploaded" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 6e6b1317ee..72738a8d71 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -11258,6 +11258,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -13429,7 +13435,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -13503,7 +13509,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -13660,7 +13666,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -13814,7 +13820,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -14008,7 +14014,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -14201,7 +14207,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -14318,7 +14324,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -14433,7 +14439,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -14487,7 +14493,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -14548,7 +14554,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -14621,7 +14627,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -14694,7 +14700,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -14768,7 +14774,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14882,7 +14888,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -14994,7 +15000,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -15084,7 +15090,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15172,7 +15178,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -15298,7 +15304,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -15422,7 +15428,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -15524,7 +15530,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15624,7 +15630,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -15738,7 +15744,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -15850,7 +15856,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16008,7 +16014,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -16163,7 +16169,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16265,7 +16271,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -16365,7 +16371,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16467,7 +16473,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -16567,7 +16573,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16669,7 +16675,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -16769,7 +16775,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -16871,7 +16877,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -16971,7 +16977,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -17025,7 +17031,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -17086,7 +17092,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -17159,7 +17165,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -17232,7 +17238,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -17304,7 +17310,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -17393,7 +17399,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -17452,7 +17458,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -17530,7 +17536,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -17591,7 +17597,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -17664,7 +17670,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -17744,7 +17750,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -17833,7 +17839,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -17895,7 +17901,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -17967,7 +17973,7 @@ }, "x-appwrite": { "method": "list", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -18132,7 +18138,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -18195,6 +18201,89 @@ ] } }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "default": null, + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "default": null, + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + ] + } + }, "\/migrations\/firebase": { "post": { "summary": "Migrate Firebase data", @@ -18298,7 +18387,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -18488,7 +18577,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -18720,7 +18809,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -18832,7 +18921,7 @@ }, "x-appwrite": { "method": "get", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -18889,7 +18978,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -18941,7 +19030,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -19171,6 +19260,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -19522,8 +19617,7 @@ "default": "default", "x-example": "default", "enum": [ - "default", - "fra" + "default" ], "x-enum-name": null, "x-enum-keys": [] @@ -26962,6 +27056,451 @@ ] } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -31296,6 +31835,31 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -34112,6 +34676,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -35887,6 +36495,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -35904,6 +36517,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 7c65c89764..6a2aff6286 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -10127,6 +10127,12 @@ "description": "Variable value. Max length: 8192 chars.", "default": null, "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Is secret? Secret variables can only be updated or deleted, they cannot be read.", + "default": false, + "x-example": false } }, "required": [ @@ -12344,7 +12350,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -12419,7 +12425,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -12577,7 +12583,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -12732,7 +12738,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -12927,7 +12933,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -13121,7 +13127,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -13239,7 +13245,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -13355,7 +13361,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -13410,7 +13416,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13472,7 +13478,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -13546,7 +13552,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -13620,7 +13626,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13695,7 +13701,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13810,7 +13816,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -13923,7 +13929,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14014,7 +14020,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14103,7 +14109,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -14230,7 +14236,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14355,7 +14361,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -14458,7 +14464,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14559,7 +14565,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -14674,7 +14680,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14787,7 +14793,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -14946,7 +14952,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15102,7 +15108,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15205,7 +15211,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15306,7 +15312,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -15409,7 +15415,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -15510,7 +15516,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -15613,7 +15619,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15714,7 +15720,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -15817,7 +15823,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -15918,7 +15924,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -15973,7 +15979,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -16035,7 +16041,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -16109,7 +16115,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -16183,7 +16189,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -16256,7 +16262,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -16346,7 +16352,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -16406,7 +16412,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -16485,7 +16491,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -16547,7 +16553,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -16621,7 +16627,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -16702,7 +16708,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -16793,7 +16799,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -16856,7 +16862,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -19170,6 +19176,463 @@ ] } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -22768,6 +23231,31 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -25309,6 +25797,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -26058,6 +26590,11 @@ "description": "Variable value.", "x-example": "myPa$$word1" }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, "resourceType": { "type": "string", "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", @@ -26075,6 +26612,7 @@ "$updatedAt", "key", "value", + "secret", "resourceType", "resourceId" ] diff --git a/app/init/resources.php b/app/init/resources.php index 7f0d93aeaf..1be8d4f9f6 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -882,4 +882,4 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { } } return new Document([]); -}, ['project', 'dbForProject', 'request']); \ No newline at end of file +}, ['project', 'dbForProject', 'request']); From 04b6f62ac264ff6844c3600953cb7c6f693661cc Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 17 Apr 2025 07:21:33 +0000 Subject: [PATCH 148/169] chore: review changes --- app/config/errors.php | 12 ++++++++++++ app/config/specs/open-api3-latest-client.json | 2 +- app/config/specs/open-api3-latest-console.json | 2 +- app/config/specs/open-api3-latest-server.json | 2 +- app/config/specs/swagger2-latest-client.json | 2 +- app/config/specs/swagger2-latest-console.json | 2 +- app/config/specs/swagger2-latest-server.json | 2 +- src/Appwrite/Extend/Exception.php | 1 + .../Storage/Http/Tokens/Buckets/Files/Create.php | 2 +- .../Platform/Modules/Storage/Http/Tokens/JWT/Get.php | 6 ++++-- 10 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/config/errors.php b/app/config/errors.php index 7c7f6dc9ec..891ff9a21e 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -481,6 +481,18 @@ return [ 'code' => 403, ], + /** Tokens */ + Exception::TOKEN_NOT_FOUND => [ + 'name' => Exception::TOKEN_NOT_FOUND, + 'description' => 'The requested file token could not be found.', + 'code' => 404, + ], + Exception::TOKEN_EXPIRED => [ + 'name' => Exception::TOKEN_EXPIRED, + 'description' => 'The requested file token has expired.', + 'code' => 401, + ], + /** VCS */ Exception::INSTALLATION_NOT_FOUND => [ 'name' => Exception::INSTALLATION_NOT_FOUND, diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index cc14cffacd..e118576f39 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -7550,7 +7550,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "content": { "application\/json": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index ff447597c2..c08fea12b4 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -26664,7 +26664,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "content": { "application\/json": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 0612ca46a0..83b9a599d7 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -18808,7 +18808,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "content": { "application\/json": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index a8f14d1261..bb4297a6e1 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -7759,7 +7759,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "schema": { "$ref": "#\/definitions\/resourceToken" diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 72738a8d71..b79c13ffc7 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -27152,7 +27152,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "schema": { "$ref": "#\/definitions\/resourceToken" diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 6a2aff6286..a500a2595f 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -19274,7 +19274,7 @@ ], "description": "", "responses": { - "200": { + "201": { "description": "ResourceToken", "schema": { "$ref": "#\/definitions\/resourceToken" diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index d49a3c6ba3..4cbabafc65 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -305,6 +305,7 @@ class Exception extends \Exception /** Tokens */ public const TOKEN_NOT_FOUND = 'token_not_found'; + public const TOKEN_EXPIRED = 'token_expired'; protected string $type = ''; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index bf2b198890..515cfe4c7f 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -53,7 +53,7 @@ class Create extends Action auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( - code: Response::STATUS_CODE_OK, + code: Response::STATUS_CODE_CREATED, model: Response::MODEL_RESOURCE_TOKEN, ) ], diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php index ce9c26e8e6..7199baf5cb 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php @@ -69,14 +69,16 @@ class Get extends Action if ($expire != null) { $now = new \DateTime(); $expiryDate = new \DateTime($expire); + if ($expiryDate < $now) { + throw new Exception(Exception::TOKEN_EXPIRED); + } $maxAge = $expiryDate->getTimestamp() - $now->getTimestamp(); - ; } $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', $maxAge, 10); // Instantiate with key, algo, maxAge and leeway. $response - ->setStatusCode(Response::STATUS_CODE_CREATED) + ->setStatusCode(Response::STATUS_CODE_OK) ->dynamic(new Document(['jwt' => $jwt->encode([ 'resourceType' => $token->getAttribute('resourceType'), 'resourceId' => $token->getAttribute('resourceId'), From ba22e5f4572ee829d26cc3f7e4b47c6968fce06b Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Thu, 17 Apr 2025 07:38:29 +0000 Subject: [PATCH 149/169] chore: simplify action constructor --- .../Modules/Storage/Http/Tokens/Buckets/Files/Create.php | 2 +- .../Modules/Storage/Http/Tokens/Buckets/Files/XList.php | 2 +- src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php | 2 +- src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php | 2 +- src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php | 2 +- src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index 515cfe4c7f..ef12ece80d 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -67,7 +67,7 @@ class Create extends Action ->inject('dbForProject') ->inject('user') ->inject('queueForEvents') - ->callback(fn ($bucketId, $fileId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents) => $this->action($bucketId, $fileId, $expire, $permissions, $response, $dbForProject, $user, $queueForEvents)); + ->callback([$this, 'action']); } public function action(string $bucketId, string $fileId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Document $user, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php index c7746702fa..aa2637b1d1 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/XList.php @@ -54,7 +54,7 @@ class XList extends Action ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback(fn ($bucketId, $fileId, $queries, $response, $dbForProject) => $this->action($bucketId, $fileId, $queries, $response, $dbForProject)); + ->callback([$this, 'action']); } public function action(string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php index fe5387b862..bde45b8e1f 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Delete.php @@ -57,7 +57,7 @@ class Delete extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback(fn ($tokenId, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $response, $dbForProject, $queueForEvents)); + ->callback([$this, 'action']); } public function action(string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php index 2d585e222b..2d920a5ea9 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('tokenId', '', new UID(), 'Token ID.') ->inject('response') ->inject('dbForProject') - ->callback(fn ($tokenId, $response, $dbForProject) => $this->action($tokenId, $response, $dbForProject)); + ->callback([$this, 'action']); } public function action(string $tokenId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php index 7199baf5cb..e539cb1b9a 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php @@ -52,7 +52,7 @@ class Get extends Action ->param('tokenId', '', new UID(), 'File token ID.') ->inject('response') ->inject('dbForProject') - ->callback(fn ($tokenId, $response, $dbForProject) => $this->action($tokenId, $response, $dbForProject)); + ->callback([$this, 'action']); } public function action(string $tokenId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php index 81e53f6c9e..fbf9a40996 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Update.php @@ -66,7 +66,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback(fn ($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents) => $this->action($tokenId, $expire, $permissions, $response, $dbForProject, $queueForEvents)); + ->callback([$this, 'action']); } public function action(string $tokenId, ?string $expire, ?array $permissions, Response $response, Database $dbForProject, Event $queueForEvents) From b8ce3cb9fe8554331e06cb6b58eb6a87ce2a0929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Thu, 17 Apr 2025 15:57:47 +0200 Subject: [PATCH 150/169] Post-merge fixes --- app/config/specs/open-api3-latest-client.json | 6 +- .../specs/open-api3-latest-console.json | 603 ++++++++++++++++-- app/config/specs/open-api3-latest-server.json | 102 +-- app/config/specs/swagger2-latest-client.json | 6 +- app/config/specs/swagger2-latest-console.json | 601 +++++++++++++++-- app/config/specs/swagger2-latest-server.json | 102 +-- app/controllers/general.php | 8 - src/Appwrite/Platform/Appwrite.php | 2 +- src/Appwrite/Utopia/Response.php | 2 +- 9 files changed, 1186 insertions(+), 246 deletions(-) diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 6d50b1e06e..51fa03872f 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4763,7 +4763,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -4837,7 +4837,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -4951,7 +4951,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index a1f9e94f6c..bb75849441 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -4354,7 +4354,7 @@ }, "x-appwrite": { "method": "getResource", - "weight": 424, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -9051,7 +9051,7 @@ }, "x-appwrite": { "method": "list", - "weight": 368, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -9123,7 +9123,7 @@ }, "x-appwrite": { "method": "create", - "weight": 365, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -9353,7 +9353,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 370, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9401,7 +9401,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 371, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9450,7 +9450,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 394, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -9549,7 +9549,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 393, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -9608,7 +9608,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 387, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -9679,7 +9679,7 @@ }, "x-appwrite": { "method": "get", - "weight": 366, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -9737,7 +9737,7 @@ }, "x-appwrite": { "method": "update", - "weight": 367, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -9964,7 +9964,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 369, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -10024,7 +10024,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 374, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10103,7 +10103,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 375, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10185,7 +10185,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 372, + "weight": 377, "cookies": false, "type": "upload", "deprecated": false, @@ -10280,7 +10280,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 380, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10364,7 +10364,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 377, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10466,7 +10466,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 378, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10562,7 +10562,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 373, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10623,7 +10623,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 376, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -10686,7 +10686,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 379, + "weight": 384, "cookies": false, "type": "location", "deprecated": false, @@ -10775,7 +10775,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 381, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -10845,7 +10845,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -10919,7 +10919,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11033,7 +11033,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11097,7 +11097,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 385, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11167,7 +11167,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 386, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11248,7 +11248,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 390, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11306,7 +11306,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 388, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11396,7 +11396,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 389, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11464,7 +11464,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 391, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -11554,7 +11554,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 392, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -20708,6 +20708,389 @@ } } }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKeyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "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: accessedAt, expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, "\/projects\/{projectId}\/jwts": { "post": { "summary": "Create JWT", @@ -24194,7 +24577,7 @@ }, "x-appwrite": { "method": "createAPIRule", - "weight": 425, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -24260,7 +24643,7 @@ }, "x-appwrite": { "method": "createFunctionRule", - "weight": 427, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -24337,7 +24720,7 @@ }, "x-appwrite": { "method": "createRedirectRule", - "weight": 428, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -24428,7 +24811,7 @@ }, "x-appwrite": { "method": "createSiteRule", - "weight": 426, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -24673,7 +25056,7 @@ }, "x-appwrite": { "method": "list", - "weight": 397, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -24742,7 +25125,7 @@ }, "x-appwrite": { "method": "create", - "weight": 395, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -24987,7 +25370,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 400, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -25035,7 +25418,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 423, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -25084,7 +25467,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 419, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -25183,7 +25566,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 420, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -25242,7 +25625,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 421, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -25313,7 +25696,7 @@ }, "x-appwrite": { "method": "get", - "weight": 396, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -25371,7 +25754,7 @@ }, "x-appwrite": { "method": "update", - "weight": 398, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -25612,7 +25995,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 399, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -25672,7 +26055,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 406, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -25751,7 +26134,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 405, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -25833,7 +26216,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 401, + "weight": 406, "cookies": false, "type": "upload", "deprecated": false, @@ -25933,7 +26316,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 409, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -26012,7 +26395,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 402, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26114,7 +26497,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 403, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26211,7 +26594,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 404, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26272,7 +26655,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 407, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -26335,7 +26718,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 408, + "weight": 413, "cookies": false, "type": "location", "deprecated": false, @@ -26424,7 +26807,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 410, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -26494,7 +26877,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 412, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -26564,7 +26947,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 411, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -26625,7 +27008,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 413, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -26695,7 +27078,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 422, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -26776,7 +27159,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -26834,7 +27217,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -26924,7 +27307,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -26992,7 +27375,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27082,7 +27465,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -34331,6 +34714,30 @@ "keys" ] }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ] + }, "platformList": { "description": "Platforms List", "type": "object", @@ -38603,6 +39010,14 @@ }, "x-example": {} }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": {} + }, "smtpEnabled": { "type": "boolean", "description": "Status for custom SMTP", @@ -38786,6 +39201,7 @@ "platforms", "webhooks", "keys", + "devKeys", "smtpEnabled", "smtpSenderName", "smtpSenderEmail", @@ -38976,6 +39392,65 @@ "sdks" ] }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ] + }, "mockNumber": { "description": "Mock Number", "type": "object", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index df5948090b..ef67d12e0d 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -8136,7 +8136,7 @@ }, "x-appwrite": { "method": "list", - "weight": 368, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -8209,7 +8209,7 @@ }, "x-appwrite": { "method": "create", - "weight": 365, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -8440,7 +8440,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 370, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -8489,7 +8489,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 371, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -8539,7 +8539,7 @@ }, "x-appwrite": { "method": "get", - "weight": 366, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -8598,7 +8598,7 @@ }, "x-appwrite": { "method": "update", - "weight": 367, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -8826,7 +8826,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 369, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8887,7 +8887,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 374, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -8967,7 +8967,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 375, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9050,7 +9050,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 372, + "weight": 377, "cookies": false, "type": "upload", "deprecated": false, @@ -9146,7 +9146,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 380, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -9231,7 +9231,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 377, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -9334,7 +9334,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 378, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9431,7 +9431,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 373, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9493,7 +9493,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 376, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9557,7 +9557,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 379, + "weight": 384, "cookies": false, "type": "location", "deprecated": false, @@ -9647,7 +9647,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 381, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -9718,7 +9718,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9794,7 +9794,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9910,7 +9910,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -9976,7 +9976,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 385, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10047,7 +10047,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 390, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -10106,7 +10106,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 388, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10197,7 +10197,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 389, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10266,7 +10266,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 391, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10357,7 +10357,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 392, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -16691,7 +16691,7 @@ }, "x-appwrite": { "method": "list", - "weight": 397, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -16761,7 +16761,7 @@ }, "x-appwrite": { "method": "create", - "weight": 395, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -17007,7 +17007,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 400, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17056,7 +17056,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 423, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -17106,7 +17106,7 @@ }, "x-appwrite": { "method": "get", - "weight": 396, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -17165,7 +17165,7 @@ }, "x-appwrite": { "method": "update", - "weight": 398, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -17407,7 +17407,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 399, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17468,7 +17468,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 406, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -17548,7 +17548,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 405, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -17631,7 +17631,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 401, + "weight": 406, "cookies": false, "type": "upload", "deprecated": false, @@ -17732,7 +17732,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 409, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -17812,7 +17812,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 402, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -17915,7 +17915,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 403, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18013,7 +18013,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 404, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -18075,7 +18075,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 407, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18139,7 +18139,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 408, + "weight": 413, "cookies": false, "type": "location", "deprecated": false, @@ -18229,7 +18229,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 410, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18300,7 +18300,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 412, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -18371,7 +18371,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 411, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18433,7 +18433,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 413, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18504,7 +18504,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -18563,7 +18563,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18654,7 +18654,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -18723,7 +18723,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -18814,7 +18814,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 423, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index dc5600aa86..c156923114 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -4929,7 +4929,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -5002,7 +5002,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -5120,7 +5120,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 76f1152287..6456cc6451 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -4563,7 +4563,7 @@ }, "x-appwrite": { "method": "getResource", - "weight": 424, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -9200,7 +9200,7 @@ }, "x-appwrite": { "method": "list", - "weight": 368, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -9271,7 +9271,7 @@ }, "x-appwrite": { "method": "create", - "weight": 365, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -9521,7 +9521,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 370, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9571,7 +9571,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 371, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9622,7 +9622,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 394, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -9717,7 +9717,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 393, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -9776,7 +9776,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 387, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -9847,7 +9847,7 @@ }, "x-appwrite": { "method": "get", - "weight": 366, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -9905,7 +9905,7 @@ }, "x-appwrite": { "method": "update", - "weight": 367, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -10149,7 +10149,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 369, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -10209,7 +10209,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 374, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10287,7 +10287,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 375, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10366,7 +10366,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 372, + "weight": 377, "cookies": false, "type": "upload", "deprecated": false, @@ -10457,7 +10457,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 380, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10541,7 +10541,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 377, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10646,7 +10646,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 378, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10743,7 +10743,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 373, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10804,7 +10804,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 376, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -10872,7 +10872,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 379, + "weight": 384, "cookies": false, "type": "location", "deprecated": false, @@ -10957,7 +10957,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 381, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11025,7 +11025,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -11098,7 +11098,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11216,7 +11216,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11280,7 +11280,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 385, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11348,7 +11348,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 386, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11427,7 +11427,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 390, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11485,7 +11485,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 388, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11576,7 +11576,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 389, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11642,7 +11642,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 391, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -11733,7 +11733,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 392, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -21190,6 +21190,385 @@ ] } }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "schema": { + "$ref": "#\/definitions\/devKeyList" + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "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: accessedAt, expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "type": "string", + "x-example": "<KEY_ID>", + "in": "path" + } + ] + } + }, "\/projects\/{projectId}\/jwts": { "post": { "summary": "Create JWT", @@ -24676,7 +25055,7 @@ }, "x-appwrite": { "method": "createAPIRule", - "weight": 425, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -24745,7 +25124,7 @@ }, "x-appwrite": { "method": "createFunctionRule", - "weight": 427, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -24827,7 +25206,7 @@ }, "x-appwrite": { "method": "createRedirectRule", - "weight": 428, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -24923,7 +25302,7 @@ }, "x-appwrite": { "method": "createSiteRule", - "weight": 426, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -25175,7 +25554,7 @@ }, "x-appwrite": { "method": "list", - "weight": 397, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -25246,7 +25625,7 @@ }, "x-appwrite": { "method": "create", - "weight": 395, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -25511,7 +25890,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 400, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -25561,7 +25940,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 423, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -25612,7 +25991,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 419, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -25707,7 +26086,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 420, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -25766,7 +26145,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 421, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -25837,7 +26216,7 @@ }, "x-appwrite": { "method": "get", - "weight": 396, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -25895,7 +26274,7 @@ }, "x-appwrite": { "method": "update", - "weight": 398, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -26153,7 +26532,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 399, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -26213,7 +26592,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 406, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -26291,7 +26670,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 405, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -26370,7 +26749,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 401, + "weight": 406, "cookies": false, "type": "upload", "deprecated": false, @@ -26469,7 +26848,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 409, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -26547,7 +26926,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 402, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26652,7 +27031,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 403, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26750,7 +27129,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 404, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26811,7 +27190,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 407, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -26879,7 +27258,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 408, + "weight": 413, "cookies": false, "type": "location", "deprecated": false, @@ -26964,7 +27343,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 410, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -27032,7 +27411,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 412, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27104,7 +27483,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 411, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27167,7 +27546,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 413, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27235,7 +27614,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 422, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -27314,7 +27693,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27372,7 +27751,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27463,7 +27842,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27529,7 +27908,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27620,7 +27999,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -34894,6 +35273,31 @@ "keys" ] }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ] + }, "platformList": { "description": "Platforms List", "type": "object", @@ -39201,6 +39605,15 @@ }, "x-example": {} }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": {} + }, "smtpEnabled": { "type": "boolean", "description": "Status for custom SMTP", @@ -39384,6 +39797,7 @@ "platforms", "webhooks", "keys", + "devKeys", "smtpEnabled", "smtpSenderName", "smtpSenderEmail", @@ -39574,6 +39988,65 @@ "sdks" ] }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ] + }, "mockNumber": { "description": "Mock Number", "type": "object", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 41661b20ac..d1940fbcb0 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -8282,7 +8282,7 @@ }, "x-appwrite": { "method": "list", - "weight": 368, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -8354,7 +8354,7 @@ }, "x-appwrite": { "method": "create", - "weight": 365, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -8605,7 +8605,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 370, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -8656,7 +8656,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 371, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -8708,7 +8708,7 @@ }, "x-appwrite": { "method": "get", - "weight": 366, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -8767,7 +8767,7 @@ }, "x-appwrite": { "method": "update", - "weight": 367, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -9012,7 +9012,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 369, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9073,7 +9073,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 374, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9152,7 +9152,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 375, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9232,7 +9232,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 372, + "weight": 377, "cookies": false, "type": "upload", "deprecated": false, @@ -9324,7 +9324,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 380, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -9409,7 +9409,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 377, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -9515,7 +9515,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 378, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9613,7 +9613,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 373, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9675,7 +9675,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 376, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9744,7 +9744,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 379, + "weight": 384, "cookies": false, "type": "location", "deprecated": false, @@ -9830,7 +9830,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 381, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -9899,7 +9899,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 384, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9974,7 +9974,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 382, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -10094,7 +10094,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 383, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -10160,7 +10160,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 385, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10229,7 +10229,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 390, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -10288,7 +10288,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 388, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10380,7 +10380,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 389, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10447,7 +10447,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 391, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10539,7 +10539,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 392, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -17154,7 +17154,7 @@ }, "x-appwrite": { "method": "list", - "weight": 397, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -17226,7 +17226,7 @@ }, "x-appwrite": { "method": "create", - "weight": 395, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -17492,7 +17492,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 400, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17543,7 +17543,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 423, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -17595,7 +17595,7 @@ }, "x-appwrite": { "method": "get", - "weight": 396, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -17654,7 +17654,7 @@ }, "x-appwrite": { "method": "update", - "weight": 398, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -17913,7 +17913,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 399, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17974,7 +17974,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 406, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18053,7 +18053,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 405, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -18133,7 +18133,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 401, + "weight": 406, "cookies": false, "type": "upload", "deprecated": false, @@ -18233,7 +18233,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 409, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18312,7 +18312,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 402, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -18418,7 +18418,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 403, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18517,7 +18517,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 404, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -18579,7 +18579,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 407, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18648,7 +18648,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 408, + "weight": 413, "cookies": false, "type": "location", "deprecated": false, @@ -18734,7 +18734,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 410, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18803,7 +18803,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 412, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -18876,7 +18876,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 411, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18940,7 +18940,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 413, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -19009,7 +19009,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 416, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -19068,7 +19068,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 414, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -19160,7 +19160,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 415, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19227,7 +19227,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 417, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19319,7 +19319,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 418, + "weight": 423, "cookies": false, "type": "", "deprecated": false, diff --git a/app/controllers/general.php b/app/controllers/general.php index 511b4d5035..dbbe592cea 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -13,8 +13,6 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception as AppwriteException; use Appwrite\Network\Validator\Origin; use Appwrite\Platform\Appwrite; -use Appwrite\SDK\AuthType; -use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Transformation\Adapter\Preview; @@ -1565,9 +1563,3 @@ $platform->init(Service::TYPE_HTTP); if (!empty(Method::getErrors())) { throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); } - - -// Modules - -$platform = new Appwrite(); -$platform->init(Service::TYPE_HTTP); diff --git a/src/Appwrite/Platform/Appwrite.php b/src/Appwrite/Platform/Appwrite.php index 3bf54eaf30..9968dd22b5 100644 --- a/src/Appwrite/Platform/Appwrite.php +++ b/src/Appwrite/Platform/Appwrite.php @@ -4,8 +4,8 @@ namespace Appwrite\Platform; use Appwrite\Platform\Modules\Console; use Appwrite\Platform\Modules\Core; -use Appwrite\Platform\Modules\Projects; use Appwrite\Platform\Modules\Functions; +use Appwrite\Platform\Modules\Projects; use Appwrite\Platform\Modules\Proxy; use Appwrite\Platform\Modules\Sites; use Utopia\Platform\Platform; diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index a39bc1b86b..b3ecd0ce31 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -37,9 +37,9 @@ use Appwrite\Utopia\Response\Model\Country; use Appwrite\Utopia\Response\Model\Currency; use Appwrite\Utopia\Response\Model\Database; use Appwrite\Utopia\Response\Model\Deployment; -use Appwrite\Utopia\Response\Model\DevKey; use Appwrite\Utopia\Response\Model\DetectionFramework; use Appwrite\Utopia\Response\Model\DetectionRuntime; +use Appwrite\Utopia\Response\Model\DevKey; use Appwrite\Utopia\Response\Model\Document as ModelDocument; use Appwrite\Utopia\Response\Model\Error; use Appwrite\Utopia\Response\Model\ErrorDev; From f8343e01cdb9f2a883959d5e80496db888dc8093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Thu, 17 Apr 2025 16:13:09 +0200 Subject: [PATCH 151/169] PR review suggestions --- app/controllers/general.php | 2 +- app/controllers/shared/api.php | 8 ++++---- app/init/resources.php | 2 +- .../Platform/Modules/Projects/Http/DevKeys/Get.php | 4 ---- src/Appwrite/Platform/Tasks/ScheduleBase.php | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index dbbe592cea..88fa94c097 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -106,7 +106,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ); if (!$project->isEmpty() && $project->getId() !== 'console') { - $accessedAt = $project->getAttribute('accessedAt', ''); + $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)); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 3897d78a9a..b24d452b9b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -250,7 +250,7 @@ App::init() ); if ($dbKey) { - $accessedAt = $dbKey->getAttribute('accessedAt', ''); + $accessedAt = $dbKey->getAttribute('accessedAt', 0); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_KEY_ACCESS)) > $accessedAt) { $dbKey->setAttribute('accessedAt', DateTime::now()); @@ -311,7 +311,7 @@ App::init() // Update project last activity if (!$project->isEmpty() && $project->getId() !== 'console') { - $accessedAt = $project->getAttribute('accessedAt', ''); + $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)); @@ -320,7 +320,7 @@ App::init() // Update user last activity if (!empty($user->getId())) { - $accessedAt = $user->getAttribute('accessedAt', ''); + $accessedAt = $user->getAttribute('accessedAt', 0); if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_USER_ACCESS)) > $accessedAt) { $user->setAttribute('accessedAt', DateTime::now()); @@ -800,7 +800,7 @@ App::shutdown() $key = md5($request->getURI() . '*' . implode('*', $request->getParams()) . '*' . APP_CACHE_BUSTER); $signature = md5($data['payload']); $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); - $accessedAt = $cacheLog->getAttribute('accessedAt', ''); + $accessedAt = $cacheLog->getAttribute('accessedAt', 0); $now = DateTime::now(); if ($cacheLog->isEmpty()) { Authorization::skip(fn () => $dbForProject->createDocument('cache', new Document([ diff --git a/app/init/resources.php b/app/init/resources.php index 25659ed545..da013cd2ce 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -807,7 +807,7 @@ App::setResource('devKey', function (Request $request, Document $project, array } // update access time - $accessedAt = $key->getAttribute('accessedAt', ''); + $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)); diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index ebc0c1bcbb..c933c5be93 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -66,10 +66,6 @@ class Get extends Action throw new Exception(Exception::KEY_NOT_FOUND); } - if ($key === false || $key->isEmpty()) { - throw new Exception(Exception::KEY_NOT_FOUND); - } - $response->dynamic($key, Response::MODEL_DEV_KEY); } } diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 303e03cb8c..88f98fa76a 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -43,7 +43,7 @@ abstract class ScheduleBase extends Action protected function updateProjectAccess(Document $project, Database $dbForPlatform): void { if (!$project->isEmpty() && $project->getId() !== 'console') { - $accessedAt = $project->getAttribute('accessedAt', ''); + $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)); From deac241e683db9b8418a85c362d58fdf8491014e Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Thu, 17 Apr 2025 20:25:11 +0530 Subject: [PATCH 152/169] Create new file for benchmarking workflow --- .github/workflows/benchmark.yml | 127 ++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 83 +-------------------- 2 files changed, 128 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000000..bec6ada58b --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,127 @@ +name: "Benchmark" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + IMAGE: appwrite-dev + CACHE_KEY: appwrite-dev-${{ github.event.pull_request.head.sha }} + +on: [ pull_request ] + +jobs: + setup: + name: Setup & Build Appwrite Image + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Appwrite + uses: docker/build-push-action@v3 + with: + context: . + push: false + tags: ${{ env.IMAGE }} + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar + build-args: | + DEBUG=false + TESTING=true + VERSION=dev + + - name: Cache Docker Image + uses: actions/cache@v3 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + + benchmarking: + name: Benchmark + runs-on: ubuntu-latest + needs: setup + permissions: + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + - name: Load and Start Appwrite + run: | + sed -i 's/traefik/localhost/g' .env + docker load --input /tmp/${{ env.IMAGE }}.tar + docker compose up -d + sleep 10 + - name: Install Oha + run: | + echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list + sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg + sudo apt update + sudo apt install oha + - name: Benchmark PR + run: oha -z 180s http://localhost/v1/health/version -j > benchmark.json + - name: Cleaning + run: docker compose down -v + - name: Installing latest version + run: | + rm docker-compose.yml + rm .env + curl https://appwrite.io/install/compose -o docker-compose.yml + curl https://appwrite.io/install/env -o .env + sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env + docker compose up -d + sleep 10 + - name: Benchmark Latest + run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json + - name: Prepare comment + run: | + echo '## :sparkles: Benchmark results' > benchmark.txt + echo ' ' >> benchmark.txt + echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt + echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt + echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt + echo " " >> benchmark.txt + echo " " >> benchmark.txt + echo "## :zap: Benchmark Comparison" >> benchmark.txt + echo " " >> benchmark.txt + echo "| Metric | This PR | Latest version | " >> benchmark.txt + echo "| --- | --- | --- | " >> benchmark.txt + echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt + echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt + echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt + - name: Save results + uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: benchmark.json + path: benchmark.json + retention-days: 7 + - name: Find Comment + if: github.event.pull_request.head.repo.full_name == github.repository + uses: peter-evans/find-comment@v3 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: Benchmark results + - name: Comment on PR + if: github.event.pull_request.head.repo.full_name == github.repository + uses: peter-evans/create-or-update-comment@v4 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-path: benchmark.txt + edit-mode: replace \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 645d5cb560..2ea0dec842 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -276,85 +276,4 @@ jobs: -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug - - benchmarking: - name: Benchmark - runs-on: ubuntu-latest - needs: setup - permissions: - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Load Cache - uses: actions/cache@v4 - with: - key: ${{ env.CACHE_KEY }} - path: /tmp/${{ env.IMAGE }}.tar - fail-on-cache-miss: true - - name: Load and Start Appwrite - run: | - sed -i 's/traefik/localhost/g' .env - docker load --input /tmp/${{ env.IMAGE }}.tar - docker compose up -d - sleep 10 - - name: Install Oha - run: | - echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list - sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg - sudo apt update - sudo apt install oha - - name: Benchmark PR - run: oha -z 180s http://localhost/v1/health/version -j > benchmark.json - - name: Cleaning - run: docker compose down -v - - name: Installing latest version - run: | - rm docker-compose.yml - rm .env - curl https://appwrite.io/install/compose -o docker-compose.yml - curl https://appwrite.io/install/env -o .env - sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env - docker compose up -d - sleep 10 - - name: Benchmark Latest - run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json - - name: Prepare comment - run: | - echo '## :sparkles: Benchmark results' > benchmark.txt - echo ' ' >> benchmark.txt - echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt - echo " " >> benchmark.txt - echo " " >> benchmark.txt - echo "## :zap: Benchmark Comparison" >> benchmark.txt - echo " " >> benchmark.txt - echo "| Metric | This PR | Latest version | " >> benchmark.txt - echo "| --- | --- | --- | " >> benchmark.txt - echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt - - name: Save results - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: benchmark.json - path: benchmark.json - retention-days: 7 - - name: Find Comment - if: github.event.pull_request.head.repo.full_name == github.repository - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Benchmark results - - name: Comment on PR - if: github.event.pull_request.head.repo.full_name == github.repository - uses: peter-evans/create-or-update-comment@v4 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body-path: benchmark.txt - edit-mode: replace + From 816c3a1401d8553cba13f7ff8350f2f992008371 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Thu, 17 Apr 2025 20:31:08 +0530 Subject: [PATCH 153/169] Fix version --- .github/workflows/benchmark.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index bec6ada58b..353448d354 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -16,15 +16,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build Appwrite - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v6 with: context: . push: false @@ -39,7 +39,7 @@ jobs: VERSION=dev - name: Cache Docker Image - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: ${{ env.CACHE_KEY }} path: /tmp/${{ env.IMAGE }}.tar From fe287044a7cb86c42ea2cc8ec1793b6d7d299340 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Thu, 17 Apr 2025 20:45:53 +0530 Subject: [PATCH 154/169] Format benchmark.yml --- .github/workflows/benchmark.yml | 116 +++++++++++++++++++++----------- .github/workflows/tests.yml | 1 - 2 files changed, 76 insertions(+), 41 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 353448d354..88aa112db4 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,15 +1,12 @@ -name: "Benchmark" - +name: Benchmark concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: '${{ github.workflow }}-${{ github.ref }}' cancel-in-progress: true - env: IMAGE: appwrite-dev - CACHE_KEY: appwrite-dev-${{ github.event.pull_request.head.sha }} - -on: [ pull_request ] - + CACHE_KEY: 'appwrite-dev-${{ github.event.pull_request.head.sha }}' +'on': + - pull_request jobs: setup: name: Setup & Build Appwrite Image @@ -19,31 +16,27 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build Appwrite uses: docker/build-push-action@v6 with: context: . push: false - tags: ${{ env.IMAGE }} + tags: '${{ env.IMAGE }}' load: true cache-from: type=gha - cache-to: type=gha,mode=max - outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar + cache-to: 'type=gha,mode=max' + outputs: 'type=docker,dest=/tmp/${{ env.IMAGE }}.tar' build-args: | DEBUG=false TESTING=true VERSION=dev - - name: Cache Docker Image uses: actions/cache@v4 with: - key: ${{ env.CACHE_KEY }} - path: /tmp/${{ env.IMAGE }}.tar - + key: '${{ env.CACHE_KEY }}' + path: '/tmp/${{ env.IMAGE }}.tar' benchmarking: name: Benchmark runs-on: ubuntu-latest @@ -56,55 +49,98 @@ jobs: - name: Load Cache uses: actions/cache@v4 with: - key: ${{ env.CACHE_KEY }} - path: /tmp/${{ env.IMAGE }}.tar + key: '${{ env.CACHE_KEY }}' + path: '/tmp/${{ env.IMAGE }}.tar' fail-on-cache-miss: true - name: Load and Start Appwrite run: | - sed -i 's/traefik/localhost/g' .env - docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/traefik/localhost/g' .env + docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 10 - name: Install Oha - run: | - echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list - sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg + run: > + echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] + http://packages.azlux.fr/debian/ stable main" | sudo tee + /etc/apt/sources.list.d/azlux.list + + sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg + https://azlux.fr/repo.gpg + sudo apt update + sudo apt install oha - name: Benchmark PR - run: oha -z 180s http://localhost/v1/health/version -j > benchmark.json + run: 'oha -z 180s http://localhost/v1/health/version -j > benchmark.json' - name: Cleaning run: docker compose down -v - name: Installing latest version - run: | + run: > rm docker-compose.yml + rm .env + curl https://appwrite.io/install/compose -o docker-compose.yml + curl https://appwrite.io/install/env -o .env - sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env + + sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' + .env + docker compose up -d + sleep 10 - name: Benchmark Latest - run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json + run: >- + oha -z 180s http://localhost/v1/health/version -j > + benchmark-latest.json - name: Prepare comment - run: | + run: > echo '## :sparkles: Benchmark results' > benchmark.txt + echo ' ' >> benchmark.txt - echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt + + echo "- Requests per second: $(jq -r + '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark.json)" >> benchmark.txt + + echo "- Requests with 200 status code: $(jq -r + '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark.json)" >> benchmark.txt + + echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json + )" >> benchmark.txt + echo " " >> benchmark.txt + echo " " >> benchmark.txt + echo "## :zap: Benchmark Comparison" >> benchmark.txt + echo " " >> benchmark.txt + echo "| Metric | This PR | Latest version | " >> benchmark.txt + echo "| --- | --- | --- | " >> benchmark.txt - echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt + + echo "| RPS | $(jq -r + '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark.json) | $(jq -r + '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark-latest.json) | " >> benchmark.txt + + echo "| 200 | $(jq -r + '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark.json) | $(jq -r + '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' + benchmark-latest.json) | " >> benchmark.txt + + echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | + $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> + benchmark.txt - name: Save results uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} + if: '${{ !cancelled() }}' with: name: benchmark.json path: benchmark.json @@ -114,14 +150,14 @@ jobs: uses: peter-evans/find-comment@v3 id: fc with: - issue-number: ${{ github.event.pull_request.number }} + issue-number: '${{ github.event.pull_request.number }}' comment-author: 'github-actions[bot]' body-includes: Benchmark results - name: Comment on PR if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/create-or-update-comment@v4 with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} + comment-id: '${{ steps.fc.outputs.comment-id }}' + issue-number: '${{ github.event.pull_request.number }}' body-path: benchmark.txt - edit-mode: replace \ No newline at end of file + edit-mode: replace diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ea0dec842..ebf341589d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -276,4 +276,3 @@ jobs: -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug - From d130e7d3bd73220cddb4ddcff8aaa37d2d8a9369 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Fri, 18 Apr 2025 15:32:25 +0000 Subject: [PATCH 155/169] chore: add stricter checks according to review --- app/controllers/api/storage.php | 2 +- app/controllers/shared/api.php | 2 +- app/init/resources.php | 4 ++-- .../Storage/Http/Tokens/Buckets/Files/Create.php | 11 ++++++----- .../Platform/Modules/Storage/Http/Tokens/JWT/Get.php | 2 +- src/Appwrite/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/Specification/Format/Swagger2.php | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 541a0b42d3..95927b380a 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -954,7 +954,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') == $bucket->getInternalId(); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 5dd9966cb2..0f4ef70a0b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -542,7 +542,7 @@ App::init() $bucketId = $parts[1] ?? null; $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') == $bucket->getInternalId(); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); diff --git a/app/init/resources.php b/app/init/resources.php index 1be8d4f9f6..a5949bc9e5 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -861,7 +861,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { $token = Authorization::skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId)); - if ($token->isEmpty() || $token->getAttribute('secret') != $secret) { + if ($token->isEmpty() || $token->getAttribute('secret') !== $secret) { return new Document([]); } @@ -869,7 +869,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { $internalIds = explode(':', $token->getAttribute('resourceInternalId')); $ids = explode(':', $token->getAttribute('resourceId')); - if (count($internalIds) != 2 || count($ids) != 2) { + if (count($internalIds) !== 2 || count($ids) !== 2) { return new Document([]); } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php index ef12ece80d..76e161e101 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Create.php @@ -82,12 +82,13 @@ class Create extends Action $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_UPDATE); $bucketPermission = $validator->isValid($bucket->getUpdate()); - if (!$fileSecurity && !$bucketPermission) { - throw new Exception(Exception::USER_UNAUTHORIZED); - } - $filePermission = $validator->isValid($file->getUpdate()); - if ($fileSecurity && !$bucketPermission && !$filePermission) { + if ($fileSecurity) { + $filePermission = $validator->isValid($file->getUpdate()); + if (!$bucketPermission && !$filePermission) { + throw new Exception(Exception::USER_UNAUTHORIZED); + } + } elseif (!$bucketPermission) { throw new Exception(Exception::USER_UNAUTHORIZED); } diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php index e539cb1b9a..f209908878 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/JWT/Get.php @@ -66,7 +66,7 @@ class Get extends Action // calculate maxAge based on expiry date $maxAge = PHP_INT_MAX; $expire = $token->getAttribute('expire'); - if ($expire != null) { + if ($expire !== null) { $now = new \DateTime(); $expiryDate = new \DateTime($expire); if ($expiryDate < $now) { diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index e60d342b0b..157ccc8263 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -177,7 +177,7 @@ class OpenAPI3 extends Format $namespace = $sdk->getNamespace() ?? 'default'; - $desc = $desc ?? ''; + $desc ??= ''; $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index fae164f0a6..b6536df9df 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -173,7 +173,7 @@ class Swagger2 extends Format $namespace = $sdk->getNamespace() ?? 'default'; - $desc = $desc ?? ''; + $desc ??= ''; $descContents = \str_ends_with($desc, '.md') ? \file_get_contents($desc) : $desc; $temp = [ From 421bfed8b7973c0cf13856c91d1369d8a7ae8b92 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Fri, 18 Apr 2025 16:06:02 +0000 Subject: [PATCH 156/169] chore: regenerate specs --- .coderabbit.yaml | 3 +- app/config/specs/open-api3-1.7.x-client.json | 529 ++++- app/config/specs/open-api3-1.7.x-console.json | 1591 ++++++++++--- app/config/specs/open-api3-1.7.x-server.json | 823 +++++-- app/config/specs/open-api3-latest-client.json | 24 +- .../specs/open-api3-latest-console.json | 24 +- app/config/specs/open-api3-latest-server.json | 24 +- app/config/specs/swagger2-1.7.x-client.json | 530 ++++- app/config/specs/swagger2-1.7.x-console.json | 1635 +++++++++++--- app/config/specs/swagger2-1.7.x-server.json | 828 +++++-- app/config/specs/swagger2-latest-client.json | 24 +- app/config/specs/swagger2-latest-console.json | 1964 ++++++++++++++++- app/config/specs/swagger2-latest-server.json | 24 +- app/controllers/general.php | 6 +- 14 files changed, 6978 insertions(+), 1051 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 0b8534b7c9..39fac266fd 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -3,5 +3,4 @@ reviews: base_branches: - main - 1.6.x - - 1.7.x - - feat-sites # temporary until merged to 1.7.x \ No newline at end of file + - 1.7.x \ No newline at end of file diff --git a/app/config/specs/open-api3-1.7.x-client.json b/app/config/specs/open-api3-1.7.x-client.json index b50c4ebf4c..1be340b5ec 100644 --- a/app/config/specs/open-api3-1.7.x-client.json +++ b/app/config/specs/open-api3-1.7.x-client.json @@ -4748,7 +4748,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -4763,7 +4763,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -4822,7 +4822,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -4837,7 +4837,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -4936,7 +4936,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -4951,7 +4951,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -5534,7 +5534,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -5616,7 +5616,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -7448,6 +7448,451 @@ } } } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } } }, "tags": [ @@ -7698,6 +8143,30 @@ "files" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -8894,6 +9363,50 @@ "chunksUploaded" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/open-api3-1.7.x-console.json b/app/config/specs/open-api3-1.7.x-console.json index 019047436a..6c999d047a 100644 --- a/app/config/specs/open-api3-1.7.x-console.json +++ b/app/config/specs/open-api3-1.7.x-console.json @@ -4346,7 +4346,7 @@ "tags": [ "console" ], - "description": "", + "description": "Check if a resource ID is available.", "responses": { "204": { "description": "No content" @@ -4354,7 +4354,7 @@ }, "x-appwrite": { "method": "getResource", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -9036,7 +9036,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", "responses": { "200": { "description": "Functions List", @@ -9051,7 +9051,7 @@ }, "x-appwrite": { "method": "list", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -9108,7 +9108,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "responses": { "201": { "description": "Function", @@ -9123,7 +9123,7 @@ }, "x-appwrite": { "method": "create", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -9338,7 +9338,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all runtimes that are currently active on your instance.", "responses": { "200": { "description": "Runtimes List", @@ -9353,7 +9353,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -9386,7 +9386,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List allowed function specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -9401,7 +9401,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -9435,7 +9435,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "responses": { "200": { "description": "Function Templates List", @@ -9450,7 +9450,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -9534,7 +9534,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "responses": { "200": { "description": "Template Function", @@ -9549,7 +9549,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -9593,7 +9593,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -9608,7 +9608,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9664,7 +9664,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function by its unique ID.", "responses": { "200": { "description": "Function", @@ -9679,7 +9679,7 @@ }, "x-appwrite": { "method": "get", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -9722,7 +9722,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update function by its unique ID.", "responses": { "200": { "description": "Function", @@ -9737,7 +9737,7 @@ }, "x-appwrite": { "method": "update", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -9956,7 +9956,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function by its unique ID.", "responses": { "204": { "description": "No content" @@ -9964,7 +9964,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -10009,7 +10009,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "responses": { "200": { "description": "Function", @@ -10024,7 +10024,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -10088,7 +10088,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -10103,7 +10103,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10170,7 +10170,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10185,7 +10185,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 371, + "weight": 372, "cookies": false, "type": "upload", "deprecated": false, @@ -10265,7 +10265,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -10280,7 +10280,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10349,7 +10349,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -10364,7 +10364,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -10451,7 +10451,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -10466,7 +10466,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10547,7 +10547,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -10562,7 +10562,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -10615,7 +10615,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a code deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -10623,7 +10623,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10678,7 +10678,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File" @@ -10686,7 +10686,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 378, + "weight": 379, "cookies": false, "type": "location", "deprecated": false, @@ -10760,7 +10760,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -10775,7 +10775,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -10830,7 +10830,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -10845,7 +10845,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10904,7 +10904,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -10919,7 +10919,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11018,7 +11018,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -11033,7 +11033,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -11089,7 +11089,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function execution by its unique ID.", "responses": { "204": { "description": "No content" @@ -11097,7 +11097,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11152,7 +11152,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11167,7 +11167,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11233,7 +11233,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all variables of a specific function.", "responses": { "200": { "description": "Variables List", @@ -11248,7 +11248,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11291,7 +11291,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "responses": { "201": { "description": "Variable", @@ -11306,7 +11306,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11381,7 +11381,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -11396,7 +11396,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -11449,7 +11449,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -11464,7 +11464,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11546,7 +11546,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -11554,7 +11554,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13469,7 +13469,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13544,7 +13544,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -13687,7 +13687,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13832,7 +13832,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14005,7 +14005,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14182,7 +14182,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14290,7 +14290,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14401,7 +14401,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14453,7 +14453,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14514,7 +14514,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14588,7 +14588,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14662,7 +14662,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -14737,7 +14737,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -14841,7 +14841,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -14948,7 +14948,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15032,7 +15032,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15119,7 +15119,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -15233,7 +15233,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15350,7 +15350,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -15444,7 +15444,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -15541,7 +15541,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -15645,7 +15645,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15752,7 +15752,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -15894,7 +15894,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16038,7 +16038,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -16132,7 +16132,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16229,7 +16229,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16323,7 +16323,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16420,7 +16420,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16514,7 +16514,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16611,7 +16611,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16705,7 +16705,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16802,7 +16802,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -16854,7 +16854,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16915,7 +16915,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16989,7 +16989,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17063,7 +17063,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -17136,7 +17136,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17218,7 +17218,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17277,7 +17277,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17353,7 +17353,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17414,7 +17414,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -17488,7 +17488,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17571,7 +17571,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17660,7 +17660,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17722,7 +17722,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17796,7 +17796,7 @@ }, "x-appwrite": { "method": "list", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -17956,7 +17956,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -18026,6 +18026,84 @@ ] } }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "weight": 310, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + } + } + } + }, "\/migrations\/firebase": { "post": { "summary": "Migrate Firebase data", @@ -18123,7 +18201,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18304,7 +18382,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -18540,7 +18618,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18663,7 +18741,7 @@ }, "x-appwrite": { "method": "get", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -18720,7 +18798,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -18770,7 +18848,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24101,7 +24179,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", "responses": { "201": { "description": "Rule", @@ -24116,7 +24194,7 @@ }, "x-appwrite": { "method": "createAPIRule", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -24167,7 +24245,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", "responses": { "201": { "description": "Rule", @@ -24182,7 +24260,7 @@ }, "x-appwrite": { "method": "createFunctionRule", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -24244,7 +24322,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", "responses": { "201": { "description": "Rule", @@ -24259,7 +24337,7 @@ }, "x-appwrite": { "method": "createRedirectRule", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -24335,7 +24413,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", "responses": { "201": { "description": "Rule", @@ -24350,7 +24428,7 @@ }, "x-appwrite": { "method": "createSiteRule", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -24580,7 +24658,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", "responses": { "200": { "description": "Sites List", @@ -24595,7 +24673,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -24649,7 +24727,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site.", "responses": { "201": { "description": "Site", @@ -24664,7 +24742,7 @@ }, "x-appwrite": { "method": "create", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -24894,7 +24972,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all frameworks that are currently available on the server instance.", "responses": { "200": { "description": "Frameworks List", @@ -24909,7 +24987,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -24942,7 +25020,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List allowed site specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -24957,7 +25035,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -24991,7 +25069,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "responses": { "200": { "description": "Site Templates List", @@ -25006,7 +25084,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -25090,7 +25168,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "responses": { "200": { "description": "Template Site", @@ -25105,7 +25183,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -25149,7 +25227,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageSites", @@ -25164,7 +25242,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -25220,7 +25298,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site by its unique ID.", "responses": { "200": { "description": "Site", @@ -25235,7 +25313,7 @@ }, "x-appwrite": { "method": "get", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -25278,7 +25356,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update site by its unique ID.", "responses": { "200": { "description": "Site", @@ -25293,7 +25371,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -25526,7 +25604,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site by its unique ID.", "responses": { "204": { "description": "No content" @@ -25534,7 +25612,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -25579,7 +25657,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "responses": { "200": { "description": "Site", @@ -25594,7 +25672,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -25658,7 +25736,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -25673,7 +25751,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -25740,7 +25818,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "responses": { "202": { "description": "Deployment", @@ -25755,7 +25833,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 400, + "weight": 401, "cookies": false, "type": "upload", "deprecated": false, @@ -25840,7 +25918,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -25855,7 +25933,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -25914,12 +25992,12 @@ }, "\/sites\/{siteId}\/deployments\/template": { "post": { - "summary": "Create deployment", + "summary": "Create template deployment", "operationId": "sitesCreateTemplateDeployment", "tags": [ "sites" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -25934,7 +26012,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -26021,7 +26099,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -26036,7 +26114,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -26118,7 +26196,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -26133,7 +26211,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -26186,7 +26264,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -26194,7 +26272,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26249,7 +26327,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File" @@ -26257,7 +26335,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 407, + "weight": 408, "cookies": false, "type": "location", "deprecated": false, @@ -26331,7 +26409,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -26346,7 +26424,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 409, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -26401,7 +26479,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all site logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -26416,7 +26494,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -26471,7 +26549,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site request log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -26486,7 +26564,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -26539,7 +26617,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site log by its unique ID.", "responses": { "204": { "description": "No content" @@ -26547,7 +26625,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -26602,7 +26680,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageSite", @@ -26617,7 +26695,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -26683,7 +26761,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all variables of a specific site.", "responses": { "200": { "description": "Variables List", @@ -26698,7 +26776,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -26741,7 +26819,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "responses": { "201": { "description": "Variable", @@ -26756,7 +26834,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -26831,7 +26909,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -26846,7 +26924,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -26899,7 +26977,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -26914,7 +26992,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 416, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -26996,7 +27074,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -27004,7 +27082,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -29493,6 +29571,451 @@ } } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -33845,6 +34368,30 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -36724,6 +37271,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -39911,6 +40502,18 @@ }, "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.", @@ -39966,6 +40569,22 @@ "$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": [] } }, "required": [ @@ -39983,13 +40602,17 @@ "functions", "deployments", "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", "builds", "buildsStorage", "buildsTime", "buildsMbSeconds", "executions", "executionsTime", - "executionsMbSeconds" + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" ] }, "usageFunction": { @@ -40019,6 +40642,18 @@ "x-example": 0, "format": "int32" }, + "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" + }, "buildsStorageTotal": { "type": "integer", "description": "total aggregated sum of function builds storage.", @@ -40031,6 +40666,12 @@ "x-example": 0, "format": "int32" }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, "buildsMbSecondsTotal": { "type": "integer", "description": "Total aggregated sum of function builds mbSeconds.", @@ -40126,6 +40767,269 @@ "$ref": "#\/components\/schemas\/metric" }, "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "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.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] } }, "required": [ @@ -40141,139 +41045,25 @@ "executionsMbSecondsTotal", "deployments", "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", "builds", "buildsStorage", "buildsTime", "buildsMbSeconds", "executions", "executionsTime", - "executionsMbSeconds" - ] - }, - "usageSites": { - "description": "UsageSites", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "Time range of the usage stats.", - "x-example": "30d" - }, - "sitesTotal": { - "type": "integer", - "description": "Total aggregated number of sites.", - "x-example": 0, - "format": "int32" - }, - "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" - }, - "sites": { - "type": "array", - "description": "Aggregated number of sites per period.", - "items": { - "$ref": "#\/components\/schemas\/metric" - }, - "x-example": 0 - }, - "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": [] - }, - "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": [] - } - }, - "required": [ - "range", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", "sitesTotal", - "deploymentsTotal", - "deploymentsStorageTotal", - "buildsTotal", - "buildsStorageTotal", - "buildsTimeTotal", - "buildsMbSecondsTotal", "sites", - "deployments", - "deploymentsStorage", - "builds", - "buildsStorage", - "buildsTime", - "buildsMbSeconds" + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" ] }, "usageSite": { @@ -40287,43 +41077,79 @@ }, "deploymentsTotal": { "type": "integer", - "description": "Total aggregated number of site deployments.", + "description": "Total aggregated number of function deployments.", "x-example": 0, "format": "int32" }, "deploymentsStorageTotal": { "type": "integer", - "description": "Total aggregated sum of site deployments storage.", + "description": "Total aggregated sum of function deployments storage.", "x-example": 0, "format": "int32" }, "buildsTotal": { "type": "integer", - "description": "Total aggregated number of site builds.", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "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" }, "buildsStorageTotal": { "type": "integer", - "description": "total aggregated sum of site builds storage.", + "description": "total aggregated sum of function builds storage.", "x-example": 0, "format": "int32" }, "buildsTimeTotal": { "type": "integer", - "description": "Total aggregated sum of site builds compute time.", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", "x-example": 0, "format": "int32" }, "buildsMbSecondsTotal": { "type": "integer", - "description": "Total aggregated sum of site builds mbSeconds.", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", "x-example": 0, "format": "int32" }, "deployments": { "type": "array", - "description": "Aggregated number of site deployments per period.", + "description": "Aggregated number of function deployments per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40331,7 +41157,7 @@ }, "deploymentsStorage": { "type": "array", - "description": "Aggregated number of site deployments storage per period.", + "description": "Aggregated number of function deployments storage per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40339,7 +41165,7 @@ }, "builds": { "type": "array", - "description": "Aggregated number of site builds per period.", + "description": "Aggregated number of function builds per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40347,7 +41173,7 @@ }, "buildsStorage": { "type": "array", - "description": "Aggregated sum of site builds storage per period.", + "description": "Aggregated sum of function builds storage per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40355,7 +41181,7 @@ }, "buildsTime": { "type": "array", - "description": "Aggregated sum of site builds compute time per period.", + "description": "Aggregated sum of function builds compute time per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40363,7 +41189,89 @@ }, "buildsMbSeconds": { "type": "array", - "description": "Aggregated number of site builds mbSeconds per period.", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", "items": { "$ref": "#\/components\/schemas\/metric" }, @@ -40375,15 +41283,32 @@ "deploymentsTotal", "deploymentsStorageTotal", "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", "buildsStorageTotal", "buildsTimeTotal", + "buildsTimeAverage", "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", "deployments", "deploymentsStorage", "builds", "buildsStorage", "buildsTime", - "buildsMbSeconds" + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" ] }, "usageProject": { @@ -40872,11 +41797,21 @@ "description": "Console Variables", "type": "object", "properties": { - "_APP_DOMAIN_TARGET": { + "_APP_DOMAIN_TARGET_CNAME": { "type": "string", "description": "CNAME target for your Appwrite custom domains.", "x-example": "appwrite.io" }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -40931,7 +41866,9 @@ } }, "required": [ - "_APP_DOMAIN_TARGET", + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -41471,6 +42408,11 @@ "user" ] }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, "statusCounters": { "type": "object", "description": "A group of counters that represent the total progress of the migration.", @@ -41499,6 +42441,7 @@ "source", "destination", "resources", + "resourceId", "statusCounters", "resourceData", "errors" diff --git a/app/config/specs/open-api3-1.7.x-server.json b/app/config/specs/open-api3-1.7.x-server.json index 9903453e60..ca30c5260e 100644 --- a/app/config/specs/open-api3-1.7.x-server.json +++ b/app/config/specs/open-api3-1.7.x-server.json @@ -8121,7 +8121,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", "responses": { "200": { "description": "Functions List", @@ -8136,7 +8136,7 @@ }, "x-appwrite": { "method": "list", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -8194,7 +8194,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "responses": { "201": { "description": "Function", @@ -8209,7 +8209,7 @@ }, "x-appwrite": { "method": "create", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -8425,7 +8425,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all runtimes that are currently active on your instance.", "responses": { "200": { "description": "Runtimes List", @@ -8440,7 +8440,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -8474,7 +8474,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List allowed function specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -8489,7 +8489,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -8524,7 +8524,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function by its unique ID.", "responses": { "200": { "description": "Function", @@ -8539,7 +8539,7 @@ }, "x-appwrite": { "method": "get", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -8583,7 +8583,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update function by its unique ID.", "responses": { "200": { "description": "Function", @@ -8598,7 +8598,7 @@ }, "x-appwrite": { "method": "update", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -8818,7 +8818,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function by its unique ID.", "responses": { "204": { "description": "No content" @@ -8826,7 +8826,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -8872,7 +8872,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "responses": { "200": { "description": "Function", @@ -8887,7 +8887,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8952,7 +8952,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -8967,7 +8967,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9035,7 +9035,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9050,7 +9050,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 371, + "weight": 372, "cookies": false, "type": "upload", "deprecated": false, @@ -9131,7 +9131,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -9146,7 +9146,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9216,7 +9216,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -9231,7 +9231,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9319,7 +9319,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -9334,7 +9334,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9416,7 +9416,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -9431,7 +9431,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -9485,7 +9485,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a code deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -9493,7 +9493,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9549,7 +9549,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File" @@ -9557,7 +9557,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 378, + "weight": 379, "cookies": false, "type": "location", "deprecated": false, @@ -9632,7 +9632,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -9647,7 +9647,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9703,7 +9703,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -9718,7 +9718,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9779,7 +9779,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -9794,7 +9794,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -9895,7 +9895,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -9910,7 +9910,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9968,7 +9968,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function execution by its unique ID.", "responses": { "204": { "description": "No content" @@ -9976,7 +9976,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10032,7 +10032,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all variables of a specific function.", "responses": { "200": { "description": "Variables List", @@ -10047,7 +10047,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10091,7 +10091,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "responses": { "201": { "description": "Variable", @@ -10106,7 +10106,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -10182,7 +10182,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -10197,7 +10197,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -10251,7 +10251,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -10266,7 +10266,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10349,7 +10349,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -10357,7 +10357,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -12316,7 +12316,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -12392,7 +12392,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -12536,7 +12536,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -12682,7 +12682,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -12856,7 +12856,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -13034,7 +13034,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13143,7 +13143,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13255,7 +13255,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13308,7 +13308,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -13370,7 +13370,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13445,7 +13445,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13520,7 +13520,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -13596,7 +13596,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -13701,7 +13701,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -13809,7 +13809,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -13894,7 +13894,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -13982,7 +13982,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -14097,7 +14097,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14215,7 +14215,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -14310,7 +14310,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -14408,7 +14408,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -14513,7 +14513,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14621,7 +14621,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -14764,7 +14764,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -14909,7 +14909,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15004,7 +15004,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -15102,7 +15102,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15197,7 +15197,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15295,7 +15295,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15390,7 +15390,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15488,7 +15488,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -15583,7 +15583,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -15681,7 +15681,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -15734,7 +15734,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -15796,7 +15796,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -15871,7 +15871,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -15946,7 +15946,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -16020,7 +16020,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16103,7 +16103,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16163,7 +16163,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16240,7 +16240,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16302,7 +16302,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -16377,7 +16377,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16461,7 +16461,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16552,7 +16552,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16615,7 +16615,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -16676,7 +16676,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", "responses": { "200": { "description": "Sites List", @@ -16691,7 +16691,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -16746,7 +16746,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site.", "responses": { "201": { "description": "Site", @@ -16761,7 +16761,7 @@ }, "x-appwrite": { "method": "create", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -16992,7 +16992,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all frameworks that are currently available on the server instance.", "responses": { "200": { "description": "Frameworks List", @@ -17007,7 +17007,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -17041,7 +17041,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List allowed site specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -17056,7 +17056,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -17091,7 +17091,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site by its unique ID.", "responses": { "200": { "description": "Site", @@ -17106,7 +17106,7 @@ }, "x-appwrite": { "method": "get", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -17150,7 +17150,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update site by its unique ID.", "responses": { "200": { "description": "Site", @@ -17165,7 +17165,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -17399,7 +17399,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site by its unique ID.", "responses": { "204": { "description": "No content" @@ -17407,7 +17407,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -17453,7 +17453,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "responses": { "200": { "description": "Site", @@ -17468,7 +17468,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17533,7 +17533,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -17548,7 +17548,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17616,7 +17616,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "responses": { "202": { "description": "Deployment", @@ -17631,7 +17631,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 400, + "weight": 401, "cookies": false, "type": "upload", "deprecated": false, @@ -17717,7 +17717,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -17732,7 +17732,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -17792,12 +17792,12 @@ }, "\/sites\/{siteId}\/deployments\/template": { "post": { - "summary": "Create deployment", + "summary": "Create template deployment", "operationId": "sitesCreateTemplateDeployment", "tags": [ "sites" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -17812,7 +17812,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -17900,7 +17900,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -17915,7 +17915,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -17998,7 +17998,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -18013,7 +18013,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -18067,7 +18067,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -18075,7 +18075,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -18131,7 +18131,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File" @@ -18139,7 +18139,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 407, + "weight": 408, "cookies": false, "type": "location", "deprecated": false, @@ -18214,7 +18214,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -18229,7 +18229,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 409, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -18285,7 +18285,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all site logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -18300,7 +18300,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18356,7 +18356,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site request log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -18371,7 +18371,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18425,7 +18425,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site log by its unique ID.", "responses": { "204": { "description": "No content" @@ -18433,7 +18433,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18489,7 +18489,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all variables of a specific site.", "responses": { "200": { "description": "Variables List", @@ -18504,7 +18504,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18548,7 +18548,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "responses": { "201": { "description": "Variable", @@ -18563,7 +18563,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18639,7 +18639,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -18654,7 +18654,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18708,7 +18708,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -18723,7 +18723,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 416, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -18806,7 +18806,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -18814,7 +18814,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -21127,6 +21127,463 @@ } } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "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: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -24706,6 +25163,30 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -27273,6 +27754,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index aa43ab23df..1be340b5ec 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -7456,7 +7456,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -7471,7 +7471,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -7537,7 +7537,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -7552,7 +7552,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -7635,7 +7635,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -7650,7 +7650,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -7696,7 +7696,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -7711,7 +7711,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -7782,7 +7782,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -7790,7 +7790,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -7838,7 +7838,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -7853,7 +7853,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index f9c98cc5d9..6c999d047a 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -29578,7 +29578,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -29593,7 +29593,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -29659,7 +29659,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -29674,7 +29674,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -29757,7 +29757,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -29772,7 +29772,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -29818,7 +29818,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -29833,7 +29833,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -29904,7 +29904,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -29912,7 +29912,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -29960,7 +29960,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -29975,7 +29975,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index eaeba62029..ca30c5260e 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -21134,7 +21134,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -21149,7 +21149,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -21217,7 +21217,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -21232,7 +21232,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -21317,7 +21317,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -21332,7 +21332,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -21380,7 +21380,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -21395,7 +21395,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -21468,7 +21468,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -21476,7 +21476,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -21526,7 +21526,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -21541,7 +21541,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-1.7.x-client.json b/app/config/specs/swagger2-1.7.x-client.json index 9e46409693..0dd88e6d4f 100644 --- a/app/config/specs/swagger2-1.7.x-client.json +++ b/app/config/specs/swagger2-1.7.x-client.json @@ -4918,7 +4918,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -4929,7 +4929,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -4991,7 +4991,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -5002,7 +5002,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -5109,7 +5109,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -5120,7 +5120,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -5761,7 +5761,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -5845,7 +5845,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -7653,6 +7653,451 @@ } ] } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } } }, "tags": [ @@ -7875,6 +8320,31 @@ "files" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -9082,6 +9552,50 @@ "chunksUploaded" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/swagger2-1.7.x-console.json b/app/config/specs/swagger2-1.7.x-console.json index 2c1d094b63..94dad7013c 100644 --- a/app/config/specs/swagger2-1.7.x-console.json +++ b/app/config/specs/swagger2-1.7.x-console.json @@ -4555,7 +4555,7 @@ "tags": [ "console" ], - "description": "", + "description": "Check if a resource ID is available.", "responses": { "204": { "description": "No content" @@ -4563,7 +4563,7 @@ }, "x-appwrite": { "method": "getResource", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -9189,7 +9189,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", "responses": { "200": { "description": "Functions List", @@ -9200,7 +9200,7 @@ }, "x-appwrite": { "method": "list", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -9260,7 +9260,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "responses": { "201": { "description": "Function", @@ -9271,7 +9271,7 @@ }, "x-appwrite": { "method": "create", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -9510,7 +9510,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all runtimes that are currently active on your instance.", "responses": { "200": { "description": "Runtimes List", @@ -9521,7 +9521,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -9560,7 +9560,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List allowed function specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -9571,7 +9571,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -9611,7 +9611,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "responses": { "200": { "description": "Function Templates List", @@ -9622,7 +9622,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -9706,7 +9706,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", "responses": { "200": { "description": "Template Function", @@ -9717,7 +9717,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -9765,7 +9765,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunctions", @@ -9776,7 +9776,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9836,7 +9836,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function by its unique ID.", "responses": { "200": { "description": "Function", @@ -9847,7 +9847,7 @@ }, "x-appwrite": { "method": "get", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +9894,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update function by its unique ID.", "responses": { "200": { "description": "Function", @@ -9905,7 +9905,7 @@ }, "x-appwrite": { "method": "update", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -10141,7 +10141,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function by its unique ID.", "responses": { "204": { "description": "No content" @@ -10149,7 +10149,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -10198,7 +10198,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "responses": { "200": { "description": "Function", @@ -10209,7 +10209,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -10276,7 +10276,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -10287,7 +10287,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10355,7 +10355,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -10366,7 +10366,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 371, + "weight": 372, "cookies": false, "type": "upload", "deprecated": false, @@ -10446,7 +10446,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -10457,7 +10457,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10530,7 +10530,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -10541,7 +10541,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -10635,7 +10635,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -10646,7 +10646,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10732,7 +10732,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -10743,7 +10743,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -10796,7 +10796,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a code deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -10804,7 +10804,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10861,7 +10861,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File", @@ -10872,7 +10872,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 378, + "weight": 379, "cookies": false, "type": "location", "deprecated": false, @@ -10946,7 +10946,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -10957,7 +10957,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -11014,7 +11014,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -11025,7 +11025,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -11087,7 +11087,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -11098,7 +11098,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11205,7 +11205,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -11216,7 +11216,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -11272,7 +11272,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function execution by its unique ID.", "responses": { "204": { "description": "No content" @@ -11280,7 +11280,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11337,7 +11337,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageFunction", @@ -11348,7 +11348,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11416,7 +11416,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all variables of a specific function.", "responses": { "200": { "description": "Variables List", @@ -11427,7 +11427,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11474,7 +11474,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "responses": { "201": { "description": "Variable", @@ -11485,7 +11485,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -11565,7 +11565,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -11576,7 +11576,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -11631,7 +11631,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -11642,7 +11642,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11725,7 +11725,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -11733,7 +11733,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -13718,7 +13718,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -13792,7 +13792,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -13949,7 +13949,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14103,7 +14103,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -14297,7 +14297,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14490,7 +14490,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -14607,7 +14607,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14722,7 +14722,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14776,7 +14776,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14837,7 +14837,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14910,7 +14910,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14983,7 +14983,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -15057,7 +15057,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -15171,7 +15171,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -15283,7 +15283,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15373,7 +15373,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15461,7 +15461,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -15587,7 +15587,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15711,7 +15711,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -15813,7 +15813,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -15913,7 +15913,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -16027,7 +16027,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -16139,7 +16139,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -16297,7 +16297,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16452,7 +16452,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -16554,7 +16554,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16654,7 +16654,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16756,7 +16756,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16856,7 +16856,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16958,7 +16958,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -17058,7 +17058,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -17160,7 +17160,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -17260,7 +17260,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -17314,7 +17314,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17375,7 +17375,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17448,7 +17448,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17521,7 +17521,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -17593,7 +17593,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17682,7 +17682,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17741,7 +17741,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17819,7 +17819,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17880,7 +17880,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -17953,7 +17953,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -18033,7 +18033,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18122,7 +18122,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18184,7 +18184,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18256,7 +18256,7 @@ }, "x-appwrite": { "method": "list", - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -18421,7 +18421,7 @@ }, "x-appwrite": { "method": "getAppwriteReport", - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -18484,6 +18484,89 @@ ] } }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "weight": 310, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "default": null, + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "default": null, + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + ] + } + }, "\/migrations\/firebase": { "post": { "summary": "Migrate Firebase data", @@ -18587,7 +18670,7 @@ }, "x-appwrite": { "method": "getFirebaseReport", - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18777,7 +18860,7 @@ }, "x-appwrite": { "method": "getNHostReport", - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -19009,7 +19092,7 @@ }, "x-appwrite": { "method": "getSupabaseReport", - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -19121,7 +19204,7 @@ }, "x-appwrite": { "method": "get", - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19178,7 +19261,7 @@ }, "x-appwrite": { "method": "retry", - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -19230,7 +19313,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -24582,7 +24665,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", "responses": { "201": { "description": "Rule", @@ -24593,7 +24676,7 @@ }, "x-appwrite": { "method": "createAPIRule", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -24651,7 +24734,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", "responses": { "201": { "description": "Rule", @@ -24662,7 +24745,7 @@ }, "x-appwrite": { "method": "createFunctionRule", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -24733,7 +24816,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", "responses": { "201": { "description": "Rule", @@ -24744,7 +24827,7 @@ }, "x-appwrite": { "method": "createRedirectRule", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -24829,7 +24912,7 @@ "tags": [ "proxy" ], - "description": "", + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", "responses": { "201": { "description": "Rule", @@ -24840,7 +24923,7 @@ }, "x-appwrite": { "method": "createSiteRule", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -25081,7 +25164,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", "responses": { "200": { "description": "Sites List", @@ -25092,7 +25175,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -25152,7 +25235,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site.", "responses": { "201": { "description": "Site", @@ -25163,7 +25246,7 @@ }, "x-appwrite": { "method": "create", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -25244,7 +25327,7 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "default": 15, + "default": 30, "x-example": 1 }, "installCommand": { @@ -25417,7 +25500,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all frameworks that are currently available on the server instance.", "responses": { "200": { "description": "Frameworks List", @@ -25428,7 +25511,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -25467,7 +25550,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List allowed site specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -25478,7 +25561,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -25518,7 +25601,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "responses": { "200": { "description": "Site Templates List", @@ -25529,7 +25612,7 @@ }, "x-appwrite": { "method": "listTemplates", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -25613,7 +25696,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", "responses": { "200": { "description": "Template Site", @@ -25624,7 +25707,7 @@ }, "x-appwrite": { "method": "getTemplate", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -25672,7 +25755,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageSites", @@ -25683,7 +25766,7 @@ }, "x-appwrite": { "method": "listUsage", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -25743,7 +25826,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site by its unique ID.", "responses": { "200": { "description": "Site", @@ -25754,7 +25837,7 @@ }, "x-appwrite": { "method": "get", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -25801,7 +25884,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update site by its unique ID.", "responses": { "200": { "description": "Site", @@ -25812,7 +25895,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -25895,7 +25978,7 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "default": 15, + "default": 30, "x-example": 1 }, "installCommand": { @@ -26062,7 +26145,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site by its unique ID.", "responses": { "204": { "description": "No content" @@ -26070,7 +26153,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -26119,7 +26202,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "responses": { "200": { "description": "Site", @@ -26130,7 +26213,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -26197,7 +26280,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -26208,7 +26291,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26276,7 +26359,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "responses": { "202": { "description": "Deployment", @@ -26287,7 +26370,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 400, + "weight": 401, "cookies": false, "type": "upload", "deprecated": false, @@ -26375,7 +26458,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -26386,7 +26469,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26442,7 +26525,7 @@ }, "\/sites\/{siteId}\/deployments\/template": { "post": { - "summary": "Create deployment", + "summary": "Create template deployment", "operationId": "sitesCreateTemplateDeployment", "consumes": [ "application\/json" @@ -26453,7 +26536,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -26464,7 +26547,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -26558,7 +26641,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -26569,7 +26652,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -26656,7 +26739,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -26667,7 +26750,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -26720,7 +26803,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -26728,7 +26811,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26785,7 +26868,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File", @@ -26796,7 +26879,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 407, + "weight": 408, "cookies": false, "type": "location", "deprecated": false, @@ -26870,7 +26953,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -26881,7 +26964,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 409, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -26938,7 +27021,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all site logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -26949,7 +27032,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27010,7 +27093,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site request log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -27021,7 +27104,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -27076,7 +27159,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site log by its unique ID.", "responses": { "204": { "description": "No content" @@ -27084,7 +27167,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27141,7 +27224,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", "responses": { "200": { "description": "UsageSite", @@ -27152,7 +27235,7 @@ }, "x-appwrite": { "method": "getUsage", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27220,7 +27303,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all variables of a specific site.", "responses": { "200": { "description": "Variables List", @@ -27231,7 +27314,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27278,7 +27361,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "responses": { "201": { "description": "Variable", @@ -27289,7 +27372,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -27369,7 +27452,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -27380,7 +27463,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -27435,7 +27518,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -27446,7 +27529,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 416, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -27529,7 +27612,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -27537,7 +27620,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -30019,6 +30102,451 @@ ] } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -34386,6 +34914,31 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -37302,6 +37855,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", @@ -40527,6 +41124,18 @@ }, "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.", @@ -40589,6 +41198,24 @@ "$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": [] } }, "required": [ @@ -40606,13 +41233,17 @@ "functions", "deployments", "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", "builds", "buildsStorage", "buildsTime", "buildsMbSeconds", "executions", "executionsTime", - "executionsMbSeconds" + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" ] }, "usageFunction": { @@ -40642,6 +41273,18 @@ "x-example": 0, "format": "int32" }, + "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" + }, "buildsStorageTotal": { "type": "integer", "description": "total aggregated sum of function builds storage.", @@ -40654,6 +41297,12 @@ "x-example": 0, "format": "int32" }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, "buildsMbSecondsTotal": { "type": "integer", "description": "Total aggregated sum of function builds mbSeconds.", @@ -40758,6 +41407,286 @@ "$ref": "#\/definitions\/metric" }, "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "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.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] } }, "required": [ @@ -40773,146 +41702,25 @@ "executionsMbSecondsTotal", "deployments", "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", "builds", "buildsStorage", "buildsTime", "buildsMbSeconds", "executions", "executionsTime", - "executionsMbSeconds" - ] - }, - "usageSites": { - "description": "UsageSites", - "type": "object", - "properties": { - "range": { - "type": "string", - "description": "Time range of the usage stats.", - "x-example": "30d" - }, - "sitesTotal": { - "type": "integer", - "description": "Total aggregated number of sites.", - "x-example": 0, - "format": "int32" - }, - "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" - }, - "sites": { - "type": "array", - "description": "Aggregated number of sites per period.", - "items": { - "type": "object", - "$ref": "#\/definitions\/metric" - }, - "x-example": 0 - }, - "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": [] - }, - "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": [] - } - }, - "required": [ - "range", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", "sitesTotal", - "deploymentsTotal", - "deploymentsStorageTotal", - "buildsTotal", - "buildsStorageTotal", - "buildsTimeTotal", - "buildsMbSecondsTotal", "sites", - "deployments", - "deploymentsStorage", - "builds", - "buildsStorage", - "buildsTime", - "buildsMbSeconds" + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" ] }, "usageSite": { @@ -40926,43 +41734,79 @@ }, "deploymentsTotal": { "type": "integer", - "description": "Total aggregated number of site deployments.", + "description": "Total aggregated number of function deployments.", "x-example": 0, "format": "int32" }, "deploymentsStorageTotal": { "type": "integer", - "description": "Total aggregated sum of site deployments storage.", + "description": "Total aggregated sum of function deployments storage.", "x-example": 0, "format": "int32" }, "buildsTotal": { "type": "integer", - "description": "Total aggregated number of site builds.", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "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" }, "buildsStorageTotal": { "type": "integer", - "description": "total aggregated sum of site builds storage.", + "description": "total aggregated sum of function builds storage.", "x-example": 0, "format": "int32" }, "buildsTimeTotal": { "type": "integer", - "description": "Total aggregated sum of site builds compute time.", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", "x-example": 0, "format": "int32" }, "buildsMbSecondsTotal": { "type": "integer", - "description": "Total aggregated sum of site builds mbSeconds.", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", "x-example": 0, "format": "int32" }, "deployments": { "type": "array", - "description": "Aggregated number of site deployments per period.", + "description": "Aggregated number of function deployments per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -40971,7 +41815,7 @@ }, "deploymentsStorage": { "type": "array", - "description": "Aggregated number of site deployments storage per period.", + "description": "Aggregated number of function deployments storage per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -40980,7 +41824,7 @@ }, "builds": { "type": "array", - "description": "Aggregated number of site builds per period.", + "description": "Aggregated number of function builds per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -40989,7 +41833,7 @@ }, "buildsStorage": { "type": "array", - "description": "Aggregated sum of site builds storage per period.", + "description": "Aggregated sum of function builds storage per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -40998,7 +41842,7 @@ }, "buildsTime": { "type": "array", - "description": "Aggregated sum of site builds compute time per period.", + "description": "Aggregated sum of function builds compute time per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -41007,7 +41851,97 @@ }, "buildsMbSeconds": { "type": "array", - "description": "Aggregated number of site builds mbSeconds per period.", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", "items": { "type": "object", "$ref": "#\/definitions\/metric" @@ -41020,15 +41954,32 @@ "deploymentsTotal", "deploymentsStorageTotal", "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", "buildsStorageTotal", "buildsTimeTotal", + "buildsTimeAverage", "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", "deployments", "deploymentsStorage", "builds", "buildsStorage", "buildsTime", - "buildsMbSeconds" + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" ] }, "usageProject": { @@ -41531,11 +42482,21 @@ "description": "Console Variables", "type": "object", "properties": { - "_APP_DOMAIN_TARGET": { + "_APP_DOMAIN_TARGET_CNAME": { "type": "string", "description": "CNAME target for your Appwrite custom domains.", "x-example": "appwrite.io" }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, "_APP_STORAGE_LIMIT": { "type": "integer", "description": "Maximum file size allowed for file upload in bytes.", @@ -41590,7 +42551,9 @@ } }, "required": [ - "_APP_DOMAIN_TARGET", + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", "_APP_STORAGE_LIMIT", "_APP_COMPUTE_SIZE_LIMIT", "_APP_USAGE_STATS", @@ -42133,6 +43096,11 @@ "user" ] }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, "statusCounters": { "type": "object", "additionalProperties": true, @@ -42163,6 +43131,7 @@ "source", "destination", "resources", + "resourceId", "statusCounters", "resourceData", "errors" diff --git a/app/config/specs/swagger2-1.7.x-server.json b/app/config/specs/swagger2-1.7.x-server.json index c89973e2a3..28c56410fb 100644 --- a/app/config/specs/swagger2-1.7.x-server.json +++ b/app/config/specs/swagger2-1.7.x-server.json @@ -8271,7 +8271,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", "responses": { "200": { "description": "Functions List", @@ -8282,7 +8282,7 @@ }, "x-appwrite": { "method": "list", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -8343,7 +8343,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", "responses": { "201": { "description": "Function", @@ -8354,7 +8354,7 @@ }, "x-appwrite": { "method": "create", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -8594,7 +8594,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all runtimes that are currently active on your instance.", "responses": { "200": { "description": "Runtimes List", @@ -8605,7 +8605,7 @@ }, "x-appwrite": { "method": "listRuntimes", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -8645,7 +8645,7 @@ "tags": [ "functions" ], - "description": "", + "description": "List allowed function specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -8656,7 +8656,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -8697,7 +8697,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function by its unique ID.", "responses": { "200": { "description": "Function", @@ -8708,7 +8708,7 @@ }, "x-appwrite": { "method": "get", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -8756,7 +8756,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update function by its unique ID.", "responses": { "200": { "description": "Function", @@ -8767,7 +8767,7 @@ }, "x-appwrite": { "method": "update", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -9004,7 +9004,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function by its unique ID.", "responses": { "204": { "description": "No content" @@ -9012,7 +9012,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -9062,7 +9062,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", "responses": { "200": { "description": "Function", @@ -9073,7 +9073,7 @@ }, "x-appwrite": { "method": "updateFunctionDeployment", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9141,7 +9141,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -9152,7 +9152,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9221,7 +9221,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", "responses": { "202": { "description": "Deployment", @@ -9232,7 +9232,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 371, + "weight": 372, "cookies": false, "type": "upload", "deprecated": false, @@ -9313,7 +9313,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -9324,7 +9324,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9398,7 +9398,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -9409,7 +9409,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9504,7 +9504,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -9515,7 +9515,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9602,7 +9602,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -9613,7 +9613,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -9667,7 +9667,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a code deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -9675,7 +9675,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9733,7 +9733,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File", @@ -9744,7 +9744,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 378, + "weight": 379, "cookies": false, "type": "location", "deprecated": false, @@ -9819,7 +9819,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -9830,7 +9830,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 380, + "weight": 381, "cookies": false, "type": "", "deprecated": false, @@ -9888,7 +9888,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -9899,7 +9899,7 @@ }, "x-appwrite": { "method": "listExecutions", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9963,7 +9963,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", "responses": { "201": { "description": "Execution", @@ -9974,7 +9974,7 @@ }, "x-appwrite": { "method": "createExecution", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10083,7 +10083,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a function execution log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -10094,7 +10094,7 @@ }, "x-appwrite": { "method": "getExecution", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10152,7 +10152,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a function execution by its unique ID.", "responses": { "204": { "description": "No content" @@ -10160,7 +10160,7 @@ }, "x-appwrite": { "method": "deleteExecution", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10218,7 +10218,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a list of all variables of a specific function.", "responses": { "200": { "description": "Variables List", @@ -10229,7 +10229,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10277,7 +10277,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", "responses": { "201": { "description": "Variable", @@ -10288,7 +10288,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 387, + "weight": 388, "cookies": false, "type": "", "deprecated": false, @@ -10369,7 +10369,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -10380,7 +10380,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -10436,7 +10436,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -10447,7 +10447,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10531,7 +10531,7 @@ "tags": [ "functions" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -10539,7 +10539,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -12568,7 +12568,7 @@ }, "x-appwrite": { "method": "listMessages", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -12643,7 +12643,7 @@ }, "x-appwrite": { "method": "createEmail", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -12801,7 +12801,7 @@ }, "x-appwrite": { "method": "updateEmail", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -12956,7 +12956,7 @@ }, "x-appwrite": { "method": "createPush", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -13151,7 +13151,7 @@ }, "x-appwrite": { "method": "updatePush", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -13345,7 +13345,7 @@ }, "x-appwrite": { "method": "createSms", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -13463,7 +13463,7 @@ }, "x-appwrite": { "method": "updateSms", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13579,7 +13579,7 @@ }, "x-appwrite": { "method": "getMessage", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13634,7 +13634,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -13696,7 +13696,7 @@ }, "x-appwrite": { "method": "listMessageLogs", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13770,7 +13770,7 @@ }, "x-appwrite": { "method": "listTargets", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13844,7 +13844,7 @@ }, "x-appwrite": { "method": "listProviders", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -13919,7 +13919,7 @@ }, "x-appwrite": { "method": "createApnsProvider", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -14034,7 +14034,7 @@ }, "x-appwrite": { "method": "updateApnsProvider", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -14147,7 +14147,7 @@ }, "x-appwrite": { "method": "createFcmProvider", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -14238,7 +14238,7 @@ }, "x-appwrite": { "method": "updateFcmProvider", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -14327,7 +14327,7 @@ }, "x-appwrite": { "method": "createMailgunProvider", - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -14454,7 +14454,7 @@ }, "x-appwrite": { "method": "updateMailgunProvider", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14579,7 +14579,7 @@ }, "x-appwrite": { "method": "createMsg91Provider", - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -14682,7 +14682,7 @@ }, "x-appwrite": { "method": "updateMsg91Provider", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -14783,7 +14783,7 @@ }, "x-appwrite": { "method": "createSendgridProvider", - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -14898,7 +14898,7 @@ }, "x-appwrite": { "method": "updateSendgridProvider", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15011,7 +15011,7 @@ }, "x-appwrite": { "method": "createSmtpProvider", - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -15170,7 +15170,7 @@ }, "x-appwrite": { "method": "updateSmtpProvider", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -15326,7 +15326,7 @@ }, "x-appwrite": { "method": "createTelesignProvider", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15429,7 +15429,7 @@ }, "x-appwrite": { "method": "updateTelesignProvider", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -15530,7 +15530,7 @@ }, "x-appwrite": { "method": "createTextmagicProvider", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15633,7 +15633,7 @@ }, "x-appwrite": { "method": "updateTextmagicProvider", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15734,7 +15734,7 @@ }, "x-appwrite": { "method": "createTwilioProvider", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15837,7 +15837,7 @@ }, "x-appwrite": { "method": "updateTwilioProvider", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15938,7 +15938,7 @@ }, "x-appwrite": { "method": "createVonageProvider", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16041,7 +16041,7 @@ }, "x-appwrite": { "method": "updateVonageProvider", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16142,7 +16142,7 @@ }, "x-appwrite": { "method": "getProvider", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -16197,7 +16197,7 @@ }, "x-appwrite": { "method": "deleteProvider", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16259,7 +16259,7 @@ }, "x-appwrite": { "method": "listProviderLogs", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16333,7 +16333,7 @@ }, "x-appwrite": { "method": "listSubscriberLogs", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16407,7 +16407,7 @@ }, "x-appwrite": { "method": "listTopics", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -16480,7 +16480,7 @@ }, "x-appwrite": { "method": "createTopic", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16570,7 +16570,7 @@ }, "x-appwrite": { "method": "getTopic", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16630,7 +16630,7 @@ }, "x-appwrite": { "method": "updateTopic", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16709,7 +16709,7 @@ }, "x-appwrite": { "method": "deleteTopic", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16771,7 +16771,7 @@ }, "x-appwrite": { "method": "listTopicLogs", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -16845,7 +16845,7 @@ }, "x-appwrite": { "method": "listSubscribers", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16926,7 +16926,7 @@ }, "x-appwrite": { "method": "createSubscriber", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17017,7 +17017,7 @@ }, "x-appwrite": { "method": "getSubscriber", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17080,7 +17080,7 @@ }, "x-appwrite": { "method": "deleteSubscriber", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17143,7 +17143,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", "responses": { "200": { "description": "Sites List", @@ -17154,7 +17154,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -17215,7 +17215,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site.", "responses": { "201": { "description": "Site", @@ -17226,7 +17226,7 @@ }, "x-appwrite": { "method": "create", - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -17308,7 +17308,7 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "default": 15, + "default": 30, "x-example": 1 }, "installCommand": { @@ -17481,7 +17481,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all frameworks that are currently available on the server instance.", "responses": { "200": { "description": "Frameworks List", @@ -17492,7 +17492,7 @@ }, "x-appwrite": { "method": "listFrameworks", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -17532,7 +17532,7 @@ "tags": [ "sites" ], - "description": "", + "description": "List allowed site specifications for this instance.", "responses": { "200": { "description": "Specifications List", @@ -17543,7 +17543,7 @@ }, "x-appwrite": { "method": "listSpecifications", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -17584,7 +17584,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site by its unique ID.", "responses": { "200": { "description": "Site", @@ -17595,7 +17595,7 @@ }, "x-appwrite": { "method": "get", - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -17643,7 +17643,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update site by its unique ID.", "responses": { "200": { "description": "Site", @@ -17654,7 +17654,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -17738,7 +17738,7 @@ "timeout": { "type": "integer", "description": "Maximum request time in seconds.", - "default": 15, + "default": 30, "x-example": 1 }, "installCommand": { @@ -17905,7 +17905,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site by its unique ID.", "responses": { "204": { "description": "No content" @@ -17913,7 +17913,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -17963,7 +17963,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", "responses": { "200": { "description": "Site", @@ -17974,7 +17974,7 @@ }, "x-appwrite": { "method": "updateSiteDeployment", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -18042,7 +18042,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", "responses": { "200": { "description": "Deployments List", @@ -18053,7 +18053,7 @@ }, "x-appwrite": { "method": "listDeployments", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -18122,7 +18122,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", "responses": { "202": { "description": "Deployment", @@ -18133,7 +18133,7 @@ }, "x-appwrite": { "method": "createDeployment", - "weight": 400, + "weight": 401, "cookies": false, "type": "upload", "deprecated": false, @@ -18222,7 +18222,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", "responses": { "202": { "description": "Deployment", @@ -18233,7 +18233,7 @@ }, "x-appwrite": { "method": "createDuplicateDeployment", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -18290,7 +18290,7 @@ }, "\/sites\/{siteId}\/deployments\/template": { "post": { - "summary": "Create deployment", + "summary": "Create template deployment", "operationId": "sitesCreateTemplateDeployment", "consumes": [ "application\/json" @@ -18301,7 +18301,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", "responses": { "202": { "description": "Deployment", @@ -18312,7 +18312,7 @@ }, "x-appwrite": { "method": "createTemplateDeployment", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -18407,7 +18407,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", "responses": { "202": { "description": "Deployment", @@ -18418,7 +18418,7 @@ }, "x-appwrite": { "method": "createVcsDeployment", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -18506,7 +18506,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment by its unique ID.", "responses": { "200": { "description": "Deployment", @@ -18517,7 +18517,7 @@ }, "x-appwrite": { "method": "getDeployment", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -18571,7 +18571,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site deployment by its unique ID.", "responses": { "204": { "description": "No content" @@ -18579,7 +18579,7 @@ }, "x-appwrite": { "method": "deleteDeployment", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -18637,7 +18637,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.", "responses": { "200": { "description": "File", @@ -18648,7 +18648,7 @@ }, "x-appwrite": { "method": "getDeploymentDownload", - "weight": 407, + "weight": 408, "cookies": false, "type": "location", "deprecated": false, @@ -18723,7 +18723,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", "responses": { "200": { "description": "Deployment", @@ -18734,7 +18734,7 @@ }, "x-appwrite": { "method": "updateDeploymentStatus", - "weight": 409, + "weight": 410, "cookies": false, "type": "", "deprecated": false, @@ -18792,7 +18792,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all site logs. You can use the query params to filter your results.", "responses": { "200": { "description": "Executions List", @@ -18803,7 +18803,7 @@ }, "x-appwrite": { "method": "listLogs", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18865,7 +18865,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a site request log by its unique ID.", "responses": { "200": { "description": "Execution", @@ -18876,7 +18876,7 @@ }, "x-appwrite": { "method": "getLog", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18932,7 +18932,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a site log by its unique ID.", "responses": { "204": { "description": "No content" @@ -18940,7 +18940,7 @@ }, "x-appwrite": { "method": "deleteLog", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18998,7 +18998,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a list of all variables of a specific site.", "responses": { "200": { "description": "Variables List", @@ -19009,7 +19009,7 @@ }, "x-appwrite": { "method": "listVariables", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -19057,7 +19057,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", "responses": { "201": { "description": "Variable", @@ -19068,7 +19068,7 @@ }, "x-appwrite": { "method": "createVariable", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -19149,7 +19149,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Get a variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -19160,7 +19160,7 @@ }, "x-appwrite": { "method": "getVariable", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -19216,7 +19216,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Update variable by its unique ID.", "responses": { "200": { "description": "Variable", @@ -19227,7 +19227,7 @@ }, "x-appwrite": { "method": "updateVariable", - "weight": 416, + "weight": 417, "cookies": false, "type": "", "deprecated": false, @@ -19311,7 +19311,7 @@ "tags": [ "sites" ], - "description": "", + "description": "Delete a variable by its unique ID.", "responses": { "204": { "description": "No content" @@ -19319,7 +19319,7 @@ }, "x-appwrite": { "method": "deleteVariable", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -21628,6 +21628,463 @@ ] } }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "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: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": [], + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/tokens\/{tokenId}\/jwt": { + "get": { + "summary": "Get token as JWT", + "operationId": "tokensGetJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "responses": { + "200": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "getJWT", + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "File token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, "\/users": { "get": { "summary": "List users", @@ -25231,6 +25688,31 @@ "buckets" ] }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, "teamList": { "description": "Teams List", "type": "object", @@ -27822,6 +28304,50 @@ "antivirus" ] }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceInternalId": { + "type": "string", + "description": "File ID.", + "x-example": "1:1" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "file" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceInternalId", + "resourceType", + "expire" + ] + }, "team": { "description": "Team", "type": "object", diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index b87c09b32f..0dd88e6d4f 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -7667,7 +7667,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -7678,7 +7678,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -7748,7 +7748,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -7759,7 +7759,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -7844,7 +7844,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -7855,7 +7855,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -7905,7 +7905,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -7916,7 +7916,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -7989,7 +7989,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -7997,7 +7997,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -8049,7 +8049,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -8060,7 +8060,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 581c8408fe..94dad7013c 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -30115,7 +30115,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -30126,7 +30126,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -30196,7 +30196,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -30207,7 +30207,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -30292,7 +30292,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -30303,7 +30303,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -30353,7 +30353,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -30364,7 +30364,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -30437,7 +30437,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -30445,7 +30445,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -30497,7 +30497,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -30508,7 +30508,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -41273,3 +41273,1943 @@ "x-example": 0, "format": "int32" }, + "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" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "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.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "sitesTotal", + "sites", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageSite": { + "description": "UsageSite", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "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" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "databasesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of databases storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of users.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of files storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "functionsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of builds storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of deployments storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "network": { + "type": "array", + "description": "Aggregated number of consumed bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of executions by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "bucketsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of usage by buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesStorageBreakdown": { + "type": "array", + "description": "An array of the aggregated breakdown of storage usage by databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "executionsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of execution mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "buildsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of build mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "functionsStorageBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of functions storage size (in bytes).", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of image transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "executionsTotal", + "documentsTotal", + "databasesTotal", + "databasesStorageTotal", + "usersTotal", + "filesStorageTotal", + "functionsStorageTotal", + "buildsStorageTotal", + "deploymentsStorageTotal", + "bucketsTotal", + "executionsMbSecondsTotal", + "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "requests", + "network", + "users", + "executions", + "executionsBreakdown", + "bucketsBreakdown", + "databasesStorageBreakdown", + "executionsMbSecondsBreakdown", + "buildsMbSecondsBreakdown", + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites", + "imageTransformations", + "imageTransformationsTotal" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ] + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "x-example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "x-example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "x-example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "x-example": 301, + "format": "int32" + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "type": "string", + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "x-example": "function" + }, + "deploymentResourceId": { + "type": "string", + "description": "ID deployment's resource. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "x-example": "function" + }, + "status": { + "type": "string", + "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", + "x-example": "verified" + }, + "logs": { + "type": "string", + "description": "Certificate generation logs. This will return an empty string if generation did not run, or succeeded.", + "x-example": "HTTP challegne failed." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceType", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ] + }, + "smsTemplate": { + "description": "SmsTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + } + }, + "required": [ + "type", + "locale", + "message" + ] + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "x-example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "mail@appwrite.io" + }, + "replyTo": { + "type": "string", + "description": "Reply to email address", + "x-example": "emails@appwrite.io" + }, + "subject": { + "type": "string", + "description": "Email subject", + "x-example": "Please verify your email address" + } + }, + "required": [ + "type", + "locale", + "message", + "senderName", + "senderEmail", + "replyTo", + "subject" + ] + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "x-example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "x-example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "x-example": true + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "x-example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "x-example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A domain to use for site URLs.", + "x-example": "sites.localhost" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "x-example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "x-example": "ns1.example.com,ns2.example.com" + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ] + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "x-nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ] + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "x-example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "x-example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "x-example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "x-example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, + "statusCounters": { + "type": "object", + "additionalProperties": true, + "description": "A group of counters that represent the total progress of the migration.", + "x-example": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}" + }, + "resourceData": { + "type": "object", + "additionalProperties": true, + "description": "An array of objects containing the report data of the resources that were migrated.", + "x-example": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]" + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "x-example": [] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "statusCounters", + "resourceData", + "errors" + ] + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "x-example": 20, + "format": "int32" + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "x-example": 20, + "format": "int32" + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "x-example": 20, + "format": "int32" + }, + "document": { + "type": "integer", + "description": "Number of documents to be migrated.", + "x-example": 20, + "format": "int32" + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "x-example": 20, + "format": "int32" + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "x-example": 20, + "format": "int32" + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "x-example": 20, + "format": "int32" + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "x-example": 30000, + "format": "int32" + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "x-example": "1.4.0" + } + }, + "required": [ + "user", + "team", + "database", + "document", + "file", + "bucket", + "function", + "size", + "version" + ] + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index fcf412c7a1..28c56410fb 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -21641,7 +21641,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", "responses": { "200": { "description": "Resource Tokens List", @@ -21652,7 +21652,7 @@ }, "x-appwrite": { "method": "list", - "weight": 396, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -21724,7 +21724,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Create a new token. A token is linked to a file or a bucket and manages permissions for those file(s). Token can be passed as a header or request get parameter.", "responses": { "201": { "description": "ResourceToken", @@ -21735,7 +21735,7 @@ }, "x-appwrite": { "method": "createFileToken", - "weight": 393, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -21822,7 +21822,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a token by its unique ID.", "responses": { "200": { "description": "ResourceToken", @@ -21833,7 +21833,7 @@ }, "x-appwrite": { "method": "get", - "weight": 394, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -21885,7 +21885,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date or permissions.", "responses": { "200": { "description": "ResourceToken", @@ -21896,7 +21896,7 @@ }, "x-appwrite": { "method": "update", - "weight": 397, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -21971,7 +21971,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Delete a token by its unique ID.", "responses": { "204": { "description": "No content" @@ -21979,7 +21979,7 @@ }, "x-appwrite": { "method": "delete", - "weight": 398, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -22033,7 +22033,7 @@ "tags": [ "tokens" ], - "description": "", + "description": "Get a JWT based token by its unique ID. You can use the JWT to authenticate on behalf of the user.", "responses": { "200": { "description": "JWT", @@ -22044,7 +22044,7 @@ }, "x-appwrite": { "method": "getJWT", - "weight": 395, + "weight": 431, "cookies": false, "type": "", "deprecated": false, diff --git a/app/controllers/general.php b/app/controllers/general.php index 76835d3769..3c332c593c 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1543,14 +1543,12 @@ foreach (Config::getParam('services', []) as $service) { } } -// Modules -$platform = new Appwrite(); -$platform->init(Service::TYPE_HTTP); - // Check for any errors found while we were initialising the SDK Methods. if (!empty(Method::getErrors())) { throw new \Exception('Errors found during SDK initialization:' . PHP_EOL . implode(PHP_EOL, Method::getErrors())); } +// Modules + $platform = new Appwrite(); $platform->init(Service::TYPE_HTTP); From cda521a5d9a944104dc2107e10d0f9e628728496 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Sun, 20 Apr 2025 15:52:29 +0530 Subject: [PATCH 157/169] Add favicon --- app/views/general/error.phtml | 1 + public/images/logos/appwrite-icon.svg | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 public/images/logos/appwrite-icon.svg diff --git a/app/views/general/error.phtml b/app/views/general/error.phtml index 60afe86494..1537676bca 100644 --- a/app/views/general/error.phtml +++ b/app/views/general/error.phtml @@ -94,6 +94,7 @@ switch ($type) { <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> + <link rel="icon" type="image/svg+xml" href="/images/logos/appwrite-icon.svg" /> <link rel="preload" href="/fonts/inter/inter-v8-latin-600.woff2" diff --git a/public/images/logos/appwrite-icon.svg b/public/images/logos/appwrite-icon.svg new file mode 100644 index 0000000000..bd847aa86d --- /dev/null +++ b/public/images/logos/appwrite-icon.svg @@ -0,0 +1,8 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path + d="M24.4429 16.4322V21.9096H10.7519C6.76318 21.9096 3.28044 19.7067 1.4171 16.4322C1.14622 15.9561 0.909137 15.4567 0.710264 14.9383C0.319864 13.9225 0.0744552 12.8325 0 11.6952V10.2143C0.0161646 9.96089 0.0416361 9.70942 0.0749451 9.46095C0.143032 8.95105 0.245898 8.45211 0.381093 7.96711C1.66006 3.36909 5.81877 0 10.7519 0C15.6851 0 19.8433 3.36909 21.1223 7.96711H15.2682C14.3072 6.4683 12.6437 5.4774 10.7519 5.4774C8.86017 5.4774 7.19668 6.4683 6.23562 7.96711C5.9427 8.42274 5.71542 8.92516 5.56651 9.46095C5.43425 9.93599 5.36371 10.4369 5.36371 10.9548C5.36371 12.5248 6.01324 13.94 7.05463 14.9383C8.01961 15.865 9.32061 16.4322 10.7519 16.4322H24.4429Z" + fill="#FD366E" /> + <path + d="M24.4429 9.46094V14.9383H14.4492C15.4906 13.94 16.1401 12.5248 16.1401 10.9548C16.1401 10.4369 16.0696 9.93598 15.9373 9.46094H24.4429Z" + fill="#FD366E" /> +</svg> \ No newline at end of file From 873b384f70c83486da721d333a1f99f33235fc3f Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Mon, 21 Apr 2025 10:01:13 +0530 Subject: [PATCH 158/169] update: allow compressed files. --- app/controllers/api/migrations.php | 31 +++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 4a1e5de227..a19c6d3a22 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -27,6 +27,8 @@ use Utopia\Migration\Sources\Firebase; use Utopia\Migration\Sources\NHost; use Utopia\Migration\Sources\Supabase; use Utopia\Migration\Transfer; +use Utopia\Storage\Compression\Algorithms\GZIP; +use Utopia\Storage\Compression\Algorithms\Zstd; use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\Validator\ArrayList; @@ -345,18 +347,37 @@ App::post('/v1/migrations/csv') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND, 'File not found in ' . $path); } - if (!empty($file->getAttribute('openSSLCipher')) || $file->getAttribute('algorithm', Compression::NONE) !== Compression::NONE) { - throw new Exception(Exception::STORAGE_FILE_TYPE_UNSUPPORTED, "Only uncompressed, unencrypted CSV files can be used for document import."); + if (!empty($file->getAttribute('openSSLCipher'))) { + throw new Exception(Exception::STORAGE_FILE_TYPE_UNSUPPORTED, "Only unencrypted CSV files can be used for document import."); } - // copy to temporary folder + $compression = $file->getAttribute('algorithm', Compression::NONE); + $hasCompression = $compression !== Compression::NONE; // skipped on files that are 20MB+ in size. + + // copy to import volume $migrationId = ID::unique(); $newPath = $deviceForImports->getPath('/' . $migrationId . '_' . $fileId . '.csv'); - if (!$deviceForFiles->transfer($path, $newPath, $deviceForImports)) { + + if ($hasCompression) { + $source = $deviceForFiles->read($path); + + switch ($compression) { + case Compression::ZSTD: + $source = (new Zstd())->decompress($source); + break; + case Compression::GZIP: + $source = (new GZIP())->decompress($source); + break; + } + + if (! $deviceForImports->write($newPath, $source, 'text/csv')) { + throw new \Exception("Unable to copy file"); + } + } elseif (! $deviceForFiles->transfer($path, $newPath, $deviceForImports)) { throw new \Exception("Unable to copy file"); } - $fileSize = $deviceForImports->getFileSize($path); + $fileSize = $deviceForImports->getFileSize($newPath); $resources = Transfer::extractServices([Transfer::GROUP_DATABASES]); $migration = $dbForProject->createDocument('migrations', new Document([ From 21be8190252521546082fee380ce3da611d2ec77 Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Mon, 21 Apr 2025 10:12:09 +0530 Subject: [PATCH 159/169] fix: test message! --- tests/e2e/Services/Migrations/MigrationsBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 45b57d6b0c..2628500c7d 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -1061,7 +1061,7 @@ trait MigrationsBase // fail on compressed, encrypted buckets! $this->assertEquals(400, $compressed['body']['code']); $this->assertEquals('storage_file_type_unsupported', $compressed['body']['type']); - $this->assertEquals('Only uncompressed, unencrypted CSV files can be used for document import.', $compressed['body']['message']); + $this->assertEquals('Only unencrypted CSV files can be used for document import.', $compressed['body']['message']); // missing attribute, fail in worker. $missingColumn = $this->performCsvMigration( From 0accc494f0e1d720440b88cc34c253c9d2ed1701 Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Mon, 21 Apr 2025 10:25:43 +0530 Subject: [PATCH 160/169] update: tests. --- .../Services/Migrations/MigrationsBase.php | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 2628500c7d..1c6698e53f 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -971,7 +971,7 @@ trait MigrationsBase $this->assertEquals($response['body']['required'], true); // make a bucket, upload a file to it! - // 1. enable compression, encryption + // 1. enable encryption $bucketOne = $this->client->call(Client::METHOD_POST, '/storage/buckets', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -989,7 +989,7 @@ trait MigrationsBase $bucketOneId = $bucketOne['body']['$id']; - // 2. no compression and encryption + // 2. no encryption $bucketTwo = $this->client->call(Client::METHOD_POST, '/storage/buckets', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -999,7 +999,7 @@ trait MigrationsBase 'name' => 'Test Bucket 2', 'maximumFileSize' => 2000000, //2MB 'allowedFileExtensions' => ['csv'], - 'compression' => 'none', + 'compression' => 'gzip', 'encryption' => false ]); @@ -1009,10 +1009,10 @@ trait MigrationsBase $bucketTwoId = $bucketTwo['body']['$id']; $bucketIds = [ - 'compressed' => $bucketOneId, - 'uncompressed' => $bucketTwoId, + 'encrypted' => $bucketOneId, + 'unencrypted' => $bucketTwoId, - // in uncompressed buckets! + // in unencrypted buckets! 'missing-row' => $bucketTwoId, 'missing-column' => $bucketTwoId, 'irrelevant-column' => $bucketTwoId, @@ -1049,19 +1049,19 @@ trait MigrationsBase $fileIds[$label] = $response['body']['$id']; } - // compressed, fail. - $compressed = $this->performCsvMigration( + // encrypted bucket, fail. + $encrypted = $this->performCsvMigration( [ - 'fileId' => $fileIds['compressed'], - 'bucketId' => $bucketIds['compressed'], + 'fileId' => $fileIds['encrypted'], + 'bucketId' => $bucketIds['encrypted'], 'resourceId' => $databaseId . ':' . $collectionId, ] ); // fail on compressed, encrypted buckets! - $this->assertEquals(400, $compressed['body']['code']); - $this->assertEquals('storage_file_type_unsupported', $compressed['body']['type']); - $this->assertEquals('Only unencrypted CSV files can be used for document import.', $compressed['body']['message']); + $this->assertEquals(400, $encrypted['body']['code']); + $this->assertEquals('storage_file_type_unsupported', $encrypted['body']['type']); + $this->assertEquals('Only unencrypted CSV files can be used for document import.', $encrypted['body']['message']); // missing attribute, fail in worker. $missingColumn = $this->performCsvMigration( @@ -1150,12 +1150,12 @@ trait MigrationsBase ); }, 60000, 500); - // no compression, no encryption, pass. + // no encryption, pass. $migration = $this->performCsvMigration( [ 'endpoint' => 'http://localhost/v1', - 'fileId' => $fileIds['uncompressed'], - 'bucketId' => $bucketIds['uncompressed'], + 'fileId' => $fileIds['unencrypted'], + 'bucketId' => $bucketIds['unencrypted'], 'resourceId' => $databaseId . ':' . $collectionId, ] ); From 927489bc5b4bae5ef561d1bbb8f6ee27c68030a8 Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Mon, 21 Apr 2025 12:04:36 +0530 Subject: [PATCH 161/169] update: handle decryption as well. --- app/controllers/api/migrations.php | 43 ++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index a19c6d3a22..afb27b2c94 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -4,6 +4,7 @@ use Appwrite\Auth\Auth; use Appwrite\Event\Event; use Appwrite\Event\Migration; use Appwrite\Extend\Exception; +use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -31,6 +32,7 @@ use Utopia\Storage\Compression\Algorithms\GZIP; use Utopia\Storage\Compression\Algorithms\Zstd; use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; +use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Integer; use Utopia\Validator\Text; @@ -347,29 +349,42 @@ App::post('/v1/migrations/csv') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND, 'File not found in ' . $path); } - if (!empty($file->getAttribute('openSSLCipher'))) { - throw new Exception(Exception::STORAGE_FILE_TYPE_UNSUPPORTED, "Only unencrypted CSV files can be used for document import."); - } - + // no encryption, compression on files above 20MB. + $hasEncryption = !empty($file->getAttribute('openSSLCipher')); $compression = $file->getAttribute('algorithm', Compression::NONE); - $hasCompression = $compression !== Compression::NONE; // skipped on files that are 20MB+ in size. + $hasCompression = $compression !== Compression::NONE; - // copy to import volume $migrationId = ID::unique(); $newPath = $deviceForImports->getPath('/' . $migrationId . '_' . $fileId . '.csv'); - if ($hasCompression) { + if ($hasEncryption || $hasCompression) { $source = $deviceForFiles->read($path); - switch ($compression) { - case Compression::ZSTD: - $source = (new Zstd())->decompress($source); - break; - case Compression::GZIP: - $source = (new GZIP())->decompress($source); - break; + // 1. decrypt + if ($hasEncryption) { + $source = OpenSSL::decrypt( + $source, + $file->getAttribute('openSSLCipher'), + System::getEnv('_APP_OPENSSL_KEY_V' . $file->getAttribute('openSSLVersion')), + 0, + hex2bin($file->getAttribute('openSSLIV')), + hex2bin($file->getAttribute('openSSLTag')) + ); } + // 2. decompress + if ($hasCompression) { + switch ($compression) { + case Compression::ZSTD: + $source = (new Zstd())->decompress($source); + break; + case Compression::GZIP: + $source = (new GZIP())->decompress($source); + break; + } + } + + // manual write after decryption and/or decompression if (! $deviceForImports->write($newPath, $source, 'text/csv')) { throw new \Exception("Unable to copy file"); } From 53a0424326705a8126ef4486ae91664937cc869d Mon Sep 17 00:00:00 2001 From: Darshan <itznotabug@gmail.com> Date: Mon, 21 Apr 2025 12:12:01 +0530 Subject: [PATCH 162/169] update: tests. --- .../Services/Migrations/MigrationsBase.php | 51 +++---------------- 1 file changed, 7 insertions(+), 44 deletions(-) diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 1c6698e53f..c241b38e3d 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -971,7 +971,6 @@ trait MigrationsBase $this->assertEquals($response['body']['required'], true); // make a bucket, upload a file to it! - // 1. enable encryption $bucketOne = $this->client->call(Client::METHOD_POST, '/storage/buckets', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -989,33 +988,11 @@ trait MigrationsBase $bucketOneId = $bucketOne['body']['$id']; - // 2. no encryption - $bucketTwo = $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 2', - 'maximumFileSize' => 2000000, //2MB - 'allowedFileExtensions' => ['csv'], - 'compression' => 'gzip', - 'encryption' => false - ]); - - $this->assertNotEmpty($bucketTwo['body']['$id']); - $this->assertEquals(201, $bucketTwo['headers']['status-code']); - - $bucketTwoId = $bucketTwo['body']['$id']; - $bucketIds = [ - 'encrypted' => $bucketOneId, - 'unencrypted' => $bucketTwoId, - - // in unencrypted buckets! - 'missing-row' => $bucketTwoId, - 'missing-column' => $bucketTwoId, - 'irrelevant-column' => $bucketTwoId, + 'default' => $bucketOneId, + 'missing-row' => $bucketOneId, + 'missing-column' => $bucketOneId, + 'irrelevant-column' => $bucketOneId, ]; $fileIds = []; @@ -1049,20 +1026,6 @@ trait MigrationsBase $fileIds[$label] = $response['body']['$id']; } - // encrypted bucket, fail. - $encrypted = $this->performCsvMigration( - [ - 'fileId' => $fileIds['encrypted'], - 'bucketId' => $bucketIds['encrypted'], - 'resourceId' => $databaseId . ':' . $collectionId, - ] - ); - - // fail on compressed, encrypted buckets! - $this->assertEquals(400, $encrypted['body']['code']); - $this->assertEquals('storage_file_type_unsupported', $encrypted['body']['type']); - $this->assertEquals('Only unencrypted CSV files can be used for document import.', $encrypted['body']['message']); - // missing attribute, fail in worker. $missingColumn = $this->performCsvMigration( [ @@ -1150,12 +1113,12 @@ trait MigrationsBase ); }, 60000, 500); - // no encryption, pass. + // all data exists, pass/ $migration = $this->performCsvMigration( [ 'endpoint' => 'http://localhost/v1', - 'fileId' => $fileIds['unencrypted'], - 'bucketId' => $bucketIds['unencrypted'], + 'fileId' => $fileIds['default'], + 'bucketId' => $bucketIds['default'], 'resourceId' => $databaseId . ':' . $collectionId, ] ); From b0d03c5109e4d5a0d6d1300aa122eb4de3c07066 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal <chiragaggarwal5k@gmail.com> Date: Mon, 21 Apr 2025 13:44:30 +0000 Subject: [PATCH 163/169] chore: update file security logic --- .../Modules/Storage/Http/Tokens/Buckets/Files/Action.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php index 524d25dc42..aec665f406 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Tokens/Buckets/Files/Action.php @@ -21,14 +21,14 @@ class Action extends UtopiaAction throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); - if (!$fileSecurity && !$valid) { + if (!$valid) { throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { + $fileSecurity = $bucket->getAttribute('fileSecurity', false); + if ($fileSecurity) { $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); } else { $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); From 1a33b75d4217ba258c23de28f10617d9a524f172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Tue, 22 Apr 2025 10:48:25 +0200 Subject: [PATCH 164/169] Fix html error page test --- tests/e2e/Services/Projects/ProjectsConsoleClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 4adf4b6847..c4a0975f06 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -4560,7 +4560,7 @@ class ProjectsConsoleClientTest extends Scope 'failure' => 'https://example.com' ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); + $this->assertStringContainsString('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']); /** Test oauth2 with devKey and now get oauth2 is disabled */ $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/' . $provider, [ From cb7aad9885c63e72aac3e0eab0a2304055bd5a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Tue, 22 Apr 2025 11:08:19 +0200 Subject: [PATCH 165/169] Improve code rabbit --- .coderabbit.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 0b8534b7c9..28656d3229 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -1,4 +1,9 @@ reviews: + path_filters: + - "!app/config/specs/**" + - "!docs/examples/**" + - "!docs/references/**" + - "!docs/sdks/**" auto_review: base_branches: - main From 8bd89441a4b8ce976facbdc511fed3e338d43936 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Tue, 22 Apr 2025 16:41:22 +0530 Subject: [PATCH 166/169] Add png logo --- app/views/general/error.phtml | 1 + public/images/logos/appwrite-icon.png | Bin 0 -> 1269 bytes public/images/logos/appwrite-icon.svg | 15 +++++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 public/images/logos/appwrite-icon.png diff --git a/app/views/general/error.phtml b/app/views/general/error.phtml index 1537676bca..801585d504 100644 --- a/app/views/general/error.phtml +++ b/app/views/general/error.phtml @@ -95,6 +95,7 @@ switch ($type) { <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> <link rel="icon" type="image/svg+xml" href="/images/logos/appwrite-icon.svg" /> + <link rel="mask-icon" type="image/png" href="/console/logos/appwrite-icon.png" /> <link rel="preload" href="/fonts/inter/inter-v8-latin-600.woff2" diff --git a/public/images/logos/appwrite-icon.png b/public/images/logos/appwrite-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5d993a6b337b7f9df297863bba24b97defed7861 GIT binary patch literal 1269 zcmV<R1Pc3!P)<h;3K|Lk000e1NJLTq002M$002M;1^@s6s%dfF00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH1aL`2K~#7F?VDXv z8%Gew|2?}<2~WB~bOZ1Mn97UA2?8gGI6$Q31c(z@kOSC00loq9ODe_>R!-o}38Fms zqmXvmJ!_)^3s~)ZEGxvXisDOJ)%>Tsx2L-ocx1UD1cqBl17FaPADhr<WQ;~c7(vOG z;U^4f&>!KR@GbyvCrv%cb`hy{Fk14LX7QUaB1J=HexsBc(BJ(5D#D8Z`7VFbT_$SD zB3f`K1<^ne9f=qz0^%e<zT3=QXl~1u8VCT15cExm0Rmtpz~zo>MiOe_KO!Q$mahZf z7ExLN+4Yvz{9-QO4uArBbbfLKPm~gXH@nX@af16Nm0-E!!y4uiz?eLL=2K4r&KGGG ztG(5~`a?KSC_o<QG@sp<$rmtUsQvi7{~DIuDL~B^KSe~?vlZc10dlkd#AgiNK>Zns zJM7rFgSz!UANg=W7H?=o6Mbqd7A3h+0N&~x)+E}Op(#Q71xhmG0^j^zf54(bd=S0; zvp?_4XDom<pJI_=IxOP~@zq}@n@O9Yef#}L@>q$``XAQOh$A`Z2$YG*D!magJ@XuE z8sA-EXPy^dbAfED`@z>O&m3YhImE2YafmTHmTBFS_dEmp`Ft&z;yj-{6~OF1kuDuX zZn$EqN$sy#oZhBF0KdZ#vjOVuaiJAV1<1BK@8z45DKhXXT2qN@h3DewABnieb2y@6 z^@Iv?gFFac{F<1BJ1t%VNAdYd+edk8Rib#t>Ind+Yw3yJEqYBZK$J;Q!{vhr$1CS2 zJ$PjGU4O_*9l(vkb>%ML6#T^J)z4yTfeM@BtxivYtYd<TY40vKAlJml<secARF;{_ ztsN%PF7o0HiX0LjVmiix6H7gQT{0(FFro@~|4M_!E3vG-2@9C;1{IQh#IBb_?FW=? z^e2W>Ev_t4gaHDeV2QX*iV6wUA+i@Bic&lPtOcMfYvKW5EkM=qMiQh2X9TcHVdeH& zX~A^7W_PzLLIfZ?0YK}h5H&^+!Ij+4t!`(gO_nDoRiXGd1VEAIe_@IKoV8H_=D<eG zg=c#k!~*mHwlF!>5#~l~=Mvd%sOTadz@BC%<tqdvKdu8k1VYiUKQhN!*iy0%U;6Tz zooj=4k>>$sIt%tROfw}!Kr}5n=@|s^{Y&zam`O79s{RiS$Zc^*YqaC5H1@qx)ka{Z zWpVwqd*)#R#M|gfRZLT1)5U>1X4l>u)5U^ttu^M!3NA@S-Iq}6Rh=#3ngHYNq@}bz zgMU)F(+t^6fHMD&8Zk2;Fy8F+rBYf=f>Q%#j>GX-^`zdNVo8`0z$8YRXdg?$jRg_Y z+BVHjECF}U2`)oCD4Z0XY;|7x7+9z)g*8Fb^Vf`pZ-L#$Tt(59cPGh1jR~d3<tN)o zTPib$z6P1<fXxFF-UgZKfb}y&55*dspBghlD9zmk8mzvCx90{gHj@o0F(*EU9jhS7 zlcPqANM$W%5>e<EIbs{@sIG@lg5ZzNUM19&$0Lu}^A&<q?|$@UDyIMd01jnXNoGw= f04e|g00;m8000000Mb*F00000NkvXXu0mjfkoqn* literal 0 HcmV?d00001 diff --git a/public/images/logos/appwrite-icon.svg b/public/images/logos/appwrite-icon.svg index bd847aa86d..afbc1124c2 100644 --- a/public/images/logos/appwrite-icon.svg +++ b/public/images/logos/appwrite-icon.svg @@ -1,8 +1,11 @@ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path - d="M24.4429 16.4322V21.9096H10.7519C6.76318 21.9096 3.28044 19.7067 1.4171 16.4322C1.14622 15.9561 0.909137 15.4567 0.710264 14.9383C0.319864 13.9225 0.0744552 12.8325 0 11.6952V10.2143C0.0161646 9.96089 0.0416361 9.70942 0.0749451 9.46095C0.143032 8.95105 0.245898 8.45211 0.381093 7.96711C1.66006 3.36909 5.81877 0 10.7519 0C15.6851 0 19.8433 3.36909 21.1223 7.96711H15.2682C14.3072 6.4683 12.6437 5.4774 10.7519 5.4774C8.86017 5.4774 7.19668 6.4683 6.23562 7.96711C5.9427 8.42274 5.71542 8.92516 5.56651 9.46095C5.43425 9.93599 5.36371 10.4369 5.36371 10.9548C5.36371 12.5248 6.01324 13.94 7.05463 14.9383C8.01961 15.865 9.32061 16.4322 10.7519 16.4322H24.4429Z" - fill="#FD366E" /> - <path - d="M24.4429 9.46094V14.9383H14.4492C15.4906 13.94 16.1401 12.5248 16.1401 10.9548C16.1401 10.4369 16.0696 9.93598 15.9373 9.46094H24.4429Z" - fill="#FD366E" /> + <g clip-path="url(#clip0_28_719)"> + <path d="M24.4429 17.4322V22.9096H10.7519C6.76318 22.9096 3.28044 20.7067 1.4171 17.4322C1.14622 16.9561 0.909137 16.4567 0.710264 15.9383C0.319864 14.9225 0.0744552 13.8325 0 12.6952V11.2143C0.0161646 10.9609 0.0416361 10.7094 0.0749451 10.4609C0.143032 9.95105 0.245898 9.45211 0.381093 8.96711C1.66006 4.36909 5.81877 1 10.7519 1C15.6851 1 19.8433 4.36909 21.1223 8.96711H15.2682C14.3072 7.4683 12.6437 6.4774 10.7519 6.4774C8.86017 6.4774 7.19668 7.4683 6.23562 8.96711C5.9427 9.42274 5.71542 9.92516 5.56651 10.4609C5.43425 10.936 5.36371 11.4369 5.36371 11.9548C5.36371 13.5248 6.01324 14.94 7.05463 15.9383C8.01961 16.865 9.32061 17.4322 10.7519 17.4322H24.4429Z" fill="#FD366E" /> + <path d="M24.4429 10.4609V15.9383H14.4492C15.4906 14.94 16.1401 13.5248 16.1401 11.9548C16.1401 11.4369 16.0696 10.936 15.9373 10.4609H24.4429Z" fill="#FD366E" /> + </g> + <defs> + <clipPath id="clip0_28_719"> + <rect width="24" height="24" fill="white" /> + </clipPath> + </defs> </svg> \ No newline at end of file From 9c2064a5ce642293b1b9db16b59cec24347b2a6d Mon Sep 17 00:00:00 2001 From: Khushboo Verma <khush.vv@gmail.com> Date: Tue, 22 Apr 2025 16:52:29 +0530 Subject: [PATCH 167/169] dynamic urls --- app/views/general/error.phtml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/views/general/error.phtml b/app/views/general/error.phtml index 801585d504..c6457ce98f 100644 --- a/app/views/general/error.phtml +++ b/app/views/general/error.phtml @@ -1,4 +1,6 @@ <?php +use Utopia\System\System; + $development = $this->getParam('development', false); $type = $this->getParam('type', 'general_server_error'); $code = $this->getParam('code', 500); @@ -12,6 +14,15 @@ $label = ''; $labelClass = ''; $buttons = []; +$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; +$hostname = System::getEnv('_APP_DOMAIN'); +// TODO: remove this later +if (System::getEnv('_APP_ENV') === 'development') { + $hostname = 'localhost'; +} + +$url = $protocol . '://' . $hostname; + if($exception !== null && method_exists($exception, 'getCTAs')) { foreach ($exception->getCTAs() as $index => $cta) { $class = ($index === 0) ? 'bordered-button' : 'button'; @@ -94,8 +105,8 @@ switch ($type) { <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script> - <link rel="icon" type="image/svg+xml" href="/images/logos/appwrite-icon.svg" /> - <link rel="mask-icon" type="image/png" href="/console/logos/appwrite-icon.png" /> + <link rel="icon" type="image/svg+xml" href="<?php echo $url; ?>/images/logos/appwrite-icon.svg" /> + <link rel="mask-icon" type="image/png" href="<?php echo $url; ?>/images/logos/appwrite-icon.png" /> <link rel="preload" href="/fonts/inter/inter-v8-latin-600.woff2" From 00f1723878be451aa6d38f3ad88c9f9a4b90a867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Tue, 22 Apr 2025 12:18:30 +0000 Subject: [PATCH 168/169] Fix merge conflict --- .github/workflows/tests.yml | 82 ------------------------------------- 1 file changed, 82 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 309cf38fa8..dbf307f962 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -359,85 +359,3 @@ jobs: -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys - - benchmarking: - name: Benchmark - runs-on: ubuntu-latest - needs: setup - permissions: - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Load Cache - uses: actions/cache@v4 - with: - key: ${{ env.CACHE_KEY }} - path: /tmp/${{ env.IMAGE }}.tar - fail-on-cache-miss: true - - name: Load and Start Appwrite - run: | - sed -i 's/traefik/localhost/g' .env - docker load --input /tmp/${{ env.IMAGE }}.tar - docker compose up -d - sleep 10 - - name: Install Oha - run: | - echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list - sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg - sudo apt update - sudo apt install oha - - name: Benchmark PR - run: oha -z 180s http://localhost/v1/health/version -j > benchmark.json - - name: Cleaning - run: docker compose down -v - - name: Installing latest version - run: | - rm docker-compose.yml - rm .env - curl https://appwrite.io/install/compose -o docker-compose.yml - curl https://appwrite.io/install/env -o .env - sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env - docker compose up -d - sleep 10 - - name: Benchmark Latest - run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json - - name: Prepare comment - run: | - echo '## :sparkles: Benchmark results' > benchmark.txt - echo ' ' >> benchmark.txt - echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt - echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt - echo " " >> benchmark.txt - echo " " >> benchmark.txt - echo "## :zap: Benchmark Comparison" >> benchmark.txt - echo " " >> benchmark.txt - echo "| Metric | This PR | Latest version | " >> benchmark.txt - echo "| --- | --- | --- | " >> benchmark.txt - echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt - echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt - - name: Save results - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: benchmark.json - path: benchmark.json - retention-days: 7 - - name: Find Comment - if: github.event.pull_request.head.repo.full_name == github.repository - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Benchmark results - - name: Comment on PR - if: github.event.pull_request.head.repo.full_name == github.repository - uses: peter-evans/create-or-update-comment@v4 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body-path: benchmark.txt - edit-mode: replace From 21f3221a219ac84cdc5a480bcd4e474ccdea8f8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= <matejbaco2000@gmail.com> Date: Tue, 22 Apr 2025 12:21:10 +0000 Subject: [PATCH 169/169] Fix consistency with previous implementation --- .github/workflows/benchmark.yml | 69 +++++++-------------------------- 1 file changed, 13 insertions(+), 56 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 88aa112db4..6d73787d00 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -59,85 +59,42 @@ jobs: docker compose up -d sleep 10 - name: Install Oha - run: > - echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] - http://packages.azlux.fr/debian/ stable main" | sudo tee - /etc/apt/sources.list.d/azlux.list - - sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg - https://azlux.fr/repo.gpg - + run: | + echo "deb [signed-by=/usr/share/keyrings/azlux-archive-keyring.gpg] http://packages.azlux.fr/debian/ stable main" | sudo tee /etc/apt/sources.list.d/azlux.list + sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg sudo apt update - sudo apt install oha - name: Benchmark PR run: 'oha -z 180s http://localhost/v1/health/version -j > benchmark.json' - name: Cleaning run: docker compose down -v - name: Installing latest version - run: > + run: | rm docker-compose.yml - rm .env - curl https://appwrite.io/install/compose -o docker-compose.yml - curl https://appwrite.io/install/env -o .env - - sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' - .env - + sed -i 's/_APP_OPTIONS_ABUSE=enabled/_APP_OPTIONS_ABUSE=disabled/g' .env docker compose up -d - sleep 10 - name: Benchmark Latest - run: >- - oha -z 180s http://localhost/v1/health/version -j > - benchmark-latest.json + run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json - name: Prepare comment - run: > + run: | echo '## :sparkles: Benchmark results' > benchmark.txt - echo ' ' >> benchmark.txt - - echo "- Requests per second: $(jq -r - '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark.json)" >> benchmark.txt - - echo "- Requests with 200 status code: $(jq -r - '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark.json)" >> benchmark.txt - - echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json - )" >> benchmark.txt - + echo "- Requests per second: $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt + echo "- Requests with 200 status code: $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json)" >> benchmark.txt + echo "- P99 latency: $(jq -r '.latencyPercentiles.p99' benchmark.json )" >> benchmark.txt echo " " >> benchmark.txt - echo " " >> benchmark.txt - echo "## :zap: Benchmark Comparison" >> benchmark.txt - echo " " >> benchmark.txt - echo "| Metric | This PR | Latest version | " >> benchmark.txt - echo "| --- | --- | --- | " >> benchmark.txt - - echo "| RPS | $(jq -r - '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark.json) | $(jq -r - '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark-latest.json) | " >> benchmark.txt - - echo "| 200 | $(jq -r - '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark.json) | $(jq -r - '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' - benchmark-latest.json) | " >> benchmark.txt - - echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | - $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> - benchmark.txt + echo "| RPS | $(jq -r '.summary.requestsPerSec|tonumber?|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.summary.requestsPerSec|tonumber|floor|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt + echo "| 200 | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark.json) | $(jq -r '.statusCodeDistribution."200"|tostring|[while(length>0;.[:-3])|.[-3:]]|reverse|join(",")' benchmark-latest.json) | " >> benchmark.txt + echo "| P99 | $(jq -r '.latencyPercentiles.p99' benchmark.json ) | $(jq -r '.latencyPercentiles.p99' benchmark-latest.json ) | " >> benchmark.txt - name: Save results uses: actions/upload-artifact@v4 if: '${{ !cancelled() }}'