From 128ae4239c00d963f840a5fa956c641f0a401097 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 4 Jan 2020 09:44:03 +0200 Subject: [PATCH] Updated docs --- app/controllers/api/account.php | 26 +++++++++++++------------- app/controllers/api/graphql.php | 2 +- docs/services/account.md | 6 +++--- docs/services/auth.md | 3 --- docs/services/avatars.md | 4 ++-- docs/services/storage.md | 6 +++--- docs/services/teams.md | 2 +- docs/services/users.md | 2 +- 8 files changed, 24 insertions(+), 27 deletions(-) delete mode 100644 docs/services/auth.md diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 401344a821..60f483c3ae 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -29,7 +29,7 @@ $utopia->get('/v1/account') ->label('scope', 'account') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getAccount') - ->label('sdk.description', '/docs/references/account/get.md') + ->label('sdk.description', '/docs/references/account/get-account.md') ->action( function () use ($response, &$user, $providers) { $oauthKeys = []; @@ -61,7 +61,7 @@ $utopia->get('/v1/account/prefs') ->label('scope', 'account') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getAccountPrefs') - ->label('sdk.description', '/docs/references/account/get-prefs.md') + ->label('sdk.description', '/docs/references/account/get-account-prefs.md') ->action( function () use ($response, $user) { $prefs = $user->getAttribute('prefs', '{}'); @@ -85,7 +85,7 @@ $utopia->get('/v1/account/sessions') ->label('scope', 'account') ->label('sdk.namespace', 'account') ->label('sdk.method', 'getAccountSessions') - ->label('sdk.description', '/docs/references/account/get-sessions.md') + ->label('sdk.description', '/docs/references/account/get-account-sessions.md') ->action( function () use ($response, $user) { $tokens = $user->getAttribute('tokens', []); @@ -137,12 +137,12 @@ $utopia->get('/v1/account/sessions') } ); -$utopia->get('/v1/account/security') +$utopia->get('/v1/account/logs') ->desc('Get Account Security Log') ->label('scope', 'account') ->label('sdk.namespace', 'account') - ->label('sdk.method', 'getAccountSecurity') - ->label('sdk.description', '/docs/references/account/get-security.md') + ->label('sdk.method', 'getAccountLogs') + ->label('sdk.description', '/docs/references/account/get-account-logs.md') ->action( function () use ($response, $register, $project, $user) { $adapter = new AuditAdapter($register->get('db')); @@ -212,7 +212,7 @@ $utopia->post('/v1/account') ->label('scope', 'auth') ->label('sdk.namespace', 'account') ->label('sdk.method', 'createAccount') - ->label('sdk.description', '/docs/references/auth/register.md') + ->label('sdk.description', '/docs/references/account/create-account.md') ->label('abuse-limit', 10) ->param('email', '', function () { return new Email(); }, 'Account email') ->param('password', '', function () { return new Password(); }, 'User password') @@ -362,11 +362,11 @@ $utopia->post('/v1/account') $utopia->patch('/v1/account/name') ->desc('Update Account Name') - ->label('webhook', 'account.update-name') + ->label('webhook', 'account.update-account-name') ->label('scope', 'account') ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updateName') - ->label('sdk.description', '/docs/references/account/update-name.md') + ->label('sdk.method', 'updateAccountName') + ->label('sdk.description', '/docs/references/account/update-account-name.md') ->param('name', '', function () { return new Text(100); }, 'User name') ->action( function ($name) use ($response, $user, $projectDB, $audit) { @@ -386,11 +386,11 @@ $utopia->patch('/v1/account/name') $utopia->patch('/v1/account/password') ->desc('Update Account Password') - ->label('webhook', 'account.update-password') + ->label('webhook', 'account.update-account-password') ->label('scope', 'account') ->label('sdk.namespace', 'account') - ->label('sdk.method', 'updatePassword') - ->label('sdk.description', '/docs/references/account/update-password.md') + ->label('sdk.method', 'updateAccountPassword') + ->label('sdk.description', '/docs/references/account/update-account-password.md') ->param('password', '', function () { return new Password(); }, 'New password') ->param('old-password', '', function () { return new Password(); }, 'Old password') ->action( diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index c550a3219b..ce39d8e799 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -17,6 +17,6 @@ $utopia->post('/v1/graphql') ->label('scope', 'public') ->action( function () { - throw new Exception('Method not supported yet', 500); + throw new Exception('GraphQL support is coming soon!', 502); } ); diff --git a/docs/services/account.md b/docs/services/account.md index 54985c7de0..366591e35f 100644 --- a/docs/services/account.md +++ b/docs/services/account.md @@ -1,5 +1,5 @@ -The account service allows you to fetch and update information related to the currently logged-in user. You can use the service to retrieve a list of all the user sessions across different devices and a security log with the recent account activity. +The account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity. -Using the account service, you can also allow the logged-in user to update his account name, email, or passwords. +You can authenticate the user account by using multiple sign-in methods available. Once the user is authenticated, a new session object will be created to allow the user to access his or her private data and settings. -This service also exposes an endpoint to save and read [user preferences](/docs/account#updatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user preferred locale, timezone, or custom app theme. The usage of this feature is only limited only by your imagination. \ No newline at end of file +This service also exposes an endpoint to save and read the [user preferences](/docs/account#updatePrefs) as a key-value object. This feature is handy if you want to allow extra customization in your app. Common usage for this feature may include saving the user preferred locale, timezone, or custom app theme. The usage of this feature is only limited only by your imagination. \ No newline at end of file diff --git a/docs/services/auth.md b/docs/services/auth.md deleted file mode 100644 index 8e18022b27..0000000000 --- a/docs/services/auth.md +++ /dev/null @@ -1,3 +0,0 @@ -The authentication service allows you to verify users' accounts using basic email and password login or with a supported OAuth provider. The auth service also exposes methods to confirm users' email account and recover users forgotten passwords. - -You can review and enable our currently available OAuth providers from your project console under the **'users -> providers'** menu. \ No newline at end of file diff --git a/docs/services/avatars.md b/docs/services/avatars.md index e0ed2ebbca..81966f1574 100644 --- a/docs/services/avatars.md +++ b/docs/services/avatars.md @@ -1,5 +1,5 @@ -The avatars service aims to help you complete everyday tasks related to your app images, icons, and avatars. Using this service, we hope to save you some precious time and help you focus on solving your real app challenges. +The avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars. Using this service, we hope to save you some precious time and help you focus on solving your real app challenges. -The Avatars service allows you to fetch countries' flags, browser icons, payment methods logos, websites favicons, generate QR codes, and manipulate remote images URLs. +The Avatars service allows you to fetch countries' flags, browser icons, payment methods logos, remote websites favicons, generate QR codes, and manipulate remote images URLs. All endpoints in this service allow you to resize, crop, and change the output image quality to best fit in your app both in terms of look and performance. \ No newline at end of file diff --git a/docs/services/storage.md b/docs/services/storage.md index 8227154638..0de9eb8914 100644 --- a/docs/services/storage.md +++ b/docs/services/storage.md @@ -1,5 +1,5 @@ -The storage service allows you to manage your project files. You can upload, view, download, and query your files and media. +The Storage service allows you to manage your project files. Using the Storage service, you can upload, view, download, and query all your project files. -Each file is granted read and write permissions to manage who has access to view or manage it. You can also learn more about how to manage your [resources permissions](/docs/permissions). +Each file in the service is granted with read and write permissions to manage who has access to view or edit it. You can also learn more about how to manage your [resources permissions](/docs/permissions). - You can also use the storage service file preview endpoint to show the app users' preview images of your files. The preview endpoint also allows you to manipulate the resulting image so that it will fit perfectly inside your app in terms of size and style. \ No newline at end of file +The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network. \ No newline at end of file diff --git a/docs/services/teams.md b/docs/services/teams.md index 729975a027..90e670eb5e 100644 --- a/docs/services/teams.md +++ b/docs/services/teams.md @@ -1,3 +1,3 @@ -The teams' service allows you to group users of your project and will enable them to share read and write access to your project resources, such as database documents or storage files. +The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources, such as database documents or storage files. Each user who creates a team becomes the team owner and can delegate the ownership role by inviting a new team member. Only team owners can invite new users to their team. \ No newline at end of file diff --git a/docs/services/users.md b/docs/services/users.md index c3dba6dbec..2d38476e1a 100644 --- a/docs/services/users.md +++ b/docs/services/users.md @@ -1 +1 @@ -The users' service allows you to manage your users in admin mode (AKA server-side integration). Use this service to search, block, and view your Users info, current sessions, and latest activities. You can also use the Users service to edit your users' preferences and personal info. \ No newline at end of file +The users' service allows you to manage your project users. Use this service to search, block, and view your users' info, current sessions, and latest activity logs. You can also use the Users service to edit your users' preferences and personal info. \ No newline at end of file