From 429dabaaeefef785c9f8bee3d515fb4a4412a8b1 Mon Sep 17 00:00:00 2001 From: shimon Date: Tue, 3 Oct 2023 19:50:48 +0300 Subject: [PATCH] sync with 1.4 --- app/assets/fonts/inter-v8-latin-regular.woff2 | Bin 0 -> 16608 bytes app/controllers/api/account.php | 14 +- app/controllers/api/functions.php | 4 +- app/controllers/api/health.php | 170 +++++++++++++++--- app/controllers/api/projects.php | 56 +++--- app/controllers/api/storage.php | 2 +- app/controllers/api/users.php | 54 +++--- src/Appwrite/Platform/Workers/Mails.php | 3 +- 8 files changed, 210 insertions(+), 93 deletions(-) create mode 100644 app/assets/fonts/inter-v8-latin-regular.woff2 diff --git a/app/assets/fonts/inter-v8-latin-regular.woff2 b/app/assets/fonts/inter-v8-latin-regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..56a570b2480ec79d40d67921b83878ad89b82fa5 GIT binary patch literal 16608 zcmV)XK&`)bPew8T0RR9106^dX5C8xG0Ji7=06>2L0RR9100000000000000000000 z0000Qb{pda9L5F)U_Vn-K~zWpg#-}@3W23ifrfhvg){&GHUcCAiev;J1%ws{APff^ z$)h!Fo7Oyo?tr4u(yysAgLxcej5*V&sF|D;DEt4vCp|@s9bh85jNf{C)JhadXf{3fgSc0-8N|+;% zMFEpmTRR^3=uTr?G6T8@U+DId(pFWDt_yNS{Yrv^9PQU2_ICcO1w0CF9 zFLcvW24Q;2EWAi7UPWG{n4V&ZM>qWmQlLM2(w|UTd5b}^AjJy{CEfI)dtnhTCdlMZ zKC?)9^bs0-r>?c*3#b=dmEU1}RKabYAR$R93U9rwp5d#t&3s7YL<*z`IhgLA_=`vc zSfsP+Hb{2&NHQG6iC_U?X6iuN&FsDG9wNZ#IeSitY#l_&^L+gEJNNx|+MrAl51bQ^ zhlj7V($2dOjysvIC_wLe`|#f!x`nXo0D#2u5iZ8A3$Twyqhy3unSYyF?R@?G6)brY zK8(U%_7znkF8~(JcE?|TzGn32YgQx4AbISV4y-u0C)w+Fmc3wEvMh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VQPU8-nXNi#Zwh+0 z>K>+rG4MRdf>~yuB_4AMSFDK38hnJaU4{{_Y7!<(0(jw8UBj8t-XX4av9LU|vw@46 z1mF?D*DtP(y5u_IWS4;DQj{QIo}oZ1aDK!JR`IfOw>}C3cHz<`hx$cV0#vG}ULXFN zJ&?@!cSb(}K7@oQc%L|U8uC^*1E|# z!cy%!$uYVUf|=RTJ=A^lY}92-XFz?{t-2uui=bsP`U`a}%{m23UrlZ}oxQ~bmU^|q zy=*n#*p8{WaZ;jF!z!mxH^JbAcz2zN&{k)%C3eAT7s_LYL!6B84n= z3P9M`5?UmIn%q(k!-5wrOKxbsw)M8+Un{E^uvHnkx2 zMaZ}Y{bjGUj+r^)D#@nMAP!`Qh3*(tHG3UM6B4=MhC`WKB0E;P>0{ZDrlwo7S1_z{ z)&RH^q{3h8JK1&+>oBC4rH%OPwdkep^G<-d0<-bYcFnaid9AEj`IiRHvavP(IGaIk zmZ8b-NCB4s`mM0w)eOtZ7{rm_ur=xIoiNpfSaeK0Z7r9U#Wjv%5I+_I#SFYe0B_ed z+EGHfecGvkDd1AGDJ30eXR?Wzt7Nx(+!$QKP97y0S%%*n_Dv9xF@LyZ=aGAn+&kWC zs|^y*<5b?^Q7`g)K7Agp!#KlII(#nVag3#$!9$C~xjfFmP%XY{&Ka(#^dk<&M!~PV ztrt}mwhl%i&Y#*@y*MmxA_tF%7CD&k|g~^BazujHp3M@t0&zWg(II}`I~J301)6R^T_fEw_nZ$Z%*w; z6gCwA%mQ*glFXV2;JDy|xX4avOvvHEf7Z?%GZmw>mY+)PocgLKo|D@^PW?)eEu|f!P=7bFd}W0~%3#BT jIED=#9kY!bEp;)_)x1NUh+!}N?;quQ+j_D+v#bRGZOF+c literal 0 HcmV?d00001 diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 1830886be..93df84a6f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -50,7 +50,7 @@ $oauthDefaultSuccess = '/auth/oauth2/success'; $oauthDefaultFailure = '/auth/oauth2/failure'; App::post('/v1/account') - ->desc('Create Account') + ->desc('Create account') ->groups(['api', 'account', 'auth']) ->label('event', 'users.[userId].create') ->label('scope', 'public') @@ -165,7 +165,7 @@ App::post('/v1/account') App::post('/v1/account/sessions/email') ->alias('/v1/account/sessions') - ->desc('Create Email Session') + ->desc('Create email session') ->groups(['api', 'account', 'auth', 'session']) ->label('event', 'users.[userId].sessions.[sessionId].create') ->label('scope', 'public') @@ -437,7 +437,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('dbForProject') ->inject('geodb') ->inject('queueForEvents') - ->action(function (string $provider, string $code, string $state, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { + ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { $protocol = $request->getProtocol(); $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); @@ -1110,7 +1110,7 @@ App::put('/v1/account/sessions/magic-url') ->inject('locale') ->inject('geodb') ->inject('queueForEvents') - ->action(function (string $userId, string $secret, Request $request, Response $response, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) { + ->action(function (string $userId, string $secret, Request $request, Response $response,Document $user, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) { /** @var Utopia\Database\Document $user */ @@ -1845,7 +1845,7 @@ App::patch('/v1/account/name') ->inject('user') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $name, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $name, ?\DateTime $requestTimestamp, Response $response, Document $user, Database $dbForProject, Event $queueForEvents) { $user->setAttribute('name', $name); @@ -1881,7 +1881,7 @@ App::patch('/v1/account/password') ->inject('project') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $password, string $oldPassword, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $password, string $oldPassword, ?\DateTime $requestTimestamp, Response $response, Document $user, Document $project, Database $dbForProject, Event $queueForEvents) { // Check old password only if its an existing user. if (!empty($user->getAttribute('passwordUpdate')) && !Auth::passwordVerify($oldPassword, $user->getAttribute('password'), $user->getAttribute('hash'), $user->getAttribute('hashOptions'))) { // Double check user password @@ -2148,7 +2148,7 @@ App::delete('/v1/account/sessions/:sessionId') ->inject('locale') ->inject('queueForEvents') ->inject('project') - ->action(function (?string $sessionId, Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Document $project) { + ->action(function (?string $sessionId, ?\DateTime $requestTimestamp, Request $request, Response $response, Document $user, Database $dbForProject, Locale $locale, Event $queueForEvents, Document $project) { $protocol = $request->getProtocol(); $authDuration = $project->getAttribute('auths', [])['duration'] ?? Auth::TOKEN_EXPIRATION_LOGIN_LONG; diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index b510f37b5..58ffb0ac9 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -521,7 +521,7 @@ App::get('/v1/functions/:functionId/usage') }); App::get('/v1/functions/usage') - ->desc('Get Functions Usage') + ->desc('Get functions usage') ->groups(['api', 'functions']) ->label('scope', 'functions.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1001,7 +1001,7 @@ App::post('/v1/functions/:functionId/deployments') ->inject('deviceFunctions') ->inject('deviceLocal') ->inject('queueForBuilds') - ->action(function (string $functionId, string $entrypoint, ?string $commands, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceFunctions, Device $deviceLocal, Build $queueForBuilds) { + ->action(function (string $functionId, mixed $entrypoint, ?string $commands, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Event $queueForEvents, Document $project, Device $deviceFunctions, Device $deviceLocal, Build $queueForBuilds) { $activate = filter_var($activate, FILTER_VALIDATE_BOOLEAN); diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 011063505..3b04b8f89 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -2,8 +2,15 @@ use Appwrite\ClamAV\Network; use Appwrite\Event\Audit; +use Appwrite\Event\Build; use Appwrite\Event\Certificate; +use Appwrite\Event\Database; +use Appwrite\Event\Delete; use Appwrite\Event\Event; +use Appwrite\Event\Func; +use Appwrite\Event\Mail; +use Appwrite\Event\Migration; +use Appwrite\Event\Phone; use Appwrite\Extend\Exception; use Appwrite\Utopia\Response; use Utopia\App; @@ -41,7 +48,7 @@ App::get('/v1/health') }); App::get('/v1/health/version') - ->desc('Get Version') + ->desc('Get version') ->groups(['api', 'health']) ->label('scope', 'public') ->label('sdk.response.code', Response::STATUS_CODE_OK) @@ -111,7 +118,7 @@ App::get('/v1/health/db') }); App::get('/v1/health/cache') - ->desc('Get Cache') + ->desc('Get cache') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -168,7 +175,7 @@ App::get('/v1/health/cache') }); App::get('/v1/health/queue') - ->desc('Get Queue') + ->desc('Get queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -225,7 +232,7 @@ App::get('/v1/health/queue') }); App::get('/v1/health/pubsub') - ->desc('Get PubSub') + ->desc('Get pubsub') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -282,7 +289,7 @@ App::get('/v1/health/pubsub') }); App::get('/v1/health/time') - ->desc('Get Time') + ->desc('Get time') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -339,7 +346,7 @@ App::get('/v1/health/time') }); App::get('/v1/health/queue/webhooks') - ->desc('Get Webhooks Queue') + ->desc('Get webhooks queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -349,15 +356,15 @@ App::get('/v1/health/queue/webhooks') ->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('queueForEvents') + ->inject('queue') ->inject('response') - ->action(function (Event $queueForEvents, Response $response) { - - $response->dynamic(new Document([ 'size' => $queueForEvents->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); - }, ['response']); + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::WEBHOOK_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize()]), Response::MODEL_HEALTH_QUEUE); + }); App::get('/v1/health/queue/logs') - ->desc('Get Logs Queue') + ->desc('Get logs queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -367,15 +374,15 @@ App::get('/v1/health/queue/logs') ->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('queueForAudits') + ->inject('queue') ->inject('response') - ->action(function (Audit $queueForAudits, Response $response) { - - $response->dynamic(new Document([ 'size' => $queueForAudits->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); - }, ['response']); + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::AUDITS_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); App::get('/v1/health/queue/certificates') - ->desc('Get Certificates Queue') + ->desc('Get certificates queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -385,15 +392,124 @@ App::get('/v1/health/queue/certificates') ->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('queueForCertificates') + ->inject('queue') ->inject('response') - ->action(function (Certificate $queueForCertificates, Response $response) { + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::CERTIFICATES_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::BUILDS_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::CERTIFICATES_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::DELETE_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::MAILS_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); - $response->dynamic(new Document([ 'size' => $queueForCertificates->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); }, ['response']); +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::MESSAGING_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + +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) + ->inject('queue') + ->inject('response') + ->action(function (Connection $queue, Response $response) { + $client = new Client(Event::MIGRATIONS_QUEUE_NAME, $queue); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); + App::get('/v1/health/queue/functions') - ->desc('Get Functions Queue') + ->desc('Get functions queue') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -407,11 +523,11 @@ App::get('/v1/health/queue/functions') ->inject('response') ->action(function (Connection $queue, Response $response) { $client = new Client(Event::FUNCTIONS_QUEUE_NAME, $queue); - $response->dynamic(new Document([ 'size' => $client->sumProcessingJobs() ]), Response::MODEL_HEALTH_QUEUE); - }, ['response']); + $response->dynamic(new Document([ 'size' => $client->getQueueSize() ]), Response::MODEL_HEALTH_QUEUE); + }); App::get('/v1/health/storage/local') - ->desc('Get Local Storage') + ->desc('Get local storage') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -454,7 +570,7 @@ App::get('/v1/health/storage/local') }); App::get('/v1/health/anti-virus') - ->desc('Get Antivirus') + ->desc('Get antivirus') ->groups(['api', 'health']) ->label('scope', 'health.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -493,7 +609,7 @@ App::get('/v1/health/anti-virus') }); App::get('/v1/health/stats') // Currently only used internally - ->desc('Get System Stats') + ->desc('Get system stats') ->groups(['api', 'health']) ->label('scope', 'root') // ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index ddcc19f4c..596702aa7 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -49,7 +49,7 @@ App::init() }); App::post('/v1/projects') - ->desc('Create Project') + ->desc('Create project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -220,7 +220,7 @@ App::post('/v1/projects') }); App::get('/v1/projects') - ->desc('List Projects') + ->desc('List projects') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -267,7 +267,7 @@ App::get('/v1/projects') }); App::get('/v1/projects/:projectId') - ->desc('Get Project') + ->desc('Get project') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -291,7 +291,7 @@ App::get('/v1/projects/:projectId') }); App::patch('/v1/projects/:projectId') - ->desc('Update Project') + ->desc('Update project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -338,7 +338,7 @@ App::patch('/v1/projects/:projectId') }); App::patch('/v1/projects/:projectId/team') - ->desc('Update Project Team') + ->desc('Update project team') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -443,7 +443,7 @@ App::patch('/v1/projects/:projectId/service/all') }); App::patch('/v1/projects/:projectId/oauth2') - ->desc('Update Project OAuth2') + ->desc('Update project OAuth2') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -487,7 +487,7 @@ App::patch('/v1/projects/:projectId/oauth2') }); App::patch('/v1/projects/:projectId/auth/limit') - ->desc('Update Project users limit') + ->desc('Update project users limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -518,7 +518,7 @@ App::patch('/v1/projects/:projectId/auth/limit') }); App::patch('/v1/projects/:projectId/auth/duration') - ->desc('Update Project Authentication Duration') + ->desc('Update project authentication duration') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -549,7 +549,7 @@ App::patch('/v1/projects/:projectId/auth/duration') }); 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.') + ->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]) @@ -676,7 +676,7 @@ App::patch('/v1/projects/:projectId/auth/personal-data') }); App::patch('/v1/projects/:projectId/auth/max-sessions') - ->desc('Update Project user sessions limit') + ->desc('Update project user sessions limit') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -707,7 +707,7 @@ App::patch('/v1/projects/:projectId/auth/max-sessions') }); App::delete('/v1/projects/:projectId') - ->desc('Delete Project') + ->desc('Delete project') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -742,7 +742,7 @@ App::delete('/v1/projects/:projectId') // Webhooks App::post('/v1/projects/:projectId/webhooks') - ->desc('Create Webhook') + ->desc('Create webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -798,7 +798,7 @@ App::post('/v1/projects/:projectId/webhooks') }); App::get('/v1/projects/:projectId/webhooks') - ->desc('List Webhooks') + ->desc('List webhooks') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -830,7 +830,7 @@ App::get('/v1/projects/:projectId/webhooks') }); App::get('/v1/projects/:projectId/webhooks/:webhookId') - ->desc('Get Webhook') + ->desc('Get webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -864,7 +864,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') }); App::put('/v1/projects/:projectId/webhooks/:webhookId') - ->desc('Update Webhook') + ->desc('Update webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -917,7 +917,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') }); App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') - ->desc('Update Webhook Signature Key') + ->desc('Update webhook signature key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -956,7 +956,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') }); App::delete('/v1/projects/:projectId/webhooks/:webhookId') - ->desc('Delete Webhook') + ->desc('Delete webhook') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -994,7 +994,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') // Keys App::post('/v1/projects/:projectId/keys') - ->desc('Create Key') + ->desc('Create key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1044,7 +1044,7 @@ App::post('/v1/projects/:projectId/keys') }); App::get('/v1/projects/:projectId/keys') - ->desc('List Keys') + ->desc('List keys') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1076,7 +1076,7 @@ App::get('/v1/projects/:projectId/keys') }); App::get('/v1/projects/:projectId/keys/:keyId') - ->desc('Get Key') + ->desc('Get key') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1110,7 +1110,7 @@ App::get('/v1/projects/:projectId/keys/:keyId') }); App::put('/v1/projects/:projectId/keys/:keyId') - ->desc('Update Key') + ->desc('Update key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1156,7 +1156,7 @@ App::put('/v1/projects/:projectId/keys/:keyId') }); App::delete('/v1/projects/:projectId/keys/:keyId') - ->desc('Delete Key') + ->desc('Delete key') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1195,7 +1195,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') // Platforms App::post('/v1/projects/:projectId/platforms') - ->desc('Create Platform') + ->desc('Create platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1245,7 +1245,7 @@ App::post('/v1/projects/:projectId/platforms') }); App::get('/v1/projects/:projectId/platforms') - ->desc('List Platforms') + ->desc('List platforms') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1277,7 +1277,7 @@ App::get('/v1/projects/:projectId/platforms') }); App::get('/v1/projects/:projectId/platforms/:platformId') - ->desc('Get Platform') + ->desc('Get platform') ->groups(['api', 'projects']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1311,7 +1311,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId') }); App::put('/v1/projects/:projectId/platforms/:platformId') - ->desc('Update Platform') + ->desc('Update platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1358,7 +1358,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId') }); App::delete('/v1/projects/:projectId/platforms/:platformId') - ->desc('Delete Platform') + ->desc('Delete platform') ->groups(['api', 'projects']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -1394,6 +1394,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') $response->noContent(); }); + // CUSTOM SMTP and Templates App::patch('/v1/projects/:projectId/smtp') ->desc('Update SMTP configuration') @@ -1525,6 +1526,7 @@ App::get('/v1/projects/:projectId/templates/sms/:type/:locale') $response->dynamic(new Document($template), Response::MODEL_SMS_TEMPLATE); }); + App::get('/v1/projects/:projectId/templates/email/:type/:locale') ->desc('Get custom email template') ->groups(['api', 'projects']) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 427f360f7..12fe61846 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1288,7 +1288,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') ->inject('user') ->inject('mode') ->inject('queueForEvents') - ->action(function (string $bucketId, string $fileId, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { + ->action(function (string $bucketId, string $fileId, ?string $name, ?array $permissions, Response $response, Database $dbForProject, Document $user, string $mode, Event $queueForEvents) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index ec7f82a29..15e6f2140 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -108,7 +108,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e } App::post('/v1/users') - ->desc('Create User') + ->desc('Create user') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -139,7 +139,7 @@ App::post('/v1/users') }); App::post('/v1/users/bcrypt') - ->desc('Create User with Bcrypt Password') + ->desc('Create user with bcrypt password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -169,7 +169,7 @@ App::post('/v1/users/bcrypt') }); App::post('/v1/users/md5') - ->desc('Create User with MD5 Password') + ->desc('Create user with MD5 password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -199,7 +199,7 @@ App::post('/v1/users/md5') }); App::post('/v1/users/argon2') - ->desc('Create User with Argon2 Password') + ->desc('Create user with Argon2 password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -229,7 +229,7 @@ App::post('/v1/users/argon2') }); App::post('/v1/users/sha') - ->desc('Create User with SHA Password') + ->desc('Create user with SHA password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -266,7 +266,7 @@ App::post('/v1/users/sha') }); App::post('/v1/users/phpass') - ->desc('Create User with PHPass Password') + ->desc('Create user with PHPass password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -296,7 +296,7 @@ App::post('/v1/users/phpass') }); App::post('/v1/users/scrypt') - ->desc('Create User with Scrypt Password') + ->desc('Create user with Scrypt password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -339,7 +339,7 @@ App::post('/v1/users/scrypt') }); App::post('/v1/users/scrypt-modified') - ->desc('Create User with Scrypt Modified Password') + ->desc('Create user with Scrypt modified password') ->groups(['api', 'users']) ->label('event', 'users.[userId].create') ->label('scope', 'users.write') @@ -372,7 +372,7 @@ App::post('/v1/users/scrypt-modified') }); App::get('/v1/users') - ->desc('List Users') + ->desc('List users') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -420,7 +420,7 @@ App::get('/v1/users') }); App::get('/v1/users/:userId') - ->desc('Get User') + ->desc('Get user') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -445,7 +445,7 @@ App::get('/v1/users/:userId') }); App::get('/v1/users/:userId/prefs') - ->desc('Get User Preferences') + ->desc('Get user preferences') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -472,7 +472,7 @@ App::get('/v1/users/:userId/prefs') }); App::get('/v1/users/:userId/sessions') - ->desc('List User Sessions') + ->desc('List user sessions') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -513,7 +513,7 @@ App::get('/v1/users/:userId/sessions') }); App::get('/v1/users/:userId/memberships') - ->desc('List User Memberships') + ->desc('List user memberships') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -552,7 +552,7 @@ App::get('/v1/users/:userId/memberships') }); App::get('/v1/users/:userId/logs') - ->desc('List User Logs') + ->desc('List user logs') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -681,7 +681,7 @@ App::get('/v1/users/identities') }); App::patch('/v1/users/:userId/status') - ->desc('Update User Status') + ->desc('Update user status') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.status') ->label('scope', 'users.write') @@ -717,9 +717,9 @@ App::patch('/v1/users/:userId/status') }); App::put('/v1/users/:userId/labels') - ->desc('Update User Labels') + ->desc('Update user labels') ->groups(['api', 'users']) - ->label('event', 'users.[userId].update.verification') + ->label('event', 'users.[userId].update.labels') ->label('scope', 'users.write') ->label('audits.event', 'user.update') ->label('audits.resource', 'user/{response.$id}') @@ -754,7 +754,7 @@ App::put('/v1/users/:userId/labels') }); App::patch('/v1/users/:userId/verification/phone') - ->desc('Update Phone Verification') + ->desc('Update phone verification') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.verification') ->label('scope', 'users.write') @@ -789,7 +789,7 @@ App::patch('/v1/users/:userId/verification/phone') }); App::patch('/v1/users/:userId/name') - ->desc('Update Name') + ->desc('Update name') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.name') ->label('scope', 'users.write') @@ -826,7 +826,7 @@ App::patch('/v1/users/:userId/name') }); App::patch('/v1/users/:userId/password') - ->desc('Update Password') + ->desc('Update password') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.password') ->label('scope', 'users.write') @@ -890,7 +890,7 @@ App::patch('/v1/users/:userId/password') }); App::patch('/v1/users/:userId/email') - ->desc('Update Email') + ->desc('Update email') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.email') ->label('scope', 'users.write') @@ -946,7 +946,7 @@ App::patch('/v1/users/:userId/email') }); App::patch('/v1/users/:userId/phone') - ->desc('Update Phone') + ->desc('Update phone') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.phone') ->label('scope', 'users.write') @@ -989,7 +989,7 @@ App::patch('/v1/users/:userId/phone') }); App::patch('/v1/users/:userId/verification') - ->desc('Update Email Verification') + ->desc('Update email verification') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.verification') ->label('scope', 'users.write') @@ -1024,7 +1024,7 @@ App::patch('/v1/users/:userId/verification') }); App::patch('/v1/users/:userId/prefs') - ->desc('Update User Preferences') + ->desc('Update user preferences') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.prefs') ->label('scope', 'users.write') @@ -1057,7 +1057,7 @@ App::patch('/v1/users/:userId/prefs') }); App::delete('/v1/users/:userId/sessions/:sessionId') - ->desc('Delete User Session') + ->desc('Delete user session') ->groups(['api', 'users']) ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('scope', 'users.write') @@ -1100,7 +1100,7 @@ App::delete('/v1/users/:userId/sessions/:sessionId') }); App::delete('/v1/users/:userId/sessions') - ->desc('Delete User Sessions') + ->desc('Delete user sessions') ->groups(['api', 'users']) ->label('event', 'users.[userId].sessions.[sessionId].delete') ->label('scope', 'users.write') @@ -1142,7 +1142,7 @@ App::delete('/v1/users/:userId/sessions') }); App::delete('/v1/users/:userId') - ->desc('Delete User') + ->desc('Delete user') ->groups(['api', 'users']) ->label('event', 'users.[userId].delete') ->label('scope', 'users.write') diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index 9db6594a1..b0cf28cae 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -57,8 +57,7 @@ class Mails extends Action $subject = $payload['subject']; $variables = $payload['variables']; $name = $payload['name']; - - $body = Template::fromFile(__DIR__ . '/../config/locale/templates/email-base.tpl'); + $body = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base.tpl'); foreach ($variables as $key => $value) { $body->setParam('{{' . $key . '}}', $value);