Updated params docs
This commit is contained in:
parent
9c201f5f6e
commit
64b1f1817a
4 changed files with 12 additions and 12 deletions
|
@ -50,7 +50,7 @@ $utopia->post('/v1/account')
|
||||||
->label('sdk.method', 'create')
|
->label('sdk.method', 'create')
|
||||||
->label('sdk.description', '/docs/references/account/create.md')
|
->label('sdk.description', '/docs/references/account/create.md')
|
||||||
->label('abuse-limit', 10)
|
->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('password', '', function () { return new Password(); }, 'User password.')
|
||||||
->param('name', '', function () { return new Text(100); }, 'User name.', true)
|
->param('name', '', function () { return new Text(100); }, 'User name.', true)
|
||||||
->action(
|
->action(
|
||||||
|
@ -147,8 +147,8 @@ $utopia->post('/v1/account/sessions')
|
||||||
->label('sdk.description', '/docs/references/account/create-session.md')
|
->label('sdk.description', '/docs/references/account/create-session.md')
|
||||||
->label('abuse-limit', 10)
|
->label('abuse-limit', 10)
|
||||||
->label('abuse-key', 'url:{url},email:{param-email}')
|
->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('password', '', function () { return new Password(); }, 'User account password.')
|
->param('password', '', function () { return new Password(); }, 'User password.')
|
||||||
->action(
|
->action(
|
||||||
function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) {
|
function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) {
|
||||||
$profile = $projectDB->getCollection([ // Get user by email address
|
$profile = $projectDB->getCollection([ // Get user by email address
|
||||||
|
@ -669,8 +669,8 @@ $utopia->patch('/v1/account/password')
|
||||||
->label('sdk.namespace', 'account')
|
->label('sdk.namespace', 'account')
|
||||||
->label('sdk.method', 'updatePassword')
|
->label('sdk.method', 'updatePassword')
|
||||||
->label('sdk.description', '/docs/references/account/update-password.md')
|
->label('sdk.description', '/docs/references/account/update-password.md')
|
||||||
->param('password', '', function () { return new Password(); }, 'New password.')
|
->param('password', '', function () { return new Password(); }, 'New user password.')
|
||||||
->param('old-password', '', function () { return new Password(); }, 'Old password.')
|
->param('old-password', '', function () { return new Password(); }, 'Old user password.')
|
||||||
->action(
|
->action(
|
||||||
function ($password, $oldPassword) use ($response, $user, $projectDB, $audit, $oauthKeys) {
|
function ($password, $oldPassword) use ($response, $user, $projectDB, $audit, $oauthKeys) {
|
||||||
if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password
|
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.namespace', 'account')
|
||||||
->label('sdk.method', 'updateEmail')
|
->label('sdk.method', 'updateEmail')
|
||||||
->label('sdk.description', '/docs/references/account/update-email.md')
|
->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.')
|
->param('password', '', function () { return new Password(); }, 'User password.')
|
||||||
->action(
|
->action(
|
||||||
function ($email, $password) use ($response, $user, $projectDB, $audit, $oauthKeys) {
|
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('sdk.description', '/docs/references/account/create-recovery.md')
|
||||||
->label('abuse-limit', 10)
|
->label('abuse-limit', 10)
|
||||||
->label('abuse-key', 'url:{url},email:{param-email}')
|
->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.')
|
->param('url', '', function () use ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the recovery email.')
|
||||||
->action(
|
->action(
|
||||||
function ($email, $url) use ($request, $response, $projectDB, $register, $audit, $project) {
|
function ($email, $url) use ($request, $response, $projectDB, $register, $audit, $project) {
|
||||||
|
|
|
@ -369,7 +369,7 @@ $utopia->delete('/v1/projects/:projectId')
|
||||||
->label('sdk.namespace', 'projects')
|
->label('sdk.namespace', 'projects')
|
||||||
->label('sdk.method', 'delete')
|
->label('sdk.method', 'delete')
|
||||||
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
|
->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(
|
->action(
|
||||||
function ($projectId, $password) use ($response, $consoleDB, $user) {
|
function ($projectId, $password) use ($response, $consoleDB, $user) {
|
||||||
if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password
|
if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password
|
||||||
|
|
|
@ -208,7 +208,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
|
||||||
->label('sdk.method', 'createMembership')
|
->label('sdk.method', 'createMembership')
|
||||||
->label('sdk.description', '/docs/references/teams/create-team-membership.md')
|
->label('sdk.description', '/docs/references/teams/create-team-membership.md')
|
||||||
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
|
->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('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('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
|
->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
|
||||||
|
|
|
@ -28,9 +28,9 @@ $utopia->post('/v1/users')
|
||||||
->label('sdk.namespace', 'users')
|
->label('sdk.namespace', 'users')
|
||||||
->label('sdk.method', 'create')
|
->label('sdk.method', 'create')
|
||||||
->label('sdk.description', '/docs/references/users/create-user.md')
|
->label('sdk.description', '/docs/references/users/create-user.md')
|
||||||
->param('email', '', function () { return new Email(); }, 'User account email.')
|
->param('email', '', function () { return new Email(); }, 'User email.')
|
||||||
->param('password', '', function () { return new Password(); }, 'User account password.')
|
->param('password', '', function () { return new Password(); }, 'User password.')
|
||||||
->param('name', '', function () { return new Text(100); }, 'User account name.', true)
|
->param('name', '', function () { return new Text(100); }, 'User name.', true)
|
||||||
->action(
|
->action(
|
||||||
function ($email, $password, $name) use ($response, $register, $projectDB, $providers) {
|
function ($email, $password, $name) use ($response, $register, $projectDB, $providers) {
|
||||||
$profile = $projectDB->getCollection([ // Get user by email address
|
$profile = $projectDB->getCollection([ // Get user by email address
|
||||||
|
|
Loading…
Reference in a new issue