1
0
Fork 0
mirror of synced 2024-05-29 08:59:50 +12:00

re introduce name attributes

This commit is contained in:
Damodar Lohani 2021-07-29 13:54:24 +05:45
parent c5045b6571
commit 68ea2e2ab1
19 changed files with 269 additions and 67 deletions

View file

@ -10,6 +10,7 @@ $collections = [
'projects' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'projects',
'name' => 'Projects',
'attributes' => [
[
'$id' => 'teamId',
@ -22,6 +23,17 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => 'name',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 128,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'description',
'type' => Database::VAR_STRING,
@ -199,12 +211,21 @@ $collections = [
'filters' => ['json'],
],
],
'indexes' => [],
'indexes' => [
[
'$id' => '_fulltext_name',
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['name'],
'lengths' => [1024],
'orders' => [Database::ORDER_ASC],
]
],
],
'users' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'users',
'name' => 'Users',
'attributes' => [
[
'$id' => 'name',
@ -353,6 +374,7 @@ $collections = [
'sessions' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'sessions',
'name' => 'Sessions',
'attributes' => [
[
'$id' => 'userId',
@ -600,7 +622,19 @@ $collections = [
'teams' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'teams',
'name' => 'Teams',
'attributes' => [
[
'$id' => 'name',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 128,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
@ -624,12 +658,21 @@ $collections = [
'filters' => [],
],
],
'indexes' => [],
'indexes' => [
[
'$id' => '_fulltext_name',
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['name'],
'lengths' => [1024],
'orders' => [Database::ORDER_ASC],
]
],
],
'memberships' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'memberships',
'name' => 'Memberships',
'attributes' => [
[
'$id' => 'teamId',
@ -737,6 +780,7 @@ $collections = [
'files' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'files',
'name' => 'Files',
'attributes' => [
[
'$id' => 'dateCreated',
@ -915,6 +959,7 @@ $collections = [
'functions' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'functions',
'name' => 'Functions',
'attributes' => [
[
'$id' => 'execute',
@ -927,6 +972,17 @@ $collections = [
'array' => true,
'filters' => [],
],
[
'$id' => 'name',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 2048,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
@ -1050,12 +1106,21 @@ $collections = [
'filters' => [],
],
],
'indexes' => [],
'indexes' => [
[
'$id' => '_fulltext_name',
'type' => Database::INDEX_FULLTEXT,
'attributes' => ['name'],
'lengths' => [1024],
'orders' => [Database::ORDER_ASC],
]
],
],
'tags' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'tags',
'name' => 'Tags',
'attributes' => [
[
'$id' => 'dateCreated',
@ -1128,6 +1193,7 @@ $collections = [
'executions' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'executions',
'name' => 'Executions',
'attributes' => [
[
'$id' => 'dateCreated',
@ -1244,6 +1310,7 @@ $collections = [
'certificates' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'certificates',
'name' => 'Certificates',
'attributes' => [
[
'$id' => 'domain',

View file

@ -37,12 +37,13 @@ App::post('/v1/database/collections')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COLLECTION)
->param('collectionId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('name', '', new Text(128), 'Collection name. Max length: 128 chars.')
->param('read', null, new Permissions(), '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.')
->param('write', null, new Permissions(), 'An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->inject('response')
->inject('dbForExternal')
->inject('audits')
->action(function ($collectionId, $read, $write, $response, $dbForExternal, $audits) {
->action(function ($collectionId, $name, $read, $write, $response, $dbForExternal, $audits) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForExternal*/
/** @var Appwrite\Event\Event $audits */
@ -55,6 +56,7 @@ App::post('/v1/database/collections')
$read = (is_null($read)) ? ($collection->getRead() ?? []) : $read; // By default inherit read permissions
$write = (is_null($write)) ? ($collection->getWrite() ?? []) : $write; // By default inherit write permissions
$collection->setAttribute('name', $name);
$collection->setAttribute('$read', $read);
$collection->setAttribute('$write', $write);
@ -139,12 +141,13 @@ App::put('/v1/database/collections/:collectionId')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_COLLECTION)
->param('collectionId', '', new UID(), 'Collection unique ID.')
->param('name', null, new Text(128), 'Collection name. Max length: 128 chars.')
->param('read', null, new Permissions(), 'An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true)
->param('write', null, new Permissions(), 'An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.', true)
->inject('response')
->inject('dbForExternal')
->inject('audits')
->action(function ($collectionId, $read, $write, $response, $dbForExternal, $audits) {
->action(function ($collectionId, $name, $read, $write, $response, $dbForExternal, $audits) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForExternal */
/** @var Appwrite\Event\Event $audits */
@ -160,6 +163,7 @@ App::put('/v1/database/collections/:collectionId')
try {
$collection = $dbForExternal->updateDocument(Database::COLLECTIONS, $collection->getId(), new Document(\array_merge($collection->getArrayCopy(), [
'name' => $name,
'$read' => $read,
'$write' => $write
])));

View file

@ -40,6 +40,7 @@ App::post('/v1/functions')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_FUNCTION)
->param('functionId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('name', '', new Text(128), 'Function name. Max length: 128 chars.')
->param('execute', [], new ArrayList(new Text(64)), 'An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](/docs/permissions) and get a full list of available permissions.')
->param('runtime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Execution runtime.')
->param('vars', [], new Assoc(), 'Key-value JSON object.', true)
@ -48,7 +49,7 @@ App::post('/v1/functions')
->param('timeout', 15, new Range(1, 900), 'Function maximum execution time in seconds.', true)
->inject('response')
->inject('dbForInternal')
->action(function ($functionId, $execute, $runtime, $vars, $events, $schedule, $timeout, $response, $dbForInternal) {
->action(function ($functionId, $name, $execute, $runtime, $vars, $events, $schedule, $timeout, $response, $dbForInternal) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForInternal */
@ -58,6 +59,7 @@ App::post('/v1/functions')
'dateCreated' => time(),
'dateUpdated' => time(),
'status' => 'disabled',
'name' => $name,
'runtime' => $runtime,
'tag' => '',
'vars' => $vars,

View file

@ -35,6 +35,7 @@ App::post('/v1/projects')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_PROJECT)
->param('projectId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('name', null, new Text(128), 'Project name. Max length: 128 chars.')
->param('teamId', '', new UID(), 'Team unique ID.')
->param('description', '', new Text(256), 'Project description. Max length: 256 chars.', true)
->param('logo', '', new Text(1024), 'Project logo.', true)
@ -50,7 +51,7 @@ App::post('/v1/projects')
->inject('dbForInternal')
->inject('dbForExternal')
->inject('consoleDB')
->action(function ($projectId, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $dbForConsole, $dbForInternal, $dbForExternal, $consoleDB) {
->action(function ($projectId, $name, $teamId, $description, $logo, $url, $legalName, $legalCountry, $legalState, $legalCity, $legalAddress, $legalTaxId, $response, $dbForConsole, $dbForInternal, $dbForExternal, $consoleDB) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
/** @var Utopia\Database\Database $dbForInternal */
@ -68,6 +69,7 @@ App::post('/v1/projects')
'$collection' => 'projects',
'$read' => ['team:' . $teamId],
'$write' => ['team:' . $teamId . '/owner', 'team:' . $teamId . '/developer'],
'name' => $name,
'teamId' => $team->getId(),
'description' => $description,
'logo' => $logo,
@ -606,6 +608,7 @@ App::post('/v1/projects/:projectId/webhooks')
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('webhookId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('projectId', null, new UID(), 'Project unique ID.')
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.')
->param('url', null, new URL(), 'Webhook URL.')
->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
@ -613,7 +616,7 @@ App::post('/v1/projects/:projectId/webhooks')
->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($webhookId, $projectId, $events, $url, $security, $httpUser, $httpPass, $response, $dbForConsole) {
->action(function ($webhookId, $projectId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -627,6 +630,7 @@ App::post('/v1/projects/:projectId/webhooks')
$webhook = new Document([
'$id' => $webhookId == 'unique()' ? $dbForConsole->getId() : $webhookId,
'name' => $name,
'events' => $events,
'url' => $url,
'security' => $security,
@ -718,6 +722,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
->label('sdk.response.model', Response::MODEL_WEBHOOK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('webhookId', null, new UID(), 'Webhook unique ID.')
->param('name', null, new Text(128), 'Webhook name. Max length: 128 chars.')
->param('events', null, new ArrayList(new WhiteList(array_keys(Config::getParam('events'), true), true)), 'Events list.')
->param('url', null, new URL(), 'Webhook URL.')
->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
@ -725,7 +730,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
->param('httpPass', '', new Text(256), 'Webhook HTTP password. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($projectId, $webhookId, $events, $url, $security, $httpUser, $httpPass, $response, $dbForConsole) {
->action(function ($projectId, $webhookId, $name, $events, $url, $security, $httpUser, $httpPass, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -744,6 +749,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId')
}
$project->findAndReplace('$id', $webhook->getId(), $webhook
->setAttribute('name', $name)
->setAttribute('events', $events)
->setAttribute('url', $url)
->setAttribute('security', $security)
@ -802,10 +808,11 @@ App::post('/v1/projects/:projectId/keys')
->label('sdk.response.model', Response::MODEL_KEY)
->param('keyId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('projectId', null, new UID(), 'Project unique ID.')
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true)), 'Key scopes list.')
->inject('response')
->inject('dbForConsole')
->action(function ($keyId, $projectId, $scopes, $response, $dbForConsole) {
->action(function ($keyId, $projectId, $name, $scopes, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -817,6 +824,7 @@ App::post('/v1/projects/:projectId/keys')
$key = new Document([
'$id' => $keyId == 'unique()' ? $dbForConsole->getId() : $keyId,
'name' => $name,
'scopes' => $scopes,
'secret' => \bin2hex(\random_bytes(128)),
]);
@ -902,6 +910,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
->label('sdk.response.model', Response::MODEL_KEY)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('keyId', null, new UID(), 'Key unique ID.')
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true)), 'Key scopes list')
->inject('response')
->inject('dbForConsole')
@ -977,6 +986,7 @@ App::post('/v1/projects/:projectId/tasks')
->label('sdk.response.model', Response::MODEL_TASK)
->param('taskId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('projectId', null, new UID(), 'Project unique ID.')
->param('name', null, new Text(128), 'Task name. Max length: 128 chars.')
->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.')
->param('schedule', null, new Cron(), 'Task schedule CRON syntax.')
->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
@ -987,7 +997,7 @@ App::post('/v1/projects/:projectId/tasks')
->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($taskId, $projectId, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) {
->action(function ($taskId, $projectId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -1004,6 +1014,7 @@ App::post('/v1/projects/:projectId/tasks')
$task = new Document([
'$id' => $taskId == 'unique()' ? $dbForConsole->getId() : $taskId,
'projectId' => $project->getId(),
'name' => $name,
'status' => $status,
'schedule' => $schedule,
'updated' => \time(),
@ -1108,6 +1119,7 @@ App::put('/v1/projects/:projectId/tasks/:taskId')
->label('sdk.response.model', Response::MODEL_TASK)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('taskId', null, new UID(), 'Task unique ID.')
->param('name', null, new Text(128), 'Task name. Max length: 128 chars.')
->param('status', null, new WhiteList(['play', 'pause'], true), 'Task status.')
->param('schedule', null, new Cron(), 'Task schedule CRON syntax.')
->param('security', false, new Boolean(true), 'Certificate verification, false for disabled or true for enabled.')
@ -1118,7 +1130,7 @@ App::put('/v1/projects/:projectId/tasks/:taskId')
->param('httpPass', '', new Text(256), 'Task HTTP password. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($projectId, $taskId, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) {
->action(function ($projectId, $taskId, $name, $status, $schedule, $security, $httpMethod, $httpUrl, $httpHeaders, $httpUser, $httpPass, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -1139,6 +1151,7 @@ App::put('/v1/projects/:projectId/tasks/:taskId')
$security = ($security === '1' || $security === 'true' || $security === 1 || $security === true);
$project->findAndReplace('$id', $task->getId(), $task
->setAttribute('name', $name)
->setAttribute('status', $status)
->setAttribute('schedule', $schedule)
->setAttribute('updated', \time())
@ -1207,12 +1220,13 @@ App::post('/v1/projects/:projectId/platforms')
->param('platformId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('projectId', null, new UID(), 'Project unique ID.')
->param('type', null, new WhiteList(['web', 'flutter-ios', 'flutter-android', 'flutter-linux', 'flutter-macos', 'flutter-windows', 'ios', 'android', 'unity'], true), 'Platform type.')
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true)
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
->param('hostname', '', new Text(256), 'Platform client hostname. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($platformId, $projectId, $type, $key, $store, $hostname, $response, $dbForConsole) {
->action(function ($platformId, $projectId, $type, $name, $key, $store, $hostname, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -1225,6 +1239,7 @@ App::post('/v1/projects/:projectId/platforms')
$platform = new Document([
'$id' => $platformId == 'unique()' ? $dbForConsole->getId() : $platformId,
'type' => $type,
'name' => $name,
'key' => $key,
'store' => $store,
'hostname' => $hostname,
@ -1316,12 +1331,13 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
->label('sdk.response.model', Response::MODEL_PLATFORM)
->param('projectId', null, new UID(), 'Project unique ID.')
->param('platformId', null, new UID(), 'Platform unique ID.')
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
->param('key', '', new Text(256), 'Package name for android or bundle ID for iOS. Max length: 256 chars.', true)
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
->param('hostname', '', new Text(256), 'Platform client URL. Max length: 256 chars.', true)
->inject('response')
->inject('dbForConsole')
->action(function ($projectId, $platformId, $key, $store, $hostname, $response, $dbForConsole) {
->action(function ($projectId, $platformId, $name, $key, $store, $hostname, $response, $dbForConsole) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForConsole */
@ -1338,6 +1354,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
}
$platform
->setAttribute('name', $name)
->setAttribute('dateUpdated', \time())
->setAttribute('key', $key)
->setAttribute('store', $store)
@ -1345,6 +1362,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
;
$project->findAndReplace('$id', $platform->getId(), $platform
->setAttribute('name', $name)
->setAttribute('dateUpdated', \time())
->setAttribute('key', $key)
->setAttribute('store', $store)

View file

@ -34,11 +34,12 @@ App::post('/v1/teams')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, and underscore. Can\'t start with a leading underscore. Max length is 36 chars.')
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->param('roles', ['owner'], new ArrayList(new Key()), 'Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.', true)
->inject('response')
->inject('user')
->inject('dbForInternal')
->action(function ($teamId, $roles, $response, $user, $dbForInternal) {
->action(function ($teamId, $name, $roles, $response, $user, $dbForInternal) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Document $user */
/** @var Utopia\Database\Database $dbForInternal */
@ -53,6 +54,7 @@ App::post('/v1/teams')
'$id' => $teamId ,
'$read' => ['team:'.$teamId],
'$write' => ['team:'.$teamId .'/owner'],
'name' => $name,
'sum' => ($isPrivilegedUser || $isAppUser) ? 0 : 1,
'dateCreated' => \time(),
]));
@ -142,6 +144,37 @@ App::get('/v1/teams/:teamId')
$response->dynamic($team, Response::MODEL_TEAM);
});
App::put('/v1/teams/:teamId')
->desc('Update Team')
->groups(['api', 'teams'])
->label('event', 'teams.update')
->label('scope', 'teams.write')
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
->label('sdk.namespace', 'teams')
->label('sdk.method', 'update')
->label('sdk.description', '/docs/references/teams/update-team.md')
->label('sdk.response.code', Response::STATUS_CODE_OK)
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new UID(), 'Team unique ID.')
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->inject('response')
->inject('dbForInternal')
->action(function ($teamId, $name, $response, $dbForInternal) {
/** @var Appwrite\Utopia\Response $response */
/** @var Utopia\Database\Database $dbForInternal */
$team = $dbForInternal->getDocument('teams', $teamId);
if ($team->isEmpty()) {
throw new Exception('Team not found', 404);
}
$team = $dbForInternal->updateDocument('teams', $team->getId(), $team->setAttribute('name', $name));
$response->dynamic($team, Response::MODEL_TEAM);
});
App::delete('/v1/teams/:teamId')
->desc('Delete Team')
->groups(['api', 'teams'])

View file

@ -15,7 +15,7 @@
data-ls-bind="{{router.params.project}}"
data-unsync="1"
data-ls-loop="projects.projects" data-ls-as="option" aria-label="Switch Project">
<option data-ls-attrs="value={{option.$id}}" data-ls-bind="{{option.$id}}"></option>
<option data-ls-attrs="value={{option.$id}}" data-ls-bind="{{option.name}}"></option>
</select>
</label>
</div>
@ -212,11 +212,14 @@
data-analytics-label="Create Project">
<p>Appwrite projects are containers for your resources and apps across different platforms.</p>
<label>Name</label>
<input type="text" class="full-width margin-bottom-xl" name="name" required autocomplete="off" maxlength="128" />
<label>Project ID</label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
class=""

View file

@ -17,7 +17,7 @@ $maxCells = 10;
<br />
<span data-ls-bind="{{project-collection.$id}}">&nbsp;&nbsp;</span>
<span data-ls-bind="{{project-collection.name}}">&nbsp;&nbsp;</span>
</h1>
</div>
@ -195,6 +195,9 @@ $maxCells = 10;
<label>&nbsp;</label>
<div class="box">
<label for="collection-name">Name</label>
<input name="name" id="collection-name" type="text" autocomplete="off" data-ls-bind="{{project-collection.name}}" data-forms-text-direction required placeholder="Collection Name" maxlength="128" />
<h3 class="margin-bottom-small">Rules</h3>
<div data-ls-if="(!{{project-collection.rules.length}})">
@ -508,7 +511,7 @@ $maxCells = 10;
<div data-ls-loop="project-collections.collections" data-ls-as="project" data-ls-key="$index2" class="tiles cell-3 margin-bottom-negative">
<div class="margin-bottom" data-ls-if="{{project.$id}} != {{router.params.id}}">
<input type="checkbox" name="list" data-ls-attrs="value={{project.$id}},id={{project.$id}}" data-ls-bind="{{rule.list}}" /> <label data-ls-attrs="for={{project.$id}}" data-ls-bind="{{project.$id}}"></label>
<input type="checkbox" name="list" data-ls-attrs="value={{project.$id}},id={{project.$id}}" data-ls-bind="{{rule.list}}" /> <label data-ls-attrs="for={{project.$id}}" data-ls-bind="{{project.name}}"></label>
</div>
</div>
</script>
@ -519,7 +522,7 @@ $maxCells = 10;
<div data-ls-loop="project-collections.collections" data-ls-as="project" data-ls-key="$index2" class="tiles cell-3 margin-bottom-negative">
<div class="margin-bottom" data-ls-if="{{project.$id}} != {{router.params.id}}">
<input type="radio" data-ls-attrs="value={{project.$id}},id=[{{rule.$id}}].{{project.$id}},name=[{{rule.$id}}].list" data-ls-bind="{{rule.list|firstElement}}" data-cast-to="array" required />
<label data-ls-attrs="for={{project.$id}}"data-ls-bind="{{project.$id}}"></label>
<label data-ls-attrs="for={{project.$id}}"data-ls-bind="{{project.name}}"></label>
</div>
</div>
</script>

View file

@ -34,7 +34,7 @@
<ul data-ls-loop="project-collections.collections" data-ls-as="collection" data-ls-append="" class="tiles cell-3 margin-bottom-small">
<li class="margin-bottom">
<a data-ls-attrs="href=/console/database/collection?id={{collection.$id}}&project={{router.params.project}}" class="box">
<div data-ls-bind="{{collection.$id}}" class="text-one-liner margin-bottom text-bold">&nbsp;</div>
<div data-ls-bind="{{collection.name}}" class="text-one-liner margin-bottom text-bold">&nbsp;</div>
<i class="icon-right-open"></i>
</a>
@ -94,11 +94,14 @@
data-failure-param-alert-text="Failed to create collection"
data-failure-param-alert-classname="error">
<label for="collection-name">Name</label>
<input type="text" class="full-width" id="collection-name" name="name" required autocomplete="off" maxlength="128" />
<label for="collection-id">Collection ID</label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="collectionId" />

View file

@ -18,7 +18,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<a data-ls-attrs="href=/console/functions?project={{router.params.project}}" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Functions</a>
<br />
<span data-ls-bind="{{project-function.$id}}&nbsp;">&nbsp;</span>
<span data-ls-bind="{{project-function.name}}&nbsp;">&nbsp;</span>
</h1>
</div>
@ -448,6 +448,9 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<div class="box">
<section class="margin-bottom-large">
<label for="name">Name</label>
<input name="name" id="function-name" type="text" autocomplete="off" data-ls-bind="{{project-function.name}}" data-forms-text-direction required placeholder="Function Name" maxlength="128" />
<label for="execute">Execute Access <span class="tooltip small" data-tooltip="Choose who can execute this function using the client API."><i class="icon-info-circled"></i></span> <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</span></label>
<input type="hidden" id="execute" name="execute" data-forms-tags data-cast-to="json" data-ls-bind="{{project-function.$permissions.execute}}" placeholder="User ID, Team ID or Role" />
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div>

View file

@ -45,7 +45,7 @@ $runtimes = $this->getParam('runtimes', []);
<a data-ls-attrs="href=/console/functions/function?id={{function.$id}}&project={{router.params.project}}" class="button pull-end">Settings</a>
<span data-ls-bind="{{function.$id}}"></span>
<span data-ls-bind="{{function.name}}"></span>
<p class="text-fade margin-bottom-no" data-ls-bind="{{function.runtime|runtimeName}} {{function.runtime|runtimeVersion}}"></p>
</li>
@ -105,12 +105,14 @@ $runtimes = $this->getParam('runtimes', []);
data-failure="alert"
data-failure-param-alert-text="Failed to create function"
data-failure-param-alert-classname="error">
<label for="name">Name</label>
<input type="text" id="name" name="name" required autocomplete="off" class="margin-bottom" maxlength="128" />
<label for="functionId">Function ID</label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="functionId" />

View file

@ -11,7 +11,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
data-name="console-project"
data-param-project-id="{{router.params.project}}"
data-scope="console">
<span class="title" data-ls-bind="{{console-project.$id}}">&nbsp;</span>&nbsp;&nbsp;
<span class="title" data-ls-bind="{{console-project.name}}">&nbsp;</span>&nbsp;&nbsp;
</h1>
<ul class="desktops-only margin-top-negative-small margin-bottom clear">
@ -203,7 +203,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<img src="" data-ls-attrs="src=/images/clients/flutter.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Windows Logo" class="avatar xs" loading="lazy" width="30" height="30" />
</div>
</div>
<span class="text-one-liner" data-ls-bind="{{platform.$id}}"></span>
<span class="text-one-liner" data-ls-bind="{{platform.name}}"></span>
</div>
<p class="margin-bottom-no"><small data-ls-bind="{{platform.hostname}}{{platform.key}}"></small></p>
@ -277,11 +277,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="web" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Web App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -320,13 +323,12 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
data-failure="alert"
data-failure-param-alert-text="Failed to update platform"
data-failure-param-alert-classname="error">
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<label for="platformId">Platform ID</label>
<div class="input-copy">
<input data-forms-copy type="text" data-ls-attrs="id=platform-id-{{platform.$id}}" name="platformId" disabled data-ls-bind="{{platform.$id}}" />
</div>
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="platformId" data-ls-bind="{{platform.$id}}" />
<label data-ls-attrs="for=name-{{platform.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{platform.$id}}" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" placeholder="My Web App" maxlength="128" />
<label for="hostname">Hostname <span class="tooltip large" data-tooltip="The hostname that your website will use to interact with the <?php echo APP_NAME; ?> APIs in production or development environments. No port number required."><i class="icon-question"></i></span></label>
<input name="hostname" type="text" class="margin-bottom" autocomplete="off" placeholder="localhost" data-ls-bind="{{platform.hostname}}" required />
@ -361,10 +363,13 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="android" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Android App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -407,11 +412,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="flutter-ios" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My iOS App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -448,11 +456,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="flutter-android" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Android App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -488,11 +499,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="flutter-linux" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Linux App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -528,11 +542,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="flutter-macos" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Mac OS App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -568,11 +585,14 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="type" data-ls-bind="flutter-windows" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" name="name" required autocomplete="off" placeholder="My Windows App" maxlength="128" />
<label for="platformId">Platform ID <span class="tooltip large" data-tooltip="Choose an ID that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
name="platformId"
@ -607,11 +627,10 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
data-failure-param-alert-classname="error">
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="platformId" data-ls-bind="{{platform.$id}}" />
<label for="platformId">Platform ID</label>
<div class="input-copy">
<input data-forms-copy type="text" data-ls-attrs="id=platform-id-{{platform.$id}}" name="platformId" disabled data-ls-bind="{{platform.$id}}" />
</div>
<label data-ls-attrs="for=name-{{platform.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{platform.$id}}" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" placeholder="My iOS App" maxlength="128" />
<label data-ls-attrs="for=key-{{platform.$id}}">Bundle ID <span class="tooltip large" data-tooltip="You can find your Bundle Identifier in the General tab for your app's primary target in Xcode."><i class="icon-question"></i></span></label>
<input name="key" type="text" class="margin-bottom" autocomplete="off" placeholder="com.cpmpany.appname" data-ls-bind="{{platform.key}}" required />
@ -639,11 +658,10 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
data-failure-param-alert-classname="error">
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="platformId" data-ls-bind="{{platform.$id}}" />
<label for="platformId">Platform ID</label>
<div class="input-copy">
<input data-forms-copy type="text" data-ls-attrs="id=platform-id-{{platform.$id}}" name="platformId" disabled data-ls-bind="{{platform.$id}}" />
</div>
<label data-ls-attrs="for=name-{{platform.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{platform.$id}}" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" placeholder="My Android App" maxlength="128" />
<label data-ls-attrs="for=key-{{platform.$id}}">Package Name <span class="tooltip large" data-tooltip="Your package name is generally the applicationId in your app-level build.gradle file."><i class="icon-question"></i></span></label>
<input name="key" type="text" class="margin-bottom" autocomplete="off" placeholder="com.cpmpany.appname" data-ls-bind="{{platform.key}}" required />
@ -672,10 +690,10 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<label for="platformId">Platform ID</label>
<div class="input-copy">
<input data-forms-copy type="text" data-ls-attrs="id=platform-id-{{platform.$id}}" name="platformId" disabled data-ls-bind="{{platform.$id}}" />
</div>
<input type="hidden" name="platformId" data-ls-bind="{{platform.$id}}" />
<label data-ls-attrs="for=name-{{platform.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{platform.$id}}" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" placeholder="My desktop app" maxlength="128" />
<label data-ls-attrs="for=key-{{platform.$id}}">App Name <span class="tooltip large" data-tooltip="Your application name"><i class="icon-question"></i></span></label>
<input name="key" type="text" class="margin-bottom" autocomplete="off" placeholder="appname" data-ls-bind="{{platform.key}}" required />

View file

@ -38,7 +38,7 @@ $home = $this->getParam('home', '');
<ul data-ls-loop="console-projects.projects" data-ls-as="project" data-ls-append="" class="tiles cell-3">
<li class="margin-bottom">
<a data-ls-attrs="href=/console/home?project={{project.$id}}" class="box">
<div data-ls-bind="{{project.$id}}" class="text-one-liner margin-bottom-tiny text-bold">&nbsp;</div>
<div data-ls-bind="{{project.name}}" class="text-one-liner margin-bottom-tiny text-bold">&nbsp;</div>
<p data-ls-if="({{project.platforms.length}})" class="text-fade text-size-small" data-ls-bind="{{project.platforms.length}} apps"></p>
<p data-ls-if="(!{{project.platforms.length}})" class="text-fade text-size-small">&nbsp;</p>

View file

@ -51,6 +51,9 @@ $scopes = $this->getParam('scopes', []);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="keyId" data-ls-bind="{{key.$id}}" />
<label data-ls-attrs="for=name-{{key.$id}}">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different API keys."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{key.$id}}" name="name" required autocomplete="off" data-ls-bind="{{key.name}}" maxlength="128" />
<section data-forms-select-all>
<label data-ls-attrs="for=scopes-{{key.$id}}">Scopes (<a data-ls-attrs="href={{env.HOME}}/docs/keys" target="_blank" rel="noopener">Learn more</a>)</label>
<div class="row responsive thin">
@ -99,7 +102,7 @@ $scopes = $this->getParam('scopes', []);
<button class="pull-end desktops-only margin-start-small" data-ls-ui-trigger="key-update-{{key.$id}}">Update</button>
<button class="pull-end reverse desktops-only margin-small" data-ls-ui-trigger="key-delete-{{key.$id}}">Delete</button>
<div class="margin-bottom-tiny"><span data-ls-bind="{{key.$id}}"></span> <small>(<span data-ls-bind="{{key.scopes.length}}"></span> scopes granted)</small></div>
<div class="margin-bottom-tiny"><span data-ls-bind="{{key.name}}"></span> <small>(<span data-ls-bind="{{key.scopes.length}}"></span> scopes granted)</small></div>
<div class="clear">
<div data-ui-modal class="modal box close" data-button-text="Show Secret" data-button-class="link pull-start margin-end-small margin-top-tiny">
@ -151,6 +154,9 @@ $scopes = $this->getParam('scopes', []);
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different API keys."><i class="icon-question"></i></span></label>
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" maxlength="128" />
<label for="keyId">Key ID <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different API keys."><i class="icon-question"></i></span></label>
<input
type="hidden"

View file

@ -25,7 +25,7 @@
<table class="full vertical">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th width="140">Status</th>
<th width="180">Schedule</th>
<th width="140"></th>
@ -35,7 +35,7 @@
<tr>
<td>
<div class="margin-bottom-tiny text-one-liner">
<span data-ls-attrs="title={{task.$id}} ({{task.failures}} errors)" data-ls-bind="{{task.$id}}"></span>
<span data-ls-attrs="title={{task.name}} ({{task.failures}} errors)" data-ls-bind="{{task.name}}"></span>
<span data-ls-if="false === {{task.security}}">
&nbsp; <span class="text-danger">SSL/TLS Disabled</span>
@ -96,6 +96,9 @@
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="taskId" data-ls-bind="{{task.$id}}" />
<label data-ls-attrs="for=name-{{task.$id}}">Name</label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{task.$id}}" name="name" required autocomplete="off" data-ls-bind="{{task.name}}" maxlength="128" />
<label data-ls-attrs="for=status-{{task.$id}}" class="margin-bottom">Status
<div class="margin-top-small">
<input name="status" type="radio" checked="checked" required data-ls-bind="{{task.status}}" value="play" /> &nbsp; <span>Play</span> &nbsp;
@ -256,11 +259,14 @@
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<label for="name">Name</label>
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" maxlength="128" />
<label for="taskId">Task ID</label>
<input
type="hidden"
data-custom-id
id-type="custom"
id-type="auto"
required
maxlength="36"
id="taskId"

View file

@ -229,7 +229,7 @@ $auth = $this->getParam('auth', []);
<thead>
<tr>
<th width="40"></th>
<th>ID</th>
<th>Name</th>
<th width="150">Members</th>
<th width="150">Created</th>
</tr>
@ -237,10 +237,10 @@ $auth = $this->getParam('auth', []);
<tbody data-ls-loop="project-teams.teams" data-ls-as="team">
<tr>
<td class="hide">
<img src="" data-ls-attrs="src={{team.$id|avatar}}" data-size="45" alt="Collection Avatar" class="avatar margin-end pull-start" loading="lazy" width="30" height="30" />
<img src="" data-ls-attrs="src={{team.name|avatar}}" data-size="45" alt="Collection Avatar" class="avatar margin-end pull-start" loading="lazy" width="30" height="30" />
</td>
<td data-title="ID: ">
<a data-ls-attrs="href=/console/users/teams/team?id={{team.$id}}&project={{router.params.project}}" data-ls-bind="{{team.$id}}"></a>
<td data-title="Name: ">
<a data-ls-attrs="href=/console/users/teams/team?id={{team.$id}}&project={{router.params.project}}" data-ls-bind="{{team.name}}"></a>
</td>
<td data-title="Members: "><span data-ls-bind="{{team.sum}} members"></span></td>
<td data-title="Date Created: "><small data-ls-bind="{{team.dateCreated|dateText}}"></small></td>
@ -301,7 +301,17 @@ $auth = $this->getParam('auth', []);
data-failure-param-alert-classname="error">
<label for="teamId">ID</label>
<input type="text" class="full-width" id="teamId" name="teamId" required autocomplete="off" maxlength="128" />
<input
type="hidden"
data-custom-id
id-type="auto"
required
maxlength="36"
id="teamId"
name="teamId" />
<label for="team-name">Name</label>
<input type="text" class="full-width" id="team-name" name="name" required autocomplete="off" maxlength="128" />
<hr />

View file

@ -11,8 +11,8 @@
<a data-ls-attrs="href=/console/users/teams?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> Teams</a>
<br />
<span data-ls-bind="{{team.$id}}">&nbsp;</span>
<span data-ls-if="{{team.$id|escape}} === ''">Unknown</span>
<span data-ls-bind="{{team.name}}">&nbsp;</span>
<span data-ls-if="{{team.name|escape}} === ''">Unknown</span>
</h1>
</div>

View file

@ -55,6 +55,9 @@ $events = array_keys($this->getParam('events', []));
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<input type="hidden" name="webhookId" data-ls-bind="{{webhook.$id}}" />
<label data-ls-attrs="for=name-{{webhook.$id}}">Name</label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{webhook.$id}}" name="name" required autocomplete="off" data-ls-bind="{{webhook.name}}" maxlength="128" />
<section data-forms-select-all>
<label data-ls-attrs="for=events-{{webhook.$id}}">Events</label>
<div class="row responsive thin">
@ -139,7 +142,7 @@ $events = array_keys($this->getParam('events', []));
<button class="danger reverse">Delete</button>
</form>
<span data-ls-bind="{{webhook.$id}}"></span> &nbsp; (<span data-ls-bind="{{webhook.events.length}}"></span> events)
<span data-ls-bind="{{webhook.name}}"></span> &nbsp; (<span data-ls-bind="{{webhook.events.length}}"></span> events)
<span data-ls-if="false === {{webhook.security}}">
&nbsp; <small class="text-danger">(SSL/TLS Disabled)</small>
</span>
@ -173,9 +176,18 @@ $events = array_keys($this->getParam('events', []));
data-failure-param-alert-classname="error">
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
<label for="name">Name</label>
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" maxlength="128" />
<label for="webhookId">ID</label>
<input type="text" class="full-width" id="webhookId" name="webhookId" required autocomplete="off" maxlength="128" />
<input
type="hidden"
data-custom-id
id-type="auto"
required
maxlength="36"
id="webhookId"
name="webhookId" />
<section data-forms-select-all>
<label for="events">Events</label>

View file

@ -23,6 +23,12 @@ class Func extends Model
'example' => new \stdClass,
'array' => false,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Function name.',
'default' => '',
'example' => 'My Function',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'Function creation date in Unix timestamp.',

View file

@ -23,6 +23,12 @@ class Project extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Project name.',
'default' => '',
'example' => 'New Project',
])
->addRule('description', [
'type' => self::TYPE_STRING,
'description' => 'Project description.',