Updated SDK examples

This commit is contained in:
Eldad Fux
2020-01-30 18:18:46 +02:00
parent e9d4871244
commit 1beaa237f0
9 changed files with 70 additions and 69 deletions
+6 -4
View File
@@ -413,7 +413,7 @@ $utopia->get('/v1/proxy')
$utopia->get('/v1/open-api-2.json')
->label('scope', 'public')
->label('docs', false)
->param('platform', 'client', function () {return new WhiteList(['client', 'server']);}, 'Choose target platform.', true)
->param('platform', 'client', function () {return new WhiteList([APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER, APP_PLATFORM_CONSOLE]);}, 'Choose target platform.', true)
->param('extensions', 0, function () {return new Range(0, 1);}, 'Show extra data.', true)
->param('tests', 0, function () {return new Range(0, 1);}, 'Include only test services.', true)
->action(
@@ -448,13 +448,15 @@ $utopia->get('/v1/open-api-2.json')
}
$security = [
'client' => ['Project' => []],
'server' => ['Project' => [], 'Key' => []],
APP_PLATFORM_CLIENT => ['Project' => []],
APP_PLATFORM_SERVER => ['Project' => [], 'Key' => []],
APP_PLATFORM_CONSOLE => ['Project' => [], 'Key' => []],
];
$platforms = [
'client' => APP_PLATFORM_CLIENT,
'server' => APP_PLATFORM_SERVER,
'all' => APP_PLATFORM_CONSOLE,
];
/*
@@ -571,7 +573,7 @@ $utopia->get('/v1/open-api-2.json')
continue;
}
if(!in_array($platforms[$platform], $route->getLabel('sdk.platform', []))) {
if($platform !== APP_PLATFORM_CONSOLE && !in_array($platforms[$platform], $route->getLabel('sdk.platform', []))) {
continue;
}
+16 -16
View File
@@ -46,7 +46,7 @@ $utopia->get('/v1/account')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'getAccount')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/account/get.md')
->label('sdk.response', ['200' => 'user'])
->action(
@@ -68,7 +68,7 @@ $utopia->get('/v1/account/prefs')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'getAccountPrefs')
->label('sdk.method', 'getPrefs')
->label('sdk.description', '/docs/references/account/get-prefs.md')
->action(
function () use ($response, $user) {
@@ -90,7 +90,7 @@ $utopia->get('/v1/account/sessions')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'getAccountSessions')
->label('sdk.method', 'getSessions')
->label('sdk.description', '/docs/references/account/get-sessions.md')
->action(
function () use ($response, $user) {
@@ -148,7 +148,7 @@ $utopia->get('/v1/account/logs')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'getAccountLogs')
->label('sdk.method', 'getLogs')
->label('sdk.description', '/docs/references/account/get-logs.md')
->action(
function () use ($response, $register, $project, $user) {
@@ -223,7 +223,7 @@ $utopia->post('/v1/account')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'createAccount')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/account/create.md')
->label('abuse-limit', 10)
->param('email', '', function () { return new Email(); }, 'Account email')
@@ -319,7 +319,7 @@ $utopia->post('/v1/account/sessions')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'createAccountSession')
->label('sdk.method', 'createSession')
->label('sdk.description', '/docs/references/account/create-session.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
@@ -402,7 +402,7 @@ $utopia->get('/v1/account/sessions/oauth/:provider')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'createAccountSessionOAuth')
->label('sdk.method', 'createOAuthSession')
->label('sdk.description', '/docs/references/account/create-session-oauth.md')
->label('sdk.response.code', 301)
->label('sdk.response.type', 'text/html')
@@ -631,7 +631,7 @@ $utopia->patch('/v1/account/name')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateAccountName')
->label('sdk.method', 'updateName')
->label('sdk.description', '/docs/references/account/update-name.md')
->param('name', '', function () { return new Text(100); }, 'User name')
->action(
@@ -667,7 +667,7 @@ $utopia->patch('/v1/account/password')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateAccountPassword')
->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')
@@ -851,7 +851,7 @@ $utopia->delete('/v1/account/sessions/:id')
->label('webhook', 'account.sessions.delete')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'deleteAccountSession')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/account/delete-session.md')
->label('abuse-limit', 100)
->param('id', null, function () { return new UID(); }, 'Session unique ID.')
@@ -896,7 +896,7 @@ $utopia->delete('/v1/account/sessions/current')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'deleteAccountCurrentSession')
->label('sdk.method', 'deleteCurrentSession')
->label('sdk.description', '/docs/references/account/delete-session-current.md')
->label('abuse-limit', 100)
->action(
@@ -930,7 +930,7 @@ $utopia->delete('/v1/account/sessions')
->label('webhook', 'account.sessions.delete')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'deleteAccountSessions')
->label('sdk.method', 'deleteSessions')
->label('sdk.description', '/docs/references/account/delete-sessions.md')
->label('abuse-limit', 100)
->action(
@@ -971,7 +971,7 @@ $utopia->post('/v1/account/recovery')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'createAccountRecovery')
->label('sdk.method', 'createRecovery')
->label('sdk.description', '/docs/references/account/create-recovery.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
@@ -1063,7 +1063,7 @@ $utopia->put('/v1/account/recovery')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateAccountRecovery')
->label('sdk.method', 'updateRecovery')
->label('sdk.description', '/docs/references/account/update-recovery.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}')
@@ -1132,7 +1132,7 @@ $utopia->put('/v1/account/recovery')
->desc('Create Verification')
->label('scope', 'account')
->label('sdk.namespace', 'account')
->label('sdk.method', 'createAccountVerification')
->label('sdk.method', 'createVerification')
->label('sdk.description', '/docs/references/account/create-verification.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},email:{param-email}')
@@ -1211,7 +1211,7 @@ $utopia->put('/v1/account/verification')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'account')
->label('sdk.method', 'updateAccountVerification')
->label('sdk.method', 'updateVerification')
->label('sdk.description', '/docs/references/account/update-verification.md')
->label('abuse-limit', 10)
->label('abuse-key', 'url:{url},userId:{param-userId}')
+10 -10
View File
@@ -23,7 +23,7 @@ include_once __DIR__ . '/../shared/api.php';
$isDev = (App::ENV_TYPE_PRODUCTION !== $utopia->getEnv());
$utopia->get('/v1/database')
$utopia->get('/v1/database/collections')
->desc('List Collections')
->label('scope', 'collections.read')
->label('sdk.namespace', 'database')
@@ -71,7 +71,7 @@ $utopia->get('/v1/database')
}
);
$utopia->get('/v1/database/:collectionId')
$utopia->get('/v1/database/collections/:collectionId')
->desc('Get Collection')
->label('scope', 'collections.read')
->label('sdk.namespace', 'database')
@@ -91,7 +91,7 @@ $utopia->get('/v1/database/:collectionId')
}
);
$utopia->post('/v1/database')
$utopia->post('/v1/database/collections')
->desc('Create Collection')
->label('webhook', 'database.collections.create')
->label('scope', 'collections.write')
@@ -160,7 +160,7 @@ $utopia->post('/v1/database')
}
);
$utopia->put('/v1/database/:collectionId')
$utopia->put('/v1/database/collections/:collectionId')
->desc('Update Collection')
->label('scope', 'collections.write')
->label('webhook', 'database.collections.update')
@@ -224,7 +224,7 @@ $utopia->put('/v1/database/:collectionId')
}
);
$utopia->delete('/v1/database/:collectionId')
$utopia->delete('/v1/database/collections/:collectionId')
->desc('Delete Collection')
->label('scope', 'collections.write')
->label('webhook', 'database.collections.delete')
@@ -261,7 +261,7 @@ $utopia->delete('/v1/database/:collectionId')
}
);
$utopia->get('/v1/database/:collectionId/documents')
$utopia->get('/v1/database/collections/:collectionId/documents')
->desc('List Documents')
->label('scope', 'documents.read')
->label('sdk.namespace', 'database')
@@ -328,7 +328,7 @@ $utopia->get('/v1/database/:collectionId/documents')
}
);
$utopia->get('/v1/database/:collectionId/documents/:documentId')
$utopia->get('/v1/database/collections/:collectionId/documents/:documentId')
->desc('Get Document')
->label('scope', 'documents.read')
->label('sdk.namespace', 'database')
@@ -373,7 +373,7 @@ $utopia->get('/v1/database/:collectionId/documents/:documentId')
}
);
$utopia->post('/v1/database/:collectionId/documents')
$utopia->post('/v1/database/collections/:collectionId/documents')
->desc('Create Document')
->label('webhook', 'database.documents.create')
->label('scope', 'documents.write')
@@ -480,7 +480,7 @@ $utopia->post('/v1/database/:collectionId/documents')
}
);
$utopia->patch('/v1/database/:collectionId/documents/:documentId')
$utopia->patch('/v1/database/collections/:collectionId/documents/:documentId')
->desc('Update Document')
->label('webhook', 'database.documents.update')
->label('scope', 'documents.write')
@@ -559,7 +559,7 @@ $utopia->patch('/v1/database/:collectionId/documents/:documentId')
}
);
$utopia->delete('/v1/database/:collectionId/documents/:documentId')
$utopia->delete('/v1/database/collections/:collectionId/documents/:documentId')
->desc('Delete Document')
->label('scope', 'documents.write')
->label('webhook', 'database.documents.delete')
+1 -1
View File
@@ -12,7 +12,7 @@ $utopia->get('/v1/health')
->label('scope', 'health.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getDB')
->label('sdk.method', 'get')
->label('docs', false)
->action(
function () use ($response) {
+1 -1
View File
@@ -13,7 +13,7 @@ $utopia->get('/v1/locale')
->label('scope', 'locale.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'locale')
->label('sdk.method', 'getLocale')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/locale/get-locale.md')
->action(
function () use ($response, $request, $utopia) {
+7 -7
View File
@@ -24,7 +24,7 @@ $utopia->get('/v1/projects')
->desc('List Projects')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'listProjects')
->label('sdk.method', 'list')
->action(
function () use ($request, $response, $providers, $consoleDB) {
$results = $consoleDB->getCollection([
@@ -57,7 +57,7 @@ $utopia->get('/v1/projects/:projectId')
->desc('Get Project')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getProject')
->label('sdk.method', 'get')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->action(
function ($projectId) use ($request, $response, $providers, $consoleDB) {
@@ -84,7 +84,7 @@ $utopia->get('/v1/projects/:projectId/usage')
->desc('Get Project')
->label('scope', 'projects.read')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'getProjectUsage')
->label('sdk.method', 'getUsage')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->action(
function ($projectId) use ($response, $consoleDB, $projectDB, $register) {
@@ -218,7 +218,7 @@ $utopia->post('/v1/projects')
->desc('Create Project')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'createProject')
->label('sdk.method', 'create')
->param('name', null, function () { return new Text(100); }, 'Project name')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('description', '', function () { return new Text(255); }, 'Project description', true)
@@ -278,7 +278,7 @@ $utopia->patch('/v1/projects/:projectId')
->desc('Update Project')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateProject')
->label('sdk.method', 'update')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->param('name', null, function () { return new Text(100); }, 'Project name')
->param('description', '', function () { return new Text(255); }, 'Project description', true)
@@ -323,7 +323,7 @@ $utopia->patch('/v1/projects/:projectId/oauth')
->desc('Update Project OAuth')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'updateProjectOAuth')
->label('sdk.method', 'updateOAuth')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->param('provider', '', function () use ($providers) { return new WhiteList(array_keys($providers)); }, 'Provider Name', false)
->param('appId', '', function () { return new Text(256); }, 'Provider App ID', true)
@@ -364,7 +364,7 @@ $utopia->delete('/v1/projects/:projectId')
->desc('Delete Project')
->label('scope', 'projects.write')
->label('sdk.namespace', 'projects')
->label('sdk.method', 'deleteProject')
->label('sdk.method', 'delete')
->param('projectId', '', function () { return new UID(); }, 'Project unique ID.')
->action(
function ($projectId) use ($response, $consoleDB) {
+10 -11
View File
@@ -121,7 +121,7 @@ $utopia->get('/v1/storage/files')
->label('scope', 'files.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'listFiles')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/storage/list-files.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
@@ -154,7 +154,7 @@ $utopia->get('/v1/storage/files/:fileId')
->label('scope', 'files.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFile')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/storage/get-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->action(
@@ -174,7 +174,7 @@ $utopia->get('/v1/storage/files/:fileId/preview')
->label('scope', 'files.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFilePreview')
->label('sdk.method', 'getPreview')
->label('sdk.description', '/docs/references/storage/get-file-preview.md')
->label('sdk.response.type', 'image/*')
->param('fileId', '', function () { return new UID(); }, 'File unique ID')
@@ -287,7 +287,7 @@ $utopia->get('/v1/storage/files/:fileId/download')
->label('scope', 'files.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFileDownload')
->label('sdk.method', 'getDownload')
->label('sdk.description', '/docs/references/storage/get-file-download.md')
->label('sdk.response.type', '*')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
@@ -339,7 +339,7 @@ $utopia->get('/v1/storage/files/:fileId/view')
->label('scope', 'files.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFileView')
->label('sdk.method', 'getView')
->label('sdk.description', '/docs/references/storage/get-file-view.md')
->label('sdk.response.type', '*')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
@@ -409,7 +409,7 @@ $utopia->post('/v1/storage/files')
->label('webhook', 'storage.files.create')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'createFile')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/storage/create-file.md')
->label('sdk.consumes', 'multipart/form-data')
->param('file', [], function () { return new File(); }, 'Binary Files.', false)
@@ -543,7 +543,7 @@ $utopia->put('/v1/storage/files/:fileId')
->label('webhook', 'storage.files.update')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'updateFile')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/storage/update-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->param('read', [], function () { return new ArrayList(new Text(64)); }, 'An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
@@ -588,7 +588,7 @@ $utopia->delete('/v1/storage/files/:fileId')
->label('webhook', 'storage.files.delete')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'deleteFile')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/storage/delete-file.md')
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->action(
@@ -629,11 +629,10 @@ $utopia->get('/v1/storage/files/:fileId/scan')
->label('scope', 'god')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'storage')
->label('sdk.method', 'getFileScan')
->label('sdk.method', 'getScan')
->label('sdk.hide', true)
->param('fileId', '', function () { return new UID(); }, 'File unique ID.')
->param('storage', 'local', function () { return new WhiteList(['local']);
})
->param('storage', 'local', function () { return new WhiteList(['local']);})
->action(
function ($fileId, $storage) use ($response, $request, $projectDB) {
$file = $projectDB->getDocument($fileId);
+9 -9
View File
@@ -25,7 +25,7 @@ $utopia->get('/v1/teams')
->label('scope', 'teams.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'listTeams')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/teams/list-teams.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
@@ -54,7 +54,7 @@ $utopia->get('/v1/teams/:teamId')
->label('scope', 'teams.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'getTeam')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/teams/get-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action(
@@ -74,7 +74,7 @@ $utopia->post('/v1/teams')
->label('scope', 'teams.write')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'createTeam')
->label('sdk.method', 'create')
->label('sdk.description', '/docs/references/teams/create-team.md')
->param('name', null, function () { return new Text(100); }, 'Team name.')
->param('roles', ['owner'], function () { return new ArrayList(new Text(128)); }, 'User roles array. Use this param to set the roles in the team for the user who created the team. The default role is **owner**, a role can be any string.', true)
@@ -137,7 +137,7 @@ $utopia->put('/v1/teams/:teamId')
->label('scope', 'teams.write')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateTeam')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/teams/update-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('name', null, function () { return new Text(100); }, 'Team name.')
@@ -166,7 +166,7 @@ $utopia->delete('/v1/teams/:teamId')
->label('scope', 'teams.write')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'deleteTeam')
->label('sdk.method', 'delete')
->label('sdk.description', '/docs/references/teams/delete-team.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action(
@@ -205,7 +205,7 @@ $utopia->get('/v1/teams/:teamId/memberships')
->label('scope', 'teams.read')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'getTeamMemberships')
->label('sdk.method', 'getMemberships')
->label('sdk.description', '/docs/references/teams/get-team-members.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->action(
@@ -262,7 +262,7 @@ $utopia->post('/v1/teams/:teamId/memberships')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'createTeamMembership')
->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.')
@@ -418,7 +418,7 @@ $utopia->patch('/v1/teams/:teamId/memberships/:inviteId/status')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_CLIENT])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'updateTeamMembershipStatus')
->label('sdk.method', 'updateMembershipStatus')
->label('sdk.description', '/docs/references/teams/update-team-membership-status.md')
->label('sdk.cookies', true)
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
@@ -543,7 +543,7 @@ $utopia->delete('/v1/teams/:teamId/memberships/:inviteId')
->label('scope', 'account')
->label('sdk.platform', [APP_PLATFORM_CLIENT, APP_PLATFORM_SERVER])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'deleteTeamMembership')
->label('sdk.method', 'deleteMembership')
->label('sdk.description', '/docs/references/teams/delete-team-membership.md')
->param('teamId', '', function () { return new UID(); }, 'Team unique ID.')
->param('inviteId', '', function () { return new UID(); }, 'Invite unique ID')
+10 -10
View File
@@ -26,7 +26,7 @@ $utopia->get('/v1/users')
->label('scope', 'users.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'listUsers')
->label('sdk.method', 'list')
->label('sdk.description', '/docs/references/users/list-users.md')
->param('search', '', function () { return new Text(256); }, 'Search term to filter your list results.', true)
->param('limit', 25, function () { return new Range(0, 100); }, 'Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
@@ -80,7 +80,7 @@ $utopia->get('/v1/users/:userId')
->label('scope', 'users.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'getUser')
->label('sdk.method', 'get')
->label('sdk.description', '/docs/references/users/get-user.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action(
@@ -121,7 +121,7 @@ $utopia->get('/v1/users/:userId/prefs')
->label('scope', 'users.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserPrefs')
->label('sdk.method', 'getPrefs')
->label('sdk.description', '/docs/references/users/get-user-prefs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action(
@@ -150,7 +150,7 @@ $utopia->get('/v1/users/:userId/sessions')
->label('scope', 'users.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserSessions')
->label('sdk.method', 'getSessions')
->label('sdk.description', '/docs/references/users/get-user-sessions.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action(
@@ -213,7 +213,7 @@ $utopia->get('/v1/users/:userId/logs')
->label('scope', 'users.read')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'getUserLogs')
->label('sdk.method', 'getLogs')
->label('sdk.description', '/docs/references/users/get-user-logs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->action(
@@ -277,7 +277,7 @@ $utopia->post('/v1/users')
->label('scope', 'users.write')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'createUser')
->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.')
@@ -342,7 +342,7 @@ $utopia->patch('/v1/users/:userId/status')
->label('scope', 'users.write')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserStatus')
->label('sdk.method', 'updateStatus')
->label('sdk.description', '/docs/references/users/update-user-status.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->param('status', '', function () { return new WhiteList([Auth::USER_STATUS_ACTIVATED, Auth::USER_STATUS_BLOCKED, Auth::USER_STATUS_UNACTIVATED]); }, 'User Status code. To activate the user pass '.Auth::USER_STATUS_ACTIVATED.', to block the user pass '.Auth::USER_STATUS_BLOCKED.' and for disabling the user pass '.Auth::USER_STATUS_UNACTIVATED)
@@ -390,7 +390,7 @@ $utopia->patch('/v1/users/:userId/prefs')
->label('scope', 'users.write')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'updateUserPrefs')
->label('sdk.method', 'updatePrefs')
->label('sdk.description', '/docs/references/users/update-user-prefs.md')
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
->param('prefs', '', function () { return new Assoc();}, 'Prefs key-value JSON object.')
@@ -432,7 +432,7 @@ $utopia->delete('/v1/users/:userId/sessions/:session')
->label('scope', 'users.write')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'deleteUserSession')
->label('sdk.method', 'deleteSession')
->label('sdk.description', '/docs/references/users/delete-user-session.md')
->label('abuse-limit', 100)
->param('userId', '', function () { return new UID(); }, 'User unique ID.')
@@ -464,7 +464,7 @@ $utopia->delete('/v1/users/:userId/sessions')
->label('scope', 'users.write')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'users')
->label('sdk.method', 'deleteUserSessions')
->label('sdk.method', 'deleteSessions')
->label('sdk.description', '/docs/references/users/delete-user-sessions.md')
->label('abuse-limit', 100)
->param('userId', '', function () { return new UID(); }, 'User unique ID.')