1
0
Fork 0
mirror of synced 2024-06-25 17:50:38 +12:00

Updated params docs

This commit is contained in:
Eldad Fux 2020-02-10 07:58:29 +02:00
parent 9c201f5f6e
commit 64b1f1817a
4 changed files with 12 additions and 12 deletions

View file

@ -50,7 +50,7 @@ $utopia->post('/v1/account')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/account/create.md')
->label('abuse-limit', 10)
->param('email', '', function () { return new Email(); }, 'Account email.')
->param('email', '', function () { return new Email(); }, 'User email.')
->param('password', '', function () { return new Password(); }, 'User password.')
->param('name', '', function () { return new Text(100); }, 'User name.', true)
->action(
@ -147,8 +147,8 @@ $utopia->post('/v1/account/sessions')
->label('sdk.description', '/docs/references/account/create-session.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
->param('email', '', function () { return new Email(); }, 'User account email address.')
->param('password', '', function () { return new Password(); }, 'User account password.')
->param('email', '', function () { return new Email(); }, 'User email.')
->param('password', '', function () { return new Password(); }, 'User password.')
->action(
function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) {
$profile = $projectDB->getCollection([ // Get user by email address
@ -669,8 +669,8 @@ $utopia->patch('/v1/account/password')
->label('sdk.namespace', 'account')
->label('sdk.method', 'updatePassword')
->label('sdk.description', '/docs/references/account/update-password.md')
->param('password', '', function () { return new Password(); }, 'New password.')
->param('old-password', '', function () { return new Password(); }, 'Old password.')
->param('password', '', function () { return new Password(); }, 'New user password.')
->param('old-password', '', function () { return new Password(); }, 'Old user password.')
->action(
function ($password, $oldPassword) use ($response, $user, $projectDB, $audit, $oauthKeys) {
if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password
@ -710,7 +710,7 @@ $utopia->patch('/v1/account/email')
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateEmail')
->label('sdk.description', '/docs/references/account/update-email.md')
->param('email', '', function () { return new Email(); }, 'Email address.')
->param('email', '', function () { return new Email(); }, 'User email.')
->param('password', '', function () { return new Password(); }, 'User password.')
->action(
function ($email, $password) use ($response, $user, $projectDB, $audit, $oauthKeys) {
@ -976,7 +976,7 @@ $utopia->post('/v1/account/recovery')
->label('sdk.description', '/docs/references/account/create-recovery.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
->param('email', '', function () { return new Email(); }, 'User account email address.')
->param('email', '', function () { return new Email(); }, 'User email.')
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email.')
->action(
function ($email, $url) use ($request, $response, $projectDB, $register, $audit, $project) {

View file

@ -369,7 +369,7 @@ $utopia->delete('/v1/projects/:projectId')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'delete')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->param('password', '', function () { return new UID(); }, 'Your Password for confirmation.')
->param('password', '', function () { return new UID(); }, 'Your user password for confirmation.')
->action(
function ($projectId, $password) use ($response, $consoleDB, $user) {
if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password

View file

@ -208,7 +208,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
->label('sdk.method', 'createMembership')
->label('sdk.description', '/docs/references/teams/create-team-membership.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('email', '', function () { return new Email(); }, 'New team member email address.')
->param('email', '', function () { return new Email(); }, 'New team member email.')
->param('name', '', function () { return new Text(100); }, 'New team member name.', true)
->param('roles', [], function () { return new ArrayList(new Text(128)); }, '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](/docs/permissions).')
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email.') // TODO add our own built-in confirm page

View file

@ -28,9 +28,9 @@ $utopia->post('/v1/users')
->label('sdk.namespace', 'users')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/users/create-user.md')
->param('email', '', function () { return new Email(); }, 'User account email.')
->param('password', '', function () { return new Password(); }, 'User account password.')
->param('name', '', function () { return new Text(100); }, 'User account name.', true)
->param('email', '', function () { return new Email(); }, 'User email.')
->param('password', '', function () { return new Password(); }, 'User password.')
->param('name', '', function () { return new Text(100); }, 'User name.', true)
->action(
function ($email, $password, $name) use ($response, $register, $projectDB, $providers) {
$profile = $projectDB->getCollection([ // Get user by email address