From 4e780c0f7555e8ee7d86521041794155feaa70ea Mon Sep 17 00:00:00 2001 From: Richard Choi Date: Tue, 3 Sep 2024 16:22:30 +0000 Subject: [PATCH 1/2] Change API reference endpoints to sentence casing --- app/controllers/api/account.php | 20 ++++++++++---------- app/controllers/api/locale.php | 2 +- app/controllers/api/project.php | 10 +++++----- app/controllers/api/projects.php | 2 +- app/controllers/api/proxy.php | 10 +++++----- app/controllers/api/storage.php | 2 +- app/controllers/api/users.php | 20 ++++++++++---------- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index bbd4d31420..89829cdd2e 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3542,7 +3542,7 @@ App::patch('/v1/account/mfa') }); App::get('/v1/account/mfa/factors') - ->desc('List Factors') + ->desc('List factors') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) @@ -3574,7 +3574,7 @@ App::get('/v1/account/mfa/factors') }); App::post('/v1/account/mfa/authenticators/:type') - ->desc('Create Authenticator') + ->desc('Create authenticator') ->groups(['api', 'account']) ->label('event', 'users.[userId].update.mfa') ->label('scope', 'account') @@ -3646,7 +3646,7 @@ App::post('/v1/account/mfa/authenticators/:type') }); App::put('/v1/account/mfa/authenticators/:type') - ->desc('Verify Authenticator') + ->desc('Verify authenticator') ->groups(['api', 'account']) ->label('event', 'users.[userId].update.mfa') ->label('scope', 'account') @@ -3711,7 +3711,7 @@ App::put('/v1/account/mfa/authenticators/:type') }); App::post('/v1/account/mfa/recovery-codes') - ->desc('Create MFA Recovery Codes') + ->desc('Create MFA recovery codes') ->groups(['api', 'account']) ->label('event', 'users.[userId].update.mfa') ->label('scope', 'account') @@ -3753,7 +3753,7 @@ App::post('/v1/account/mfa/recovery-codes') }); App::patch('/v1/account/mfa/recovery-codes') - ->desc('Regenerate MFA Recovery Codes') + ->desc('Regenerate MFA recovery codes') ->groups(['api', 'account', 'mfaProtected']) ->label('event', 'users.[userId].update.mfa') ->label('scope', 'account') @@ -3794,7 +3794,7 @@ App::patch('/v1/account/mfa/recovery-codes') }); App::get('/v1/account/mfa/recovery-codes') - ->desc('Get 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]) @@ -3824,7 +3824,7 @@ App::get('/v1/account/mfa/recovery-codes') }); App::delete('/v1/account/mfa/authenticators/:type') - ->desc('Delete Authenticator') + ->desc('Delete authenticator') ->groups(['api', 'account']) ->label('event', 'users.[userId].delete.mfa') ->label('scope', 'account') @@ -3884,7 +3884,7 @@ App::delete('/v1/account/mfa/authenticators/:type') }); App::post('/v1/account/mfa/challenge') - ->desc('Create MFA Challenge') + ->desc('Create MFA challenge') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') ->label('event', 'users.[userId].challenges.[challengeId].create') @@ -4072,7 +4072,7 @@ App::post('/v1/account/mfa/challenge') }); App::put('/v1/account/mfa/challenge') - ->desc('Create MFA Challenge (confirmation)') + ->desc('Create MFA challenge (confirmation)') ->groups(['api', 'account', 'mfa']) ->label('scope', 'account') ->label('event', 'users.[userId].sessions.[sessionId].create') @@ -4333,7 +4333,7 @@ App::delete('/v1/account/targets/:targetId/push') $response->noContent(); }); App::get('/v1/account/identities') - ->desc('List Identities') + ->desc('List identities') ->groups(['api', 'account']) ->label('scope', 'account') ->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_JWT]) diff --git a/app/controllers/api/locale.php b/app/controllers/api/locale.php index abb47ab3c4..2917bc8416 100644 --- a/app/controllers/api/locale.php +++ b/app/controllers/api/locale.php @@ -69,7 +69,7 @@ App::get('/v1/locale') }); App::get('/v1/locale/codes') - ->desc('List 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]) diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 6728a3e0ab..84e6fb5173 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -243,7 +243,7 @@ App::get('/v1/project/usage') // Variables App::post('/v1/project/variables') - ->desc('Create Variable') + ->desc('Create variable') ->groups(['api']) ->label('scope', 'projects.write') ->label('audits.event', 'variable.create') @@ -298,7 +298,7 @@ App::post('/v1/project/variables') }); App::get('/v1/project/variables') - ->desc('List Variables') + ->desc('List variables') ->groups(['api']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -323,7 +323,7 @@ App::get('/v1/project/variables') }); App::get('/v1/project/variables/:variableId') - ->desc('Get Variable') + ->desc('Get variable') ->groups(['api']) ->label('scope', 'projects.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -347,7 +347,7 @@ App::get('/v1/project/variables/:variableId') }); App::put('/v1/project/variables/:variableId') - ->desc('Update Variable') + ->desc('Update variable') ->groups(['api']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -393,7 +393,7 @@ App::put('/v1/project/variables/:variableId') }); App::delete('/v1/project/variables/:variableId') - ->desc('Delete Variable') + ->desc('Delete variable') ->groups(['api']) ->label('scope', 'projects.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index b9b8ad4750..c39347c9e9 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -362,7 +362,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]) diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index f60a639302..84484a7209 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -23,7 +23,7 @@ use Utopia\Validator\WhiteList; App::post('/v1/proxy/rules') ->groups(['api', 'proxy']) - ->desc('Create Rule') + ->desc('Create rule') ->label('scope', 'rules.write') ->label('event', 'rules.[ruleId].create') ->label('audits.event', 'rule.create') @@ -149,7 +149,7 @@ App::post('/v1/proxy/rules') App::get('/v1/proxy/rules') ->groups(['api', 'proxy']) - ->desc('List Rules') + ->desc('List rules') ->label('scope', 'rules.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'proxy') @@ -212,7 +212,7 @@ App::get('/v1/proxy/rules') App::get('/v1/proxy/rules/:ruleId') ->groups(['api', 'proxy']) - ->desc('Get Rule') + ->desc('Get rule') ->label('scope', 'rules.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'proxy') @@ -241,7 +241,7 @@ App::get('/v1/proxy/rules/:ruleId') App::delete('/v1/proxy/rules/:ruleId') ->groups(['api', 'proxy']) - ->desc('Delete Rule') + ->desc('Delete rule') ->label('scope', 'rules.write') ->label('event', 'rules.[ruleId].delete') ->label('audits.event', 'rules.delete') @@ -277,7 +277,7 @@ App::delete('/v1/proxy/rules/:ruleId') }); App::patch('/v1/proxy/rules/:ruleId/verification') - ->desc('Update Rule Verification Status') + ->desc('Update rule verification status') ->groups(['api', 'proxy']) ->label('scope', 'rules.write') ->label('event', 'rules.[ruleId].update') diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index d98b5d8faf..16a8d772f5 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -1550,7 +1550,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') }); App::delete('/v1/storage/buckets/:bucketId/files/:fileId') - ->desc('Delete File') + ->desc('Delete file') ->groups(['api', 'storage']) ->label('scope', 'files.write') ->label('event', 'buckets.[bucketId].files.[fileId].delete') diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index dcc214972b..e91f1d5259 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -450,7 +450,7 @@ App::post('/v1/users/scrypt-modified') }); App::post('/v1/users/:userId/targets') - ->desc('Create User Target') + ->desc('Create user target') ->groups(['api', 'users']) ->label('audits.event', 'target.create') ->label('audits.resource', 'target/response.$id') @@ -645,7 +645,7 @@ App::get('/v1/users/:userId/prefs') }); App::get('/v1/users/:userId/targets/:targetId') - ->desc('Get User Target') + ->desc('Get user target') ->groups(['api', 'users']) ->label('scope', 'targets.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) @@ -846,7 +846,7 @@ App::get('/v1/users/:userId/logs') }); App::get('/v1/users/:userId/targets') - ->desc('List User Targets') + ->desc('List user targets') ->groups(['api', 'users']) ->label('scope', 'targets.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_ADMIN]) @@ -901,7 +901,7 @@ App::get('/v1/users/:userId/targets') }); App::get('/v1/users/identities') - ->desc('List Identities') + ->desc('List identities') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('sdk.auth', [APP_AUTH_TYPE_KEY]) @@ -1423,7 +1423,7 @@ App::patch('/v1/users/:userId/prefs') }); App::patch('/v1/users/:userId/targets/:targetId') - ->desc('Update User target') + ->desc('Update user target') ->groups(['api', 'users']) ->label('audits.event', 'target.update') ->label('audits.resource', 'target/{response.$id}') @@ -1555,7 +1555,7 @@ App::patch('/v1/users/:userId/mfa') }); App::get('/v1/users/:userId/mfa/factors') - ->desc('List Factors') + ->desc('List factors') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') @@ -1588,7 +1588,7 @@ App::get('/v1/users/:userId/mfa/factors') }); App::get('/v1/users/:userId/mfa/recovery-codes') - ->desc('Get MFA Recovery Codes') + ->desc('Get MFA recovery codes') ->groups(['api', 'users']) ->label('scope', 'users.read') ->label('usage.metric', 'users.{scope}.requests.read') @@ -1623,7 +1623,7 @@ App::get('/v1/users/:userId/mfa/recovery-codes') }); App::patch('/v1/users/:userId/mfa/recovery-codes') - ->desc('Create MFA Recovery Codes') + ->desc('Create MFA recovery codes') ->groups(['api', 'users']) ->label('event', 'users.[userId].create.mfa.recovery-codes') ->label('scope', 'users.write') @@ -1669,7 +1669,7 @@ App::patch('/v1/users/:userId/mfa/recovery-codes') }); App::put('/v1/users/:userId/mfa/recovery-codes') - ->desc('Regenerate MFA Recovery Codes') + ->desc('Regenerate MFA recovery codes') ->groups(['api', 'users']) ->label('event', 'users.[userId].update.mfa.recovery-codes') ->label('scope', 'users.write') @@ -1714,7 +1714,7 @@ App::put('/v1/users/:userId/mfa/recovery-codes') }); App::delete('/v1/users/:userId/mfa/authenticators/:type') - ->desc('Delete Authenticator') + ->desc('Delete authenticator') ->groups(['api', 'users']) ->label('event', 'users.[userId].delete.mfa') ->label('scope', 'users.write') From 08b539ba058e243a755d6bf708e71cae3660907a Mon Sep 17 00:00:00 2001 From: Richard Choi Date: Tue, 3 Sep 2024 16:32:11 +0000 Subject: [PATCH 2/2] change API reference endpoints to sentence case --- app/controllers/api/avatars.php | 6 +++--- app/controllers/api/console.php | 2 +- app/controllers/api/migrations.php | 30 +++++++++++++++--------------- app/controllers/api/vcs.php | 12 ++++++------ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index a3bd47595d..fcff3e4179 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -550,7 +550,7 @@ App::get('/v1/avatars/initials') }); App::get('/v1/cards/cloud') - ->desc('Get Front Of Cloud Card') + ->desc('Get front Of Cloud Card') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache', true) @@ -757,7 +757,7 @@ App::get('/v1/cards/cloud') }); App::get('/v1/cards/cloud-back') - ->desc('Get Back Of Cloud Card') + ->desc('Get back Of Cloud Card') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache', true) @@ -835,7 +835,7 @@ App::get('/v1/cards/cloud-back') }); App::get('/v1/cards/cloud-og') - ->desc('Get OG Image From Cloud Card') + ->desc('Get OG image From Cloud Card') ->groups(['api', 'avatars']) ->label('scope', 'avatars.read') ->label('cache', true) diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index 82d7c75592..eeb823a3d3 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -57,7 +57,7 @@ App::get('/v1/console/variables') }); App::post('/v1/console/assistant') - ->desc('Ask Query') + ->desc('Ask query') ->groups(['api', 'assistant']) ->label('scope', 'assistant.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 3899b26ad4..374a5575a7 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -33,7 +33,7 @@ include_once __DIR__ . '/../shared/api.php'; App::post('/v1/migrations/appwrite') ->groups(['api', 'migrations']) - ->desc('Migrate Appwrite Data') + ->desc('Migrate Appwrite data') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') @@ -87,7 +87,7 @@ App::post('/v1/migrations/appwrite') App::post('/v1/migrations/firebase/oauth') ->groups(['api', 'migrations']) - ->desc('Migrate Firebase Data (OAuth)') + ->desc('Migrate Firebase data (OAuth)') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') @@ -189,7 +189,7 @@ App::post('/v1/migrations/firebase/oauth') App::post('/v1/migrations/firebase') ->groups(['api', 'migrations']) - ->desc('Migrate Firebase Data (Service Account)') + ->desc('Migrate Firebase data (Service Account)') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') @@ -249,7 +249,7 @@ App::post('/v1/migrations/firebase') App::post('/v1/migrations/supabase') ->groups(['api', 'migrations']) - ->desc('Migrate Supabase Data') + ->desc('Migrate Supabase data') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') @@ -309,7 +309,7 @@ App::post('/v1/migrations/supabase') App::post('/v1/migrations/nhost') ->groups(['api', 'migrations']) - ->desc('Migrate NHost Data') + ->desc('Migrate NHost data') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].create') ->label('audits.event', 'migration.create') @@ -371,7 +371,7 @@ App::post('/v1/migrations/nhost') App::get('/v1/migrations') ->groups(['api', 'migrations']) - ->desc('List Migrations') + ->desc('List migrations') ->label('scope', 'migrations.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'migrations') @@ -424,7 +424,7 @@ App::get('/v1/migrations') App::get('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) - ->desc('Get Migration') + ->desc('Get migration') ->label('scope', 'migrations.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'migrations') @@ -448,7 +448,7 @@ App::get('/v1/migrations/:migrationId') App::get('/v1/migrations/appwrite/report') ->groups(['api', 'migrations']) - ->desc('Generate a report on Appwrite Data') + ->desc('Generate a report on Appwrite data') ->label('scope', 'migrations.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'migrations') @@ -490,7 +490,7 @@ App::get('/v1/migrations/appwrite/report') App::get('/v1/migrations/firebase/report') ->groups(['api', 'migrations']) - ->desc('Generate a report on Firebase Data') + ->desc('Generate a report on Firebase data') ->label('scope', 'migrations.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'migrations') @@ -537,7 +537,7 @@ App::get('/v1/migrations/firebase/report') App::get('/v1/migrations/firebase/report/oauth') ->groups(['api', 'migrations']) - ->desc('Generate a report on Firebase Data using OAuth') + ->desc('Generate a report on Firebase data using OAuth') ->label('scope', 'migrations.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) ->label('sdk.namespace', 'migrations') @@ -627,7 +627,7 @@ App::get('/v1/migrations/firebase/report/oauth') }); App::get('/v1/migrations/firebase/connect') - ->desc('Authorize with firebase') + ->desc('Authorize with Firebase') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -781,7 +781,7 @@ App::get('/v1/migrations/firebase/redirect') }); App::get('/v1/migrations/firebase/projects') - ->desc('List Firebase Projects') + ->desc('List Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.read') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -870,7 +870,7 @@ App::get('/v1/migrations/firebase/projects') }); App::get('/v1/migrations/firebase/deauthorize') - ->desc('Revoke Appwrite\'s authorization to access Firebase Projects') + ->desc('Revoke Appwrite\'s authorization to access Firebase projects') ->groups(['api', 'migrations']) ->label('scope', 'migrations.write') ->label('sdk.auth', [APP_AUTH_TYPE_ADMIN]) @@ -985,7 +985,7 @@ App::get('/v1/migrations/nhost/report') App::patch('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) - ->desc('Retry Migration') + ->desc('Retry migration') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].retry') ->label('audits.event', 'migration.retry') @@ -1030,7 +1030,7 @@ App::patch('/v1/migrations/:migrationId') App::delete('/v1/migrations/:migrationId') ->groups(['api', 'migrations']) - ->desc('Delete Migration') + ->desc('Delete migration') ->label('scope', 'migrations.write') ->label('event', 'migrations.[migrationId].delete') ->label('audits.event', 'migrationId.delete') diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 2ffe8687ea..3c01112a5d 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -263,7 +263,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId }; App::get('/v1/vcs/github/authorize') - ->desc('Install GitHub App') + ->desc('Install GitHub app') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') ->label('sdk.namespace', 'vcs') @@ -305,7 +305,7 @@ App::get('/v1/vcs/github/authorize') }); App::get('/v1/vcs/github/callback') - ->desc('Capture installation and authorization from GitHub App') + ->desc('Capture installation and authorization from GitHub app') ->groups(['api', 'vcs']) ->label('scope', 'public') ->label('error', __DIR__ . '/../../views/general/error.phtml') @@ -536,7 +536,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories/:pr }); App::get('/v1/vcs/github/installations/:installationId/providerRepositories') - ->desc('List Repositories') + ->desc('List repositories') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') ->label('sdk.namespace', 'vcs') @@ -780,7 +780,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro }); App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:providerRepositoryId/branches') - ->desc('List Repository Branches') + ->desc('List repository branches') ->groups(['api', 'vcs']) ->label('scope', 'vcs.read') ->label('sdk.namespace', 'vcs') @@ -829,7 +829,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro }); App::post('/v1/vcs/github/events') - ->desc('Create Event') + ->desc('Create event') ->groups(['api', 'vcs']) ->label('scope', 'public') ->inject('gitHub') @@ -1057,7 +1057,7 @@ App::get('/v1/vcs/installations/:installationId') }); App::delete('/v1/vcs/installations/:installationId') - ->desc('Delete Installation') + ->desc('Delete installation') ->groups(['api', 'vcs']) ->label('scope', 'vcs.write') ->label('sdk.namespace', 'vcs')