mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 17:08:45 +00:00
Merge pull request #2848 from appwrite/fix-rename-sum
Fix: rename 'sum' to 'total'
This commit is contained in:
commit
3a58ae7bb5
60 changed files with 343 additions and 332 deletions
|
|
@ -1426,7 +1426,7 @@ $collections = [
|
|||
'filters' => [],
|
||||
],
|
||||
[
|
||||
'$id' => 'sum',
|
||||
'$id' => 'total',
|
||||
'type' => Database::VAR_INTEGER,
|
||||
'format' => '',
|
||||
'size' => 0,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -80,11 +80,11 @@ App::post('/v1/account')
|
|||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0) {
|
||||
$sum = $dbForProject->count('users', [
|
||||
$total = $dbForProject->count('users', [
|
||||
new Query('deleted', Query::TYPE_EQUAL, [false]),
|
||||
], APP_LIMIT_USERS);
|
||||
|
||||
if ($sum >= $limit) {
|
||||
if ($total >= $limit) {
|
||||
throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501, Exception::USER_COUNT_EXCEEDED);
|
||||
}
|
||||
}
|
||||
|
|
@ -483,9 +483,9 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect')
|
|||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0) {
|
||||
$sum = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]),], APP_LIMIT_USERS);
|
||||
$total = $dbForProject->count('users', [ new Query('deleted', Query::TYPE_EQUAL, [false]),], APP_LIMIT_USERS);
|
||||
|
||||
if ($sum >= $limit) {
|
||||
if ($total >= $limit) {
|
||||
throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501, Exception::USER_COUNT_EXCEEDED);
|
||||
}
|
||||
}
|
||||
|
|
@ -656,11 +656,11 @@ App::post('/v1/account/sessions/magic-url')
|
|||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0) {
|
||||
$sum = $dbForProject->count('users', [
|
||||
$total = $dbForProject->count('users', [
|
||||
new Query('deleted', Query::TYPE_EQUAL, [false]),
|
||||
], APP_LIMIT_USERS);
|
||||
|
||||
if ($sum >= $limit) {
|
||||
if ($total >= $limit) {
|
||||
throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501, Exception::USER_COUNT_EXCEEDED);
|
||||
}
|
||||
}
|
||||
|
|
@ -928,11 +928,11 @@ App::post('/v1/account/sessions/anonymous')
|
|||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0) {
|
||||
$sum = $dbForProject->count('users', [
|
||||
$total = $dbForProject->count('users', [
|
||||
new Query('deleted', Query::TYPE_EQUAL, [false]),
|
||||
], APP_LIMIT_USERS);
|
||||
|
||||
if ($sum >= $limit) {
|
||||
if ($total >= $limit) {
|
||||
throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501, Exception::USER_COUNT_EXCEEDED);
|
||||
}
|
||||
}
|
||||
|
|
@ -1163,7 +1163,7 @@ App::get('/v1/account/sessions')
|
|||
;
|
||||
$response->dynamic(new Document([
|
||||
'sessions' => $sessions,
|
||||
'sum' => count($sessions),
|
||||
'total' => count($sessions),
|
||||
]), Response::MODEL_SESSION_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -1249,7 +1249,7 @@ App::get('/v1/account/logs')
|
|||
;
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => $audit->countLogsByUserAndEvents($user->getId(), $auditEvents),
|
||||
'total' => $audit->countLogsByUserAndEvents($user->getId(), $auditEvents),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
|
@ -1825,7 +1825,7 @@ App::delete('/v1/account/sessions')
|
|||
$events
|
||||
->setParam('eventData', $response->output(new Document([
|
||||
'sessions' => $sessions,
|
||||
'sum' => $numOfSessions,
|
||||
'total' => $numOfSessions,
|
||||
]), Response::MODEL_SESSION_LIST))
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ App::get('/v1/database/collections')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'collections' => $dbForProject->find('collections', $queries, $limit, $offset, [], [$orderType], $cursorCollection ?? null, $cursorDirection),
|
||||
'sum' => $dbForProject->count('collections', $queries, APP_LIMIT_COUNT),
|
||||
'total' => $dbForProject->count('collections', $queries, APP_LIMIT_COUNT),
|
||||
]), Response::MODEL_COLLECTION_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -572,7 +572,7 @@ App::get('/v1/database/collections/:collectionId/logs')
|
|||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
|
@ -1149,7 +1149,7 @@ App::get('/v1/database/collections/:collectionId/attributes')
|
|||
$usage->setParam('database.collections.read', 1);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => \count($attributes),
|
||||
'total' => \count($attributes),
|
||||
'attributes' => $attributes
|
||||
]), Response::MODEL_ATTRIBUTE_LIST);
|
||||
});
|
||||
|
|
@ -1440,7 +1440,7 @@ App::get('/v1/database/collections/:collectionId/indexes')
|
|||
$usage->setParam('database.collections.read', 1);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => \count($indexes),
|
||||
'total' => \count($indexes),
|
||||
'indexes' => $indexes,
|
||||
]), Response::MODEL_INDEX_LIST);
|
||||
});
|
||||
|
|
@ -1756,10 +1756,10 @@ App::get('/v1/database/collections/:collectionId/documents')
|
|||
if ($collection->getAttribute('permission') === 'collection') {
|
||||
/** @var Document[] $documents */
|
||||
$documents = Authorization::skip(fn() => $dbForProject->find('collection_' . $collection->getInternalId(), $queries, $limit, $offset, $orderAttributes, $orderTypes, $cursorDocument ?? null, $cursorDirection));
|
||||
$sum = Authorization::skip(fn() => $dbForProject->count('collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT));
|
||||
$total = Authorization::skip(fn() => $dbForProject->count('collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT));
|
||||
} else {
|
||||
$documents = $dbForProject->find('collection_' . $collection->getInternalId(), $queries, $limit, $offset, $orderAttributes, $orderTypes, $cursorDocument ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT);
|
||||
$total = $dbForProject->count('collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1773,7 +1773,7 @@ App::get('/v1/database/collections/:collectionId/documents')
|
|||
;
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
'documents' => $documents,
|
||||
]), Response::MODEL_DOCUMENT_LIST);
|
||||
});
|
||||
|
|
@ -1930,7 +1930,7 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId/logs')
|
|||
}
|
||||
}
|
||||
$response->dynamic(new Document([
|
||||
'sum' => $audit->countLogsByResource($resource),
|
||||
'total' => $audit->countLogsByResource($resource),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ App::get('/v1/functions')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'functions' => $dbForProject->find('functions', $queries, $limit, $offset, [], [$orderType], $cursorFunction ?? null, $cursorDirection),
|
||||
'sum' => $dbForProject->count('functions', $queries, APP_LIMIT_COUNT),
|
||||
'total' => $dbForProject->count('functions', $queries, APP_LIMIT_COUNT),
|
||||
]), Response::MODEL_FUNCTION_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -145,7 +145,7 @@ App::get('/v1/functions/runtimes')
|
|||
}, array_keys($runtimes));
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => count($runtimes),
|
||||
'total' => count($runtimes),
|
||||
'runtimes' => $runtimes
|
||||
]), Response::MODEL_RUNTIME_LIST);
|
||||
});
|
||||
|
|
@ -686,7 +686,7 @@ App::get('/v1/functions/:functionId/deployments')
|
|||
$queries[] = new Query('resourceType', Query::TYPE_EQUAL, ['functions']);
|
||||
|
||||
$results = $dbForProject->find('deployments', $queries, $limit, $offset, [], [$orderType], $cursorDeployment ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('deployments', $queries, APP_LIMIT_COUNT);
|
||||
$total = $dbForProject->count('deployments', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$build = $dbForProject->getDocument('builds', $result->getAttribute('buildId', ''));
|
||||
|
|
@ -697,7 +697,7 @@ App::get('/v1/functions/:functionId/deployments')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'deployments' => $results,
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_DEPLOYMENT_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -1020,11 +1020,11 @@ App::get('/v1/functions/:functionId/executions')
|
|||
}
|
||||
|
||||
$results = $dbForProject->find('executions', $queries, $limit, $offset, [], [Database::ORDER_DESC], $cursorExecution ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('executions', $queries, APP_LIMIT_COUNT);
|
||||
$total = $dbForProject->count('executions', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'executions' => $results,
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_EXECUTION_LIST);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ App::get('/v1/locale/countries')
|
|||
return strcmp($a->getAttribute('name'), $b->getAttribute('name'));
|
||||
});
|
||||
|
||||
$response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST);
|
||||
$response->dynamic(new Document(['countries' => $output, 'total' => \count($output)]), Response::MODEL_COUNTRY_LIST);
|
||||
});
|
||||
|
||||
App::get('/v1/locale/countries/eu')
|
||||
|
|
@ -136,7 +136,7 @@ App::get('/v1/locale/countries/eu')
|
|||
return strcmp($a->getAttribute('name'), $b->getAttribute('name'));
|
||||
});
|
||||
|
||||
$response->dynamic(new Document(['countries' => $output, 'sum' => \count($output)]), Response::MODEL_COUNTRY_LIST);
|
||||
$response->dynamic(new Document(['countries' => $output, 'total' => \count($output)]), Response::MODEL_COUNTRY_LIST);
|
||||
});
|
||||
|
||||
App::get('/v1/locale/countries/phones')
|
||||
|
|
@ -171,7 +171,7 @@ App::get('/v1/locale/countries/phones')
|
|||
}
|
||||
}
|
||||
|
||||
$response->dynamic(new Document(['phones' => $output, 'sum' => \count($output)]), Response::MODEL_PHONE_LIST);
|
||||
$response->dynamic(new Document(['phones' => $output, 'total' => \count($output)]), Response::MODEL_PHONE_LIST);
|
||||
});
|
||||
|
||||
App::get('/v1/locale/continents')
|
||||
|
|
@ -204,7 +204,7 @@ App::get('/v1/locale/continents')
|
|||
return strcmp($a->getAttribute('name'), $b->getAttribute('name'));
|
||||
});
|
||||
|
||||
$response->dynamic(new Document(['continents' => $output, 'sum' => \count($output)]), Response::MODEL_CONTINENT_LIST);
|
||||
$response->dynamic(new Document(['continents' => $output, 'total' => \count($output)]), Response::MODEL_CONTINENT_LIST);
|
||||
});
|
||||
|
||||
App::get('/v1/locale/currencies')
|
||||
|
|
@ -226,7 +226,7 @@ App::get('/v1/locale/currencies')
|
|||
|
||||
$list = array_map(fn($node) => new Document($node), $list);
|
||||
|
||||
$response->dynamic(new Document(['currencies' => $list, 'sum' => \count($list)]), Response::MODEL_CURRENCY_LIST);
|
||||
$response->dynamic(new Document(['currencies' => $list, 'total' => \count($list)]), Response::MODEL_CURRENCY_LIST);
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -249,5 +249,5 @@ App::get('/v1/locale/languages')
|
|||
|
||||
$list = array_map(fn ($node) => new Document($node), $list);
|
||||
|
||||
$response->dynamic(new Document(['languages' => $list, 'sum' => \count($list)]), Response::MODEL_LANGUAGE_LIST);
|
||||
$response->dynamic(new Document(['languages' => $list, 'total' => \count($list)]), Response::MODEL_LANGUAGE_LIST);
|
||||
});
|
||||
|
|
@ -186,11 +186,11 @@ App::get('/v1/projects')
|
|||
}
|
||||
|
||||
$results = $dbForConsole->find('projects', $queries, $limit, $offset, [], [$orderType], $cursorProject ?? null, $cursorDirection);
|
||||
$sum = $dbForConsole->count('projects', $queries, APP_LIMIT_COUNT);
|
||||
$total = $dbForConsole->count('projects', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'projects' => $results,
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_PROJECT_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -649,11 +649,11 @@ App::get('/v1/projects/:projectId/webhooks')
|
|||
|
||||
$webhooks = $dbForConsole->find('webhooks', [
|
||||
new Query('projectId', Query::TYPE_EQUAL, [$project->getId()])
|
||||
]);
|
||||
], 5000);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'webhooks' => $webhooks,
|
||||
'sum' => count($webhooks),
|
||||
'total' => count($webhooks),
|
||||
]), Response::MODEL_WEBHOOK_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -863,7 +863,7 @@ App::get('/v1/projects/:projectId/keys')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'keys' => $keys,
|
||||
'sum' => count($keys),
|
||||
'total' => count($keys),
|
||||
]), Response::MODEL_KEY_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -1070,7 +1070,7 @@ App::get('/v1/projects/:projectId/platforms')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'platforms' => $platforms,
|
||||
'sum' => count($platforms),
|
||||
'total' => count($platforms),
|
||||
]), Response::MODEL_PLATFORM_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -1294,7 +1294,7 @@ App::get('/v1/projects/:projectId/domains')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'domains' => $domains,
|
||||
'sum' => count($domains),
|
||||
'total' => count($domains),
|
||||
]), Response::MODEL_DOMAIN_LIST);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ App::get('/v1/storage/buckets')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'buckets' => $dbForProject->find('buckets', $queries, $limit, $offset, [], [$orderType], $cursorBucket ?? null, $cursorDirection),
|
||||
'sum' => $dbForProject->count('buckets', $queries, APP_LIMIT_COUNT),
|
||||
'total' => $dbForProject->count('buckets', $queries, APP_LIMIT_COUNT),
|
||||
]), Response::MODEL_BUCKET_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -771,7 +771,7 @@ App::get('/v1/storage/buckets/:bucketId/files')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'files' => $files,
|
||||
'sum' => $dbForProject->count('bucket_' . $bucket->getInternalId(), $queries, APP_LIMIT_COUNT),
|
||||
'total' => $dbForProject->count('bucket_' . $bucket->getInternalId(), $queries, APP_LIMIT_COUNT),
|
||||
]), Response::MODEL_FILE_LIST);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ App::post('/v1/teams')
|
|||
'$read' => ['team:'.$teamId],
|
||||
'$write' => ['team:'.$teamId .'/owner'],
|
||||
'name' => $name,
|
||||
'sum' => ($isPrivilegedUser || $isAppUser) ? 0 : 1,
|
||||
'total' => ($isPrivilegedUser || $isAppUser) ? 0 : 1,
|
||||
'dateCreated' => \time(),
|
||||
'search' => implode(' ', [$teamId, $name]),
|
||||
])));
|
||||
|
|
@ -131,11 +131,11 @@ App::get('/v1/teams')
|
|||
}
|
||||
|
||||
$results = $dbForProject->find('teams', $queries, $limit, $offset, [], [$orderType], $cursorTeam ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('teams', $queries, APP_LIMIT_COUNT);
|
||||
$total = $dbForProject->count('teams', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'teams' => $results,
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_TEAM_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -311,9 +311,9 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0 && $project->getId() !== 'console') { // check users limit, console invites are allways allowed.
|
||||
$sum = $dbForProject->count('users', [], APP_LIMIT_USERS);
|
||||
$total = $dbForProject->count('users', [], APP_LIMIT_USERS);
|
||||
|
||||
if($sum >= $limit) {
|
||||
if($total >= $limit) {
|
||||
throw new Exception('Project registration is restricted. Contact your administrator for more information.', 501, Exception::USER_COUNT_EXCEEDED);
|
||||
}
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ App::post('/v1/teams/:teamId/memberships')
|
|||
} catch (Duplicate $th) {
|
||||
throw new Exception('User has already been invited or is already a member of this team', 409, Exception::TEAM_INVITE_ALREADY_EXISTS);
|
||||
}
|
||||
$team->setAttribute('sum', $team->getAttribute('sum', 0) + 1);
|
||||
$team->setAttribute('total', $team->getAttribute('total', 0) + 1);
|
||||
$team = Authorization::skip(fn() => $dbForProject->updateDocument('teams', $team->getId(), $team));
|
||||
|
||||
// Attach user to team
|
||||
|
|
@ -479,7 +479,7 @@ App::get('/v1/teams/:teamId/memberships')
|
|||
cursorDirection: $cursorDirection
|
||||
);
|
||||
|
||||
$sum = $dbForProject->count(
|
||||
$total = $dbForProject->count(
|
||||
collection:'memberships',
|
||||
queries: $queries,
|
||||
max: APP_LIMIT_COUNT
|
||||
|
|
@ -500,7 +500,7 @@ App::get('/v1/teams/:teamId/memberships')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'memberships' => $memberships,
|
||||
'sum' => $sum,
|
||||
'total' => $total,
|
||||
]), Response::MODEL_MEMBERSHIP_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -731,7 +731,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status')
|
|||
$user = $dbForProject->updateDocument('users', $user->getId(), $user);
|
||||
$membership = $dbForProject->updateDocument('memberships', $membership->getId(), $membership);
|
||||
|
||||
$team = Authorization::skip(fn() => $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('sum', $team->getAttribute('sum', 0) + 1)));
|
||||
$team = Authorization::skip(fn() => $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('total', $team->getAttribute('total', 0) + 1)));
|
||||
|
||||
$audits
|
||||
->setParam('userId', $user->getId())
|
||||
|
|
@ -825,7 +825,7 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId')
|
|||
Authorization::skip(fn() => $dbForProject->updateDocument('users', $user->getId(), $user));
|
||||
|
||||
if ($membership->getAttribute('confirm')) { // Count only confirmed members
|
||||
$team->setAttribute('sum', \max($team->getAttribute('sum', 0) - 1, 0));
|
||||
$team->setAttribute('total', \max($team->getAttribute('total', 0) - 1, 0));
|
||||
Authorization::skip(fn() => $dbForProject->updateDocument('teams', $team->getId(), $team));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ App::get('/v1/users')
|
|||
|
||||
$response->dynamic(new Document([
|
||||
'users' => $dbForProject->find('users', $queries, $limit, $offset, [], [$orderType], $cursorUser ?? null, $cursorDirection),
|
||||
'sum' => $dbForProject->count('users', $queries, APP_LIMIT_COUNT),
|
||||
'total' => $dbForProject->count('users', $queries, APP_LIMIT_COUNT),
|
||||
]), Response::MODEL_USER_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ App::get('/v1/users/:userId/sessions')
|
|||
;
|
||||
$response->dynamic(new Document([
|
||||
'sessions' => $sessions,
|
||||
'sum' => count($sessions),
|
||||
'total' => count($sessions),
|
||||
]), Response::MODEL_SESSION_LIST);
|
||||
});
|
||||
|
||||
|
|
@ -348,7 +348,7 @@ App::get('/v1/users/:userId/logs')
|
|||
;
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'sum' => $audit->countLogsByUserAndEvents($user->getId(), $auditEvents),
|
||||
'total' => $audit->countLogsByUserAndEvents($user->getId(), $auditEvents),
|
||||
'logs' => $output,
|
||||
]), Response::MODEL_LOG_LIST);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ $cli
|
|||
'files' => [
|
||||
'namespace' => '',
|
||||
'collectionPrefix' => 'bucket_',
|
||||
'sum' => [
|
||||
'total' => [
|
||||
'field' => 'sizeOriginal'
|
||||
]
|
||||
],
|
||||
|
|
@ -613,13 +613,13 @@ $cli
|
|||
}
|
||||
|
||||
// check if sum calculation is required
|
||||
$sum = $subOptions['sum'] ?? [];
|
||||
if(empty($sum)) {
|
||||
$total = $subOptions['total'] ?? [];
|
||||
if(empty($total)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$dbForProject->setNamespace("_{$projectId}");
|
||||
$total = (int) $dbForProject->sum(($subOptions['collectionPrefix'] ?? '') . $parent->getId(), $sum['field']);
|
||||
$total = (int) $dbForProject->sum(($subOptions['collectionPrefix'] ?? '') . $parent->getId(), $total['field']);
|
||||
|
||||
$subCollectionTotals[$subCollection] = ($ssubCollectionTotals[$subCollection] ?? 0) + $total; // Project level sum for sub collections like storage.total
|
||||
|
||||
|
|
|
|||
|
|
@ -345,10 +345,10 @@
|
|||
data-name="securityLogs"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{securityLogs.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{securityLogs.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{securityLogs.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{securityLogs.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="account.getLogs"
|
||||
|
|
@ -359,7 +359,7 @@
|
|||
data-name="securityLogs"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{securityLogs.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{securityLogs.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ $params = $this->getParam('params', []);
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{logs.sum}}">
|
||||
<div data-ls-if="0 != {{logs.total}}">
|
||||
<div class="margin-bottom-small margin-top-negative text-align-end text-size-small text-fade">Showing logs from the last <?php echo $this->escape($interval); ?> days</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
|
|
@ -71,10 +71,10 @@ $params = $this->getParam('params', []);
|
|||
data-name="logs"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{logs.sum}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{logs.total}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{logs.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{logs.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="<?php echo $method; ?>"
|
||||
|
|
@ -89,7 +89,7 @@ $params = $this->getParam('params', []);
|
|||
data-name="logs"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{logs.sum}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{logs.total}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -49,14 +49,14 @@ $logs = $this->getParam('logs', null);
|
|||
data-name="project-documents"
|
||||
x-data="{ project: new URLSearchParams(location.search).get('project') }">
|
||||
|
||||
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
|
||||
<div data-ls-if="0 == {{project-documents.total}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Add your first document to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="({{project-documents.sum}})" class="margin-top-negative">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-documents.sum}}"></span><span data-ls-if="{{project-documents.sum}} == <?php echo APP_LIMIT_COUNT; ?>">+</span> documents found</div>
|
||||
<div data-ls-if="({{project-documents.total}})" class="margin-top-negative">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-documents.total}}"></span><span data-ls-if="{{project-documents.total}} == <?php echo APP_LIMIT_COUNT; ?>">+</span> documents found</div>
|
||||
<div class="box margin-bottom y-scroll text-size-small">
|
||||
<!-- Alpine.js Start -->
|
||||
<table
|
||||
|
|
@ -108,10 +108,10 @@ $logs = $this->getParam('logs', null);
|
|||
data-name="project-documents"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="database.listDocuments"
|
||||
|
|
@ -124,7 +124,7 @@ $logs = $this->getParam('logs', null);
|
|||
data-name="project-documents"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
data-scope="sdk"
|
||||
data-name="project-collections">
|
||||
|
||||
<div data-ls-if="(!{{project-collections.sum}})" class="box dashboard margin-bottom">
|
||||
<div data-ls-if="(!{{project-collections.total}})" class="box dashboard margin-bottom">
|
||||
<div class="margin-bottom-small margin-top-small margin-end margin-start">
|
||||
<h3 class="margin-bottom-small text-bold">No Collections Found</h3>
|
||||
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-collections.sum}}">
|
||||
<div data-ls-if="0 != {{project-collections.total}}">
|
||||
<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">
|
||||
|
|
@ -53,10 +53,10 @@
|
|||
data-name="project-collections"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-collections.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-collections.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-collections.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-collections.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="database.listCollections"
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
data-name="project-collections"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-collections.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-collections.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ $rules = $collection->getAttribute('rules', []);
|
|||
data-scope="sdk"
|
||||
data-name="project-documents">
|
||||
|
||||
<div data-ls-if="0 == {{project-documents.sum}}" class="margin-bottom">
|
||||
<div data-ls-if="0 == {{project-documents.total}}" class="margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Try a different search term.</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="({{project-documents.sum}})">
|
||||
<div data-ls-if="({{project-documents.total}})">
|
||||
<form class="scroll">
|
||||
<table class="margin-top-no margin-bottom-no">
|
||||
<thead>
|
||||
|
|
@ -107,10 +107,10 @@ $rules = $collection->getAttribute('rules', []);
|
|||
data-name="project-documents"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="database.listDocuments"
|
||||
|
|
@ -123,7 +123,7 @@ $rules = $collection->getAttribute('rules', []);
|
|||
data-name="project-documents"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@
|
|||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
|
||||
<div data-ls-if="0 == {{project-files.sum}}" class="margin-bottom">
|
||||
<div data-ls-if="0 == {{project-files.total}}" class="margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Files Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Try a different search term.</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-files.sum}}">
|
||||
<div data-ls-if="0 != {{project-files.total}}">
|
||||
<div class="scroll">
|
||||
<table class="margin-top-no margin-bottom-no">
|
||||
<thead>
|
||||
|
|
@ -91,10 +91,10 @@
|
|||
data-name="project-files"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-files.total}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="storage.listFiles"
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
data-name="project-files"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-files.total}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-success="trigger"
|
||||
data-success-param-trigger-events="functions.listDeployments">
|
||||
|
||||
<h3>Deployments <span class="text-fade text-size-small pull-end margin-top-small" data-ls-bind="{{project-function-deployments.sum}} deployments found"></span></h3>
|
||||
<h3>Deployments <span class="text-fade text-size-small pull-end margin-top-small" data-ls-bind="{{project-function-deployments.total}} deployments found"></span></h3>
|
||||
|
||||
<div data-ls-if="0 == {{project-function-deployments.deployments.length}} || undefined == {{project-function-deployments.deployments.length}}" class="box margin-top margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Deployments Found</h3>
|
||||
|
|
@ -194,10 +194,10 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-name="project-function-deployments"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-function-deployments.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-function-deployments.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-function-deployments.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-function-deployments.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="functions.listDeployments"
|
||||
|
|
@ -210,7 +210,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-name="project-function-deployments"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-function-deployments.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-function-deployments.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -331,7 +331,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
<?php endif;?>
|
||||
<li data-state="/console/functions/function/logs?id={{router.params.id}}&project={{router.params.project}}">
|
||||
|
||||
<div class="text-fade text-size-small pull-end margin-top" data-ls-bind="{{project-function-executions.sum}} executions found"></div>
|
||||
<div class="text-fade text-size-small pull-end margin-top" data-ls-bind="{{project-function-executions.total}} executions found"></div>
|
||||
|
||||
<h2>Logs</h2>
|
||||
|
||||
|
|
@ -439,10 +439,10 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-name="project-function-executions"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-function-executions.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-function-executions.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-function-executions.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-function-executions.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="functions.listExecutions"
|
||||
|
|
@ -455,7 +455,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
data-name="project-function-executions"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-function-executions.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-function-executions.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ $runtimes = $this->getParam('runtimes', []);
|
|||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-functions.functions.length}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small margin-top-negative text-fade"><span data-ls-bind="{{project-functions.sum}}"></span> functions found</div>
|
||||
<div class="margin-bottom-small text-align-end text-size-small margin-top-negative text-fade"><span data-ls-bind="{{project-functions.total}}"></span> functions found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<ul data-ls-loop="project-functions.functions" data-ls-as="function" class="list">
|
||||
|
|
@ -64,10 +64,10 @@ $runtimes = $this->getParam('runtimes', []);
|
|||
data-name="project-functions"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-users.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-users.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-functions.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-functions.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="functions.list"
|
||||
|
|
@ -79,7 +79,7 @@ $runtimes = $this->getParam('runtimes', []);
|
|||
data-name="project-functions"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-functions.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-functions.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
|||
</div>
|
||||
|
||||
<div class="chart-metric">
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.requests|statsGetSum|statsTotal}}">N/A</span></div>
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.requests|statsGetTotal|statsTotal}}">N/A</span></div>
|
||||
<div class="unit margin-start-no margin-bottom-small">Requests</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ $home = $this->getParam('home', '');
|
|||
data-name="console-projects"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{console-projects.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{console-projects.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{console-projects.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{console-projects.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="projects.list"
|
||||
|
|
@ -78,7 +78,7 @@ $home = $this->getParam('home', '');
|
|||
data-name="console-projects"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{console-projects.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{console-projects.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ $scopes = $this->getParam('scopes', []);
|
|||
data-success="trigger"
|
||||
data-success-param-trigger-events="projects.listKeys">
|
||||
|
||||
<div data-ls-if="0 == {{console-keys.sum}} || undefined == {{console-keys.sum}}" class="box margin-top margin-bottom">
|
||||
<div data-ls-if="0 == {{console-keys.total}} || undefined == {{console-keys.total}}" class="box margin-top margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No API Keys Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">You haven't created any API keys for your project yet.</p>
|
||||
</div>
|
||||
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-keys.sum}}">
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-keys.total}}">
|
||||
<ul data-ls-loop="console-keys.keys" data-ls-as="key" class="list">
|
||||
<li class="clear">
|
||||
<div data-ui-modal class="modal box close" data-button-alias="none" data-open-event="key-update-{{key.$id}}">
|
||||
|
|
|
|||
|
|
@ -273,13 +273,13 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-success="trigger"
|
||||
data-success-param-trigger-events="projects.listDomains">
|
||||
|
||||
<div data-ls-if="0 == {{console-domains.sum}} || undefined == {{console-domains.sum}}" class="box margin-top margin-bottom">
|
||||
<div data-ls-if="0 == {{console-domains.total}} || undefined == {{console-domains.total}}" class="box margin-top margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Custom Domains Added</h3>
|
||||
|
||||
<p class="margin-bottom-no">You haven't created any custom domains for your project yet.</p>
|
||||
</div>
|
||||
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-domains.sum}}">
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-domains.total}}">
|
||||
<table class="vertical">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -71,14 +71,14 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
|
|||
data-scope="sdk"
|
||||
data-name="project-files">
|
||||
|
||||
<div data-ls-if="0 == {{project-files.sum}}" class="box margin-bottom">
|
||||
<div data-ls-if="0 == {{project-files.total}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Files Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Upload your first file to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-files.sum}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-files.sum}}"></span> files found</div>
|
||||
<div data-ls-if="0 != {{project-files.total}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-files.total}}"></span> files found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<table class="vertical" style="overflow: visible">
|
||||
|
|
@ -238,10 +238,10 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
|
|||
data-name="project-files"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-files.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="storage.listFiles"
|
||||
|
|
@ -254,7 +254,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
|
|||
data-name="project-files"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-files.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
data-scope="sdk"
|
||||
data-name="project-buckets">
|
||||
|
||||
<div data-ls-if="(!{{project-buckets.sum}})" class="box dashboard margin-bottom">
|
||||
<div data-ls-if="(!{{project-buckets.total}})" class="box dashboard margin-bottom">
|
||||
<div class="margin-bottom-small margin-top-small margin-end margin-start">
|
||||
<h3 class="margin-bottom-small text-bold">No Buckets Found</h3>
|
||||
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-buckets.sum}}">
|
||||
<div data-ls-if="0 != {{project-buckets.total}}">
|
||||
<ul data-ls-loop="project-buckets.buckets" data-ls-as="bucket" data-ls-append="" class="tiles cell-3 margin-bottom-small">
|
||||
<li class="margin-bottom">
|
||||
<a data-ls-attrs="href=/console/storage/bucket?id={{bucket.$id}}&project={{router.params.project}}" class="box">
|
||||
|
|
@ -52,10 +52,10 @@
|
|||
data-name="project-buckets"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-buckets.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-buckets.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-buckets.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-buckets.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="storage.listBuckets"
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
data-name="project-buckets"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-buckets.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-buckets.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,14 +52,14 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-scope="sdk"
|
||||
data-name="project-users">
|
||||
|
||||
<div data-ls-if="0 == {{project-users.sum}}" class="box margin-bottom">
|
||||
<div data-ls-if="0 == {{project-users.total}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Users Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Create your first user to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-users.sum}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-users.sum}}"></span> users found</div>
|
||||
<div data-ls-if="0 != {{project-users.total}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-users.total}}"></span> users found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<table class="vertical">
|
||||
|
|
@ -118,10 +118,10 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-name="project-users"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-users.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-users.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-users.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-users.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="users.list"
|
||||
|
|
@ -133,7 +133,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-name="project-users"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-users.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-users.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
@ -220,14 +220,14 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-scope="sdk"
|
||||
data-name="project-teams">
|
||||
|
||||
<div data-ls-if="0 == {{project-teams.sum}}" class="box margin-bottom">
|
||||
<div data-ls-if="0 == {{project-teams.total}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Teams Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Create your first team to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-teams.sum}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-teams.sum}}"></span> teams found</div>
|
||||
<div data-ls-if="0 != {{project-teams.total}}">
|
||||
<div class="margin-bottom-small text-align-end text-size-small text-fade"><span data-ls-bind="{{project-teams.total}}"></span> teams found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<table class="vertical">
|
||||
|
|
@ -247,7 +247,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
<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}}" data-ls-attrs="title={{team.name}}"></a>
|
||||
</td>
|
||||
<td data-title="Members: "><span data-ls-bind="{{team.sum}} members"></span></td>
|
||||
<td data-title="Members: "><span data-ls-bind="{{team.total}} members"></span></td>
|
||||
<td data-title="Date Created: "><small data-ls-bind="{{team.dateCreated|dateText}}"></small></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -266,10 +266,10 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-name="project-teams"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-teams.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-teams.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-teams.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-teams.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="teams.list"
|
||||
|
|
@ -281,7 +281,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
|
|||
data-name="project-teams"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-teams.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-teams.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -77,14 +77,14 @@
|
|||
data-scope="sdk"
|
||||
data-name="project-members">
|
||||
|
||||
<div data-ls-if="0 == {{project-members.sum}}" class="box margin-bottom">
|
||||
<div data-ls-if="0 == {{project-members.total}}" class="box margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Memberships Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">Add your first team member to get started</p>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="0 != {{project-members.sum}}">
|
||||
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative text-fade"><span data-ls-bind="{{project-members.sum}}"></span> memberships found</div>
|
||||
<div data-ls-if="0 != {{project-members.total}}">
|
||||
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative text-fade"><span data-ls-bind="{{project-members.total}}"></span> memberships found</div>
|
||||
|
||||
<div class="box margin-bottom">
|
||||
<ul data-ls-loop="project-members.memberships" data-ls-as="member" class="list">
|
||||
|
|
@ -178,10 +178,10 @@
|
|||
data-name="project-members"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-members.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-members.total}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
||||
</form>
|
||||
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-members.sum|pageTotal}}"></span>
|
||||
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-members.total|pageTotal}}"></span>
|
||||
|
||||
<form
|
||||
data-service="teams.getMemberships"
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
data-name="project-members"
|
||||
data-success="state"
|
||||
data-success-param-state-keys="search,offset">
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-members.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-members.total}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ $events = array_keys($this->getParam('events', []));
|
|||
data-success="trigger"
|
||||
data-success-param-trigger-events="projects.listWebhooks">
|
||||
|
||||
<div data-ls-if="0 == {{console-webhooks.sum}} || undefined == {{console-webhooks.sum}}" class="box margin-top margin-bottom">
|
||||
<div data-ls-if="0 == {{console-webhooks.total}} || undefined == {{console-webhooks.total}}" class="box margin-top margin-bottom">
|
||||
<h3 class="margin-bottom-small text-bold">No Webhooks Found</h3>
|
||||
|
||||
<p class="margin-bottom-no">You haven't created any webhooks for your project yet.</p>
|
||||
</div>
|
||||
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-webhooks.sum}}">
|
||||
<div class="box margin-bottom" data-ls-if="0 != {{console-webhooks.total}}">
|
||||
<ul data-ls-loop="console-webhooks.webhooks" data-ls-as="webhook" class="list">
|
||||
<li class="clear">
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ class DeletesV1 extends Worker
|
|||
$team = $this->getProjectDB($projectId)->getDocument('teams', $teamId);
|
||||
if (!$team->isEmpty()) {
|
||||
$team = $this->getProjectDB($projectId)->updateDocument('teams', $teamId, new Document(\array_merge($team->getArrayCopy(), [
|
||||
'sum' => \max($team->getAttribute('sum', 0) - 1, 0), // Ensure that sum >= 0
|
||||
'total' => \max($team->getAttribute('total', 0) - 1, 0), // Ensure that total >= 0
|
||||
])));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
47
composer.lock
generated
47
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "318c53aaac3cdfbdb728acc5e59b8057",
|
||||
"content-hash": "b7919cd5b669605d051fadd3818523a7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "adhocore/jwt",
|
||||
|
|
@ -2129,16 +2129,16 @@
|
|||
},
|
||||
{
|
||||
"name": "utopia-php/database",
|
||||
"version": "0.15.1",
|
||||
"version": "0.15.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "eb4f61ec40d697acdfd574638ecd075e4f44b864"
|
||||
"reference": "4ae9f1162d6640ccfe28afa0bbc60b907a7ad1c0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/eb4f61ec40d697acdfd574638ecd075e4f44b864",
|
||||
"reference": "eb4f61ec40d697acdfd574638ecd075e4f44b864",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/4ae9f1162d6640ccfe28afa0bbc60b907a7ad1c0",
|
||||
"reference": "4ae9f1162d6640ccfe28afa0bbc60b907a7ad1c0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -2186,9 +2186,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/0.15.1"
|
||||
"source": "https://github.com/utopia-php/database/tree/0.15.2"
|
||||
},
|
||||
"time": "2022-02-22T09:33:37+00:00"
|
||||
"time": "2022-02-28T15:53:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/domains",
|
||||
|
|
@ -3075,7 +3075,7 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator",
|
||||
"reference": "4a43aa70c2f0b243edfc689f618a85f7d0817287"
|
||||
"reference": "3af54e71d0088b72b3223efc511b77e254fb7a1d"
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
|
|
@ -3110,7 +3110,7 @@
|
|||
}
|
||||
],
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"time": "2022-02-22T10:51:55+00:00"
|
||||
"time": "2022-03-01T09:53:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
|
|
@ -3685,9 +3685,6 @@
|
|||
"require": {
|
||||
"php": "^7.1 || ^8.0"
|
||||
},
|
||||
"replace": {
|
||||
"myclabs/deep-copy": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/collections": "^1.0",
|
||||
"doctrine/common": "^2.6",
|
||||
|
|
@ -4226,16 +4223,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "9.2.13",
|
||||
"version": "9.2.14",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8"
|
||||
"reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
||||
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f4d60b6afe5546421462b76cd4e633ebc364ab4",
|
||||
"reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -4291,7 +4288,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.13"
|
||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.14"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -4299,7 +4296,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-02-23T17:02:38+00:00"
|
||||
"time": "2022-02-28T12:38:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
|
|
@ -5706,16 +5703,16 @@
|
|||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v6.0.3",
|
||||
"version": "v6.0.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "22e8efd019c3270c4f79376234a3f8752cd25490"
|
||||
"reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/22e8efd019c3270c4f79376234a3f8752cd25490",
|
||||
"reference": "22e8efd019c3270c4f79376234a3f8752cd25490",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/3bebf4108b9e07492a2a4057d207aa5a77d146b1",
|
||||
"reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -5781,7 +5778,7 @@
|
|||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v6.0.3"
|
||||
"source": "https://github.com/symfony/console/tree/v6.0.5"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -5797,7 +5794,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-01-26T17:23:29+00:00"
|
||||
"time": "2022-02-25T10:48:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
|
|
@ -6573,5 +6570,5 @@
|
|||
"platform-overrides": {
|
||||
"php": "8.0"
|
||||
},
|
||||
"plugin-api-version": "2.1.0"
|
||||
"plugin-api-version": "2.2.0"
|
||||
}
|
||||
|
|
|
|||
12
public/dist/scripts/app-all.js
vendored
12
public/dist/scripts/app-all.js
vendored
|
|
@ -513,7 +513,7 @@ if(typeof fileId==='undefined'){throw new AppwriteException('Missing required pa
|
|||
let path='/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getFileDownload:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getFilePreview:(bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output)=>__awaiter(this,void 0,void 0,function*(){if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
return uri;},getFilePreview:(bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};if(typeof width!=='undefined'){payload['width']=width;}
|
||||
if(typeof height!=='undefined'){payload['height']=height;}
|
||||
|
|
@ -526,7 +526,8 @@ if(typeof opacity!=='undefined'){payload['opacity']=opacity;}
|
|||
if(typeof rotation!=='undefined'){payload['rotation']=rotation;}
|
||||
if(typeof background!=='undefined'){payload['background']=background;}
|
||||
if(typeof output!=='undefined'){payload['output']=output;}
|
||||
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getFileView:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getFileView:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getUsage:(range)=>__awaiter(this,void 0,void 0,function*(){let path='/storage/usage';let payload={};if(typeof range!=='undefined'){payload['range']=range;}
|
||||
|
|
@ -3541,8 +3542,7 @@ handler2.inline=(el,{expression},{cleanup:cleanup2})=>{let root=closestRoot(el);
|
|||
root._x_refs={};root._x_refs[expression]=el;cleanup2(()=>delete root._x_refs[expression]);};directive("ref",handler2);directive("if",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{let evaluate2=evaluateLater(el,expression);let show=()=>{if(el._x_currentIfEl)
|
||||
return el._x_currentIfEl;let clone2=el.content.cloneNode(true).firstElementChild;addScopeToNode(clone2,{},el);mutateDom(()=>{el.after(clone2);initTree(clone2);});el._x_currentIfEl=clone2;el._x_undoIf=()=>{clone2.remove();delete el._x_currentIfEl;};return clone2;};let hide=()=>{if(!el._x_undoIf)
|
||||
return;el._x_undoIf();delete el._x_undoIf;};effect3(()=>evaluate2((value)=>{value?show():hide();}));cleanup2(()=>el._x_undoIf&&el._x_undoIf());});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((el,{value,modifiers,expression},{cleanup:cleanup2})=>{let evaluate2=expression?evaluateLater(el,expression):()=>{};let removeListener=on(el,value,modifiers,(e)=>{evaluate2(()=>{},{scope:{$event:e},params:[e]});});cleanup2(()=>removeListener());}));alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default;window.Alpine=src_default;queueMicrotask(()=>{src_default.start();});})();window.ls.error=function(){return function(error){window.console.error(error);if(window.location.pathname!=='/console'){window.location='/console';}};};window.addEventListener("error",function(event){console.error("ERROR-EVENT:",event.error.message,event.error.stack);});document.addEventListener("account.deleteSession",function(){window.location="/auth/signin";});document.addEventListener("account.create",function(){let container=window.ls.container;let form=container.get('serviceForm');let sdk=container.get('console');let promise=sdk.account.createSession(form.email,form.password);container.set("serviceForm",{},true,true);promise.then(function(){var subscribe=document.getElementById('newsletter').checked;if(subscribe){let alerts=container.get('alerts');let loaderId=alerts.add({text:'Loading...',class:""},0);fetch('https://appwrite.io/v1/newsletter/subscribe',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name:form.name,email:form.email,}),}).finally(function(){alerts.remove(loaderId);window.location='/console';});}else{window.location='/console';}},function(error){window.location='/auth/signup?failure=1';});});window.addEventListener("load",async()=>{const bars=12;const realtime=window.ls.container.get('realtime');const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));let current={};window.ls.container.get('console').subscribe(['project','console'],response=>{switch(response.event){case'stats.connections':for(let project in response.payload){current[project]=response.payload[project]??0;}
|
||||
break;case'database.attributes.create':case'database.attributes.update':case'database.attributes.delete':document.dispatchEvent(new CustomEvent('database.createAttribute'));break;case'database.indexes.create':case'database.indexes.update':case'database.indexes.delete':document.dispatchEvent(new CustomEvent('database.createIndex'));break;case'functions.deployments.create':case'functions.deployments.update':case'functions.deployments.delete':document.dispatchEvent(new CustomEvent('functions.createDeployment'));break;case'functions.executions.create':case'functions.executions.update':case'functions.executions.delete':console.log("Received execution event")
|
||||
document.dispatchEvent(new CustomEvent('functions.createExecution'));break;}});while(true){let newHistory={};let createdHistory=false;for(const project in current){let history=realtime?.history??{};if(!(project in history)){history[project]=new Array(bars).fill({percentage:0,value:0});}
|
||||
break;case'database.attributes.create':case'database.attributes.update':case'database.attributes.delete':document.dispatchEvent(new CustomEvent('database.createAttribute'));break;case'database.indexes.create':case'database.indexes.update':case'database.indexes.delete':document.dispatchEvent(new CustomEvent('database.createIndex'));break;case'functions.deployments.create':case'functions.deployments.update':case'functions.deployments.delete':document.dispatchEvent(new CustomEvent('functions.createDeployment'));break;case'functions.executions.create':case'functions.executions.update':case'functions.executions.delete':document.dispatchEvent(new CustomEvent('functions.createExecution'));break;}});while(true){let newHistory={};let createdHistory=false;for(const project in current){let history=realtime?.history??{};if(!(project in history)){history[project]=new Array(bars).fill({percentage:0,value:0});}
|
||||
history=history[project];history.push({percentage:0,value:current[project]});if(history.length>=bars){history.shift();}
|
||||
const highest=history.reduce((prev,curr)=>{return(curr.value>prev)?curr.value:prev;},0);history=history.map(({percentage,value})=>{createdHistory=true;percentage=value===0?0:((Math.round((value/highest)*10)/10)*100);if(percentage>100)percentage=100;else if(percentage==0&&value!=0)percentage=5;return{percentage:percentage,value:value};})
|
||||
newHistory[project]=history;}
|
||||
|
|
@ -3716,7 +3716,7 @@ let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;+
|
|||
let thresh=1000;if(Math.abs($value)<thresh){return'B';}
|
||||
let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;++u;}while(Math.abs($value)>=thresh&&u<units.length-1);return units[u];}).add("statsTotal",function($value){if(!$value){return 0;}
|
||||
$value=abbreviate($value,0,false,false);return $value??"N/A";}).add("statsGetLast",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value[$value.length-1].value;}).add("statsGetSum",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value[$value.length-1].value;}).add("statsGetTotal",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value.reduce(function(value,object){return value+object.value},0);}).add("isEmpty",function($value){return(!!$value);}).add("isEmptyObject",function($value){return((Object.keys($value).length===0&&$value.constructor===Object)||$value.length===0)}).add("activeDomainsCount",function($value){let result=[];if(Array.isArray($value)){result=$value.filter(function(node){return(node.verification&&node.certificateId);});}
|
||||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';}
|
||||
|
|
@ -3877,7 +3877,7 @@ for(var i=0;i<newParts.length;i++){const a=parseInt(newParts[i])||0
|
|||
const b=parseInt(oldParts[i])||0
|
||||
if(a>b)return true
|
||||
if(a<b)return false}
|
||||
return false}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-next",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());let sum=parseInt(expression.parse(element.dataset["sum"])||"0");paths=paths.concat(expression.getPaths());if(offset+limit>=sum){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-highlight",controller:function(element,expression,document){let check=function(){let links=element.getElementsByTagName("a");let selected=null;let list=[];for(let i=0;i<links.length;i++){list.push(links[i]);}
|
||||
return false}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-next",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());let total=parseInt(expression.parse(element.dataset["total"])||"0");paths=paths.concat(expression.getPaths());if(offset+limit>=total){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-highlight",controller:function(element,expression,document){let check=function(){let links=element.getElementsByTagName("a");let selected=null;let list=[];for(let i=0;i<links.length;i++){list.push(links[i]);}
|
||||
list.sort(function(a,b){return a.pathname.length-b.pathname.length;});if(selected&&list[selected].dataset["selected"]){let parent=element.querySelector("a[href='"+list[selected].dataset["selected"]+"']");if(parent){parent.classList.remove("selected");}}
|
||||
for(let i=0;i<list.length;i++){let path=list[i].pathname;if(path===window.location.pathname.substring(0,path.length)){list[i].classList.add("selected");if(selected!==null){list[selected].classList.remove("selected");}
|
||||
selected=i;}else{list[i].classList.remove("selected");}}
|
||||
|
|
|
|||
5
public/dist/scripts/app-dep.js
vendored
5
public/dist/scripts/app-dep.js
vendored
|
|
@ -513,7 +513,7 @@ if(typeof fileId==='undefined'){throw new AppwriteException('Missing required pa
|
|||
let path='/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getFileDownload:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getFilePreview:(bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output)=>__awaiter(this,void 0,void 0,function*(){if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
return uri;},getFilePreview:(bucketId,fileId,width,height,gravity,quality,borderWidth,borderColor,borderRadius,opacity,rotation,background,output)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};if(typeof width!=='undefined'){payload['width']=width;}
|
||||
if(typeof height!=='undefined'){payload['height']=height;}
|
||||
|
|
@ -526,7 +526,8 @@ if(typeof opacity!=='undefined'){payload['opacity']=opacity;}
|
|||
if(typeof rotation!=='undefined'){payload['rotation']=rotation;}
|
||||
if(typeof background!=='undefined'){payload['background']=background;}
|
||||
if(typeof output!=='undefined'){payload['output']=output;}
|
||||
const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getFileView:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getFileView:(bucketId,fileId)=>{if(typeof bucketId==='undefined'){throw new AppwriteException('Missing required parameter: "bucketId"');}
|
||||
if(typeof fileId==='undefined'){throw new AppwriteException('Missing required parameter: "fileId"');}
|
||||
let path='/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}',bucketId).replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);}
|
||||
return uri;},getUsage:(range)=>__awaiter(this,void 0,void 0,function*(){let path='/storage/usage';let payload={};if(typeof range!=='undefined'){payload['range']=range;}
|
||||
|
|
|
|||
7
public/dist/scripts/app.js
vendored
7
public/dist/scripts/app.js
vendored
|
|
@ -494,8 +494,7 @@ handler2.inline=(el,{expression},{cleanup:cleanup2})=>{let root=closestRoot(el);
|
|||
root._x_refs={};root._x_refs[expression]=el;cleanup2(()=>delete root._x_refs[expression]);};directive("ref",handler2);directive("if",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{let evaluate2=evaluateLater(el,expression);let show=()=>{if(el._x_currentIfEl)
|
||||
return el._x_currentIfEl;let clone2=el.content.cloneNode(true).firstElementChild;addScopeToNode(clone2,{},el);mutateDom(()=>{el.after(clone2);initTree(clone2);});el._x_currentIfEl=clone2;el._x_undoIf=()=>{clone2.remove();delete el._x_currentIfEl;};return clone2;};let hide=()=>{if(!el._x_undoIf)
|
||||
return;el._x_undoIf();delete el._x_undoIf;};effect3(()=>evaluate2((value)=>{value?show():hide();}));cleanup2(()=>el._x_undoIf&&el._x_undoIf());});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((el,{value,modifiers,expression},{cleanup:cleanup2})=>{let evaluate2=expression?evaluateLater(el,expression):()=>{};let removeListener=on(el,value,modifiers,(e)=>{evaluate2(()=>{},{scope:{$event:e},params:[e]});});cleanup2(()=>removeListener());}));alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default;window.Alpine=src_default;queueMicrotask(()=>{src_default.start();});})();window.ls.error=function(){return function(error){window.console.error(error);if(window.location.pathname!=='/console'){window.location='/console';}};};window.addEventListener("error",function(event){console.error("ERROR-EVENT:",event.error.message,event.error.stack);});document.addEventListener("account.deleteSession",function(){window.location="/auth/signin";});document.addEventListener("account.create",function(){let container=window.ls.container;let form=container.get('serviceForm');let sdk=container.get('console');let promise=sdk.account.createSession(form.email,form.password);container.set("serviceForm",{},true,true);promise.then(function(){var subscribe=document.getElementById('newsletter').checked;if(subscribe){let alerts=container.get('alerts');let loaderId=alerts.add({text:'Loading...',class:""},0);fetch('https://appwrite.io/v1/newsletter/subscribe',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name:form.name,email:form.email,}),}).finally(function(){alerts.remove(loaderId);window.location='/console';});}else{window.location='/console';}},function(error){window.location='/auth/signup?failure=1';});});window.addEventListener("load",async()=>{const bars=12;const realtime=window.ls.container.get('realtime');const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));let current={};window.ls.container.get('console').subscribe(['project','console'],response=>{switch(response.event){case'stats.connections':for(let project in response.payload){current[project]=response.payload[project]??0;}
|
||||
break;case'database.attributes.create':case'database.attributes.update':case'database.attributes.delete':document.dispatchEvent(new CustomEvent('database.createAttribute'));break;case'database.indexes.create':case'database.indexes.update':case'database.indexes.delete':document.dispatchEvent(new CustomEvent('database.createIndex'));break;case'functions.deployments.create':case'functions.deployments.update':case'functions.deployments.delete':document.dispatchEvent(new CustomEvent('functions.createDeployment'));break;case'functions.executions.create':case'functions.executions.update':case'functions.executions.delete':console.log("Received execution event")
|
||||
document.dispatchEvent(new CustomEvent('functions.createExecution'));break;}});while(true){let newHistory={};let createdHistory=false;for(const project in current){let history=realtime?.history??{};if(!(project in history)){history[project]=new Array(bars).fill({percentage:0,value:0});}
|
||||
break;case'database.attributes.create':case'database.attributes.update':case'database.attributes.delete':document.dispatchEvent(new CustomEvent('database.createAttribute'));break;case'database.indexes.create':case'database.indexes.update':case'database.indexes.delete':document.dispatchEvent(new CustomEvent('database.createIndex'));break;case'functions.deployments.create':case'functions.deployments.update':case'functions.deployments.delete':document.dispatchEvent(new CustomEvent('functions.createDeployment'));break;case'functions.executions.create':case'functions.executions.update':case'functions.executions.delete':document.dispatchEvent(new CustomEvent('functions.createExecution'));break;}});while(true){let newHistory={};let createdHistory=false;for(const project in current){let history=realtime?.history??{};if(!(project in history)){history[project]=new Array(bars).fill({percentage:0,value:0});}
|
||||
history=history[project];history.push({percentage:0,value:current[project]});if(history.length>=bars){history.shift();}
|
||||
const highest=history.reduce((prev,curr)=>{return(curr.value>prev)?curr.value:prev;},0);history=history.map(({percentage,value})=>{createdHistory=true;percentage=value===0?0:((Math.round((value/highest)*10)/10)*100);if(percentage>100)percentage=100;else if(percentage==0&&value!=0)percentage=5;return{percentage:percentage,value:value};})
|
||||
newHistory[project]=history;}
|
||||
|
|
@ -669,7 +668,7 @@ let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;+
|
|||
let thresh=1000;if(Math.abs($value)<thresh){return'B';}
|
||||
let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;++u;}while(Math.abs($value)>=thresh&&u<units.length-1);return units[u];}).add("statsTotal",function($value){if(!$value){return 0;}
|
||||
$value=abbreviate($value,0,false,false);return $value??"N/A";}).add("statsGetLast",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value[$value.length-1].value;}).add("statsGetSum",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value[$value.length-1].value;}).add("statsGetTotal",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value.reduce(function(value,object){return value+object.value},0);}).add("isEmpty",function($value){return(!!$value);}).add("isEmptyObject",function($value){return((Object.keys($value).length===0&&$value.constructor===Object)||$value.length===0)}).add("activeDomainsCount",function($value){let result=[];if(Array.isArray($value)){result=$value.filter(function(node){return(node.verification&&node.certificateId);});}
|
||||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';}
|
||||
|
|
@ -830,7 +829,7 @@ for(var i=0;i<newParts.length;i++){const a=parseInt(newParts[i])||0
|
|||
const b=parseInt(oldParts[i])||0
|
||||
if(a>b)return true
|
||||
if(a<b)return false}
|
||||
return false}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-next",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());let sum=parseInt(expression.parse(element.dataset["sum"])||"0");paths=paths.concat(expression.getPaths());if(offset+limit>=sum){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-highlight",controller:function(element,expression,document){let check=function(){let links=element.getElementsByTagName("a");let selected=null;let list=[];for(let i=0;i<links.length;i++){list.push(links[i]);}
|
||||
return false}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-next",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());let total=parseInt(expression.parse(element.dataset["total"])||"0");paths=paths.concat(expression.getPaths());if(offset+limit>=total){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-highlight",controller:function(element,expression,document){let check=function(){let links=element.getElementsByTagName("a");let selected=null;let list=[];for(let i=0;i<links.length;i++){list.push(links[i]);}
|
||||
list.sort(function(a,b){return a.pathname.length-b.pathname.length;});if(selected&&list[selected].dataset["selected"]){let parent=element.querySelector("a[href='"+list[selected].dataset["selected"]+"']");if(parent){parent.classList.remove("selected");}}
|
||||
for(let i=0;i<list.length;i++){let path=list[i].pathname;if(path===window.location.pathname.substring(0,path.length)){list[i].classList.add("selected");if(selected!==null){list[selected].classList.remove("selected");}
|
||||
selected=i;}else{list[i].classList.remove("selected");}}
|
||||
|
|
|
|||
|
|
@ -4472,9 +4472,9 @@
|
|||
* @param {string} background
|
||||
* @param {string} output
|
||||
* @throws {AppwriteException}
|
||||
* @returns {Promise}
|
||||
* @returns {URL}
|
||||
*/
|
||||
getFilePreview: (bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) => __awaiter(this, void 0, void 0, function* () {
|
||||
getFilePreview: (bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) => {
|
||||
if (typeof bucketId === 'undefined') {
|
||||
throw new AppwriteException('Missing required parameter: "bucketId"');
|
||||
}
|
||||
|
|
@ -4517,10 +4517,12 @@
|
|||
payload['output'] = output;
|
||||
}
|
||||
const uri = new URL(this.config.endpoint + path);
|
||||
return yield this.call('get', uri, {
|
||||
'content-type': 'application/json',
|
||||
}, payload);
|
||||
}),
|
||||
payload['project'] = this.config.project;
|
||||
for (const [key, value] of Object.entries(this.flatten(payload))) {
|
||||
uri.searchParams.append(key, value);
|
||||
}
|
||||
return uri;
|
||||
},
|
||||
/**
|
||||
* Get File for View
|
||||
*
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ window.ls.filter
|
|||
|
||||
return $value[$value.length - 1].value;
|
||||
})
|
||||
.add("statsGetSum", function ($value) {
|
||||
.add("statsGetTotal", function ($value) {
|
||||
if (!$value || $value.length < 1) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
|
||||
paths = paths.concat(expression.getPaths());
|
||||
|
||||
let sum = parseInt(expression.parse(element.dataset["sum"]) || "0");
|
||||
let total = parseInt(expression.parse(element.dataset["total"]) || "0");
|
||||
|
||||
paths = paths.concat(expression.getPaths());
|
||||
|
||||
if (offset + limit >= sum) {
|
||||
if (offset + limit >= total) {
|
||||
element.disabled = true;
|
||||
} else {
|
||||
element.disabled = false;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class Response extends SwooleResponse
|
|||
const MODEL_EXECUTION = 'execution';
|
||||
const MODEL_EXECUTION_LIST = 'executionList';
|
||||
const MODEL_BUILD = 'build';
|
||||
const MODEL_BUILD_LIST = 'buildList';
|
||||
const MODEL_BUILD_LIST = 'buildList'; // Not used anywhere yet
|
||||
const MODEL_FUNC_PERMISSIONS = 'funcPermissions';
|
||||
|
||||
// Project
|
||||
|
|
@ -225,7 +225,7 @@ class Response extends SwooleResponse
|
|||
->setModel(new BaseList('Runtimes List', self::MODEL_RUNTIME_LIST, 'runtimes', self::MODEL_RUNTIME))
|
||||
->setModel(new BaseList('Deployments List', self::MODEL_DEPLOYMENT_LIST, 'deployments', self::MODEL_DEPLOYMENT))
|
||||
->setModel(new BaseList('Executions List', self::MODEL_EXECUTION_LIST, 'executions', self::MODEL_EXECUTION))
|
||||
->setModel(new BaseList('Builds List', self::MODEL_BUILD_LIST, 'builds', self::MODEL_BUILD))
|
||||
->setModel(new BaseList('Builds List', self::MODEL_BUILD_LIST, 'builds', self::MODEL_BUILD)) // Not used anywhere yet
|
||||
->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false))
|
||||
->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false))
|
||||
->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false))
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ class AttributeList extends Model
|
|||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('sum', [
|
||||
->addRule('total', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total sum of items in the list.',
|
||||
'description' => 'Total number of attributes in the given collection.',
|
||||
'default' => 0,
|
||||
'example' => 5,
|
||||
])
|
||||
|
|
|
|||
|
|
@ -32,9 +32,21 @@ class BaseList extends Model
|
|||
$this->public = $public;
|
||||
|
||||
if ($paging) {
|
||||
$this->addRule('sum', [
|
||||
$namesWithCap = [
|
||||
'documents', 'collections', 'users', 'files', 'buckets', 'functions',
|
||||
'deployments', 'executions', 'projects', 'webhooks', 'keys',
|
||||
'platforms', 'domains', 'memberships', 'teams'
|
||||
];
|
||||
|
||||
if (\in_array($name, $namesWithCap)) {
|
||||
$description = 'Total number of ' . $key . ' documents that matched your query used as reference for offset pagination. When the `total` number of ' . $key . ' documents available is greater than 5000, total returned will be capped at 5000, and cursor pagination should be used. Read more about [pagination](https://appwrite.io/docs/pagination).';
|
||||
} else {
|
||||
$description = 'Total number of ' . $key . ' documents that matched your query.';
|
||||
}
|
||||
|
||||
$this->addRule('total', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total number of items available on the server.',
|
||||
'description' => $description,
|
||||
'default' => 0,
|
||||
'example' => 5,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ class Team extends Model
|
|||
'default' => 0,
|
||||
'example' => 1592981250,
|
||||
])
|
||||
->addRule('sum', [
|
||||
->addRule('total', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total sum of team members.',
|
||||
'description' => 'Total number of team members.',
|
||||
'default' => 0,
|
||||
'example' => 7,
|
||||
])
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ trait AccountBase
|
|||
$this->assertIsArray($response['body']);
|
||||
$this->assertNotEmpty($response['body']);
|
||||
$this->assertCount(2, $response['body']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertEquals($sessionId, $response['body']['sessions'][0]['$id']);
|
||||
|
||||
$this->assertEquals('Windows', $response['body']['sessions'][0]['osName']);
|
||||
|
|
@ -325,7 +325,7 @@ trait AccountBase
|
|||
$this->assertIsArray($response['body']['logs']);
|
||||
$this->assertNotEmpty($response['body']['logs']);
|
||||
$this->assertCount(2, $response['body']['logs']);
|
||||
$this->assertIsNumeric($response['body']['sum']);
|
||||
$this->assertIsNumeric($response['body']['total']);
|
||||
|
||||
$this->assertContains($response['body']['logs'][0]['event'], ['account.create', 'account.sessions.create']);
|
||||
$this->assertEquals($response['body']['logs'][0]['ip'], filter_var($response['body']['logs'][0]['ip'], FILTER_VALIDATE_IP));
|
||||
|
|
@ -384,7 +384,7 @@ trait AccountBase
|
|||
$this->assertIsArray($responseLimit['body']['logs']);
|
||||
$this->assertNotEmpty($responseLimit['body']['logs']);
|
||||
$this->assertCount(1, $responseLimit['body']['logs']);
|
||||
$this->assertIsNumeric($responseLimit['body']['sum']);
|
||||
$this->assertIsNumeric($responseLimit['body']['total']);
|
||||
|
||||
$this->assertEquals($response['body']['logs'][0], $responseLimit['body']['logs'][0]);
|
||||
|
||||
|
|
@ -401,7 +401,7 @@ trait AccountBase
|
|||
$this->assertIsArray($responseOffset['body']['logs']);
|
||||
$this->assertNotEmpty($responseOffset['body']['logs']);
|
||||
$this->assertCount(1, $responseOffset['body']['logs']);
|
||||
$this->assertIsNumeric($responseOffset['body']['sum']);
|
||||
$this->assertIsNumeric($responseOffset['body']['total']);
|
||||
|
||||
$this->assertEquals($response['body']['logs'][1], $responseOffset['body']['logs'][0]);
|
||||
|
||||
|
|
@ -419,7 +419,7 @@ trait AccountBase
|
|||
$this->assertIsArray($responseLimitOffset['body']['logs']);
|
||||
$this->assertNotEmpty($responseLimitOffset['body']['logs']);
|
||||
$this->assertCount(1, $responseLimitOffset['body']['logs']);
|
||||
$this->assertIsNumeric($responseLimitOffset['body']['sum']);
|
||||
$this->assertIsNumeric($responseLimitOffset['body']['total']);
|
||||
|
||||
$this->assertEquals($response['body']['logs'][1], $responseLimitOffset['body']['logs'][0]);
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ trait DatabaseBase
|
|||
]));
|
||||
|
||||
$this->assertEquals(200, $attributes['headers']['status-code']);
|
||||
$this->assertEquals(8, $attributes['body']['sum']);
|
||||
$this->assertEquals(8, $attributes['body']['total']);
|
||||
|
||||
$attributes = $attributes['body']['attributes'];
|
||||
|
||||
|
|
@ -2017,7 +2017,7 @@ trait DatabaseBase
|
|||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(3, $documents['body']['sum']);
|
||||
$this->assertEquals(3, $documents['body']['total']);
|
||||
$this->assertCount(3, $documents['body']['documents']);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class DatabaseConsoleClientTest extends Scope
|
|||
|
||||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/database/collections/' . $data['moviesId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -150,7 +150,7 @@ class DatabaseConsoleClientTest extends Scope
|
|||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertLessThanOrEqual(1, count($logs['body']['logs']));
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/database/collections/' . $data['moviesId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -161,7 +161,7 @@ class DatabaseConsoleClientTest extends Scope
|
|||
|
||||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/database/collections/' . $data['moviesId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -174,6 +174,6 @@ class DatabaseConsoleClientTest extends Scope
|
|||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertLessThanOrEqual(1, count($logs['body']['logs']));
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class DatabaseCustomServerTest extends Scope
|
|||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(2, $collections['body']['sum']);
|
||||
$this->assertEquals(2, $collections['body']['total']);
|
||||
$this->assertEquals($test1['body']['$id'], $collections['body']['collections'][0]['$id']);
|
||||
$this->assertEquals($test2['body']['$id'], $collections['body']['collections'][1]['$id']);
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class DatabaseCustomServerTest extends Scope
|
|||
'orderType' => 'DESC'
|
||||
]);
|
||||
|
||||
$this->assertEquals(2, $collections['body']['sum']);
|
||||
$this->assertEquals(2, $collections['body']['total']);
|
||||
$this->assertEquals($base[0]['$id'], $collections['body']['collections'][0]['$id']);
|
||||
$this->assertEquals($base[1]['$id'], $collections['body']['collections'][1]['$id']);
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ class DatabaseCustomServerTest extends Scope
|
|||
'search' => 'first'
|
||||
]);
|
||||
|
||||
$this->assertEquals(1, $collections['body']['sum']);
|
||||
$this->assertEquals(1, $collections['body']['total']);
|
||||
$this->assertEquals('first', $collections['body']['collections'][0]['$id']);
|
||||
|
||||
$collections = $this->client->call(Client::METHOD_GET, '/database/collections', array_merge([
|
||||
|
|
@ -145,7 +145,7 @@ class DatabaseCustomServerTest extends Scope
|
|||
'search' => 'Test'
|
||||
]);
|
||||
|
||||
$this->assertEquals(2, $collections['body']['sum']);
|
||||
$this->assertEquals(2, $collections['body']['total']);
|
||||
$this->assertEquals('Test 1', $collections['body']['collections'][0]['name']);
|
||||
$this->assertEquals('Test 2', $collections['body']['collections'][1]['name']);
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ class DatabaseCustomServerTest extends Scope
|
|||
'search' => 'Nonexistent'
|
||||
]);
|
||||
|
||||
$this->assertEquals(0, $collections['body']['sum']);
|
||||
$this->assertEquals(0, $collections['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ trait FunctionsBase
|
|||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertNotEmpty($response['body']['$id']);
|
||||
// $this->assertEquals('Arsenal', $response['body']['name']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
// /**
|
||||
|
|
@ -57,8 +57,8 @@ trait FunctionsBase
|
|||
// ], $this->getHeaders()));
|
||||
|
||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertGreaterThan(0, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(0, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertCount(3, $response['body']['teams']);
|
||||
|
||||
// $response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -69,8 +69,8 @@ trait FunctionsBase
|
|||
// ]);
|
||||
|
||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertGreaterThan(0, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(0, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertCount(2, $response['body']['teams']);
|
||||
|
||||
// $response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -81,8 +81,8 @@ trait FunctionsBase
|
|||
// ]);
|
||||
|
||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertGreaterThan(0, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(0, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertCount(2, $response['body']['teams']);
|
||||
|
||||
// $response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -93,8 +93,8 @@ trait FunctionsBase
|
|||
// ]);
|
||||
|
||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertGreaterThan(0, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(0, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertCount(1, $response['body']['teams']);
|
||||
// $this->assertEquals('Manchester United', $response['body']['teams'][0]['name']);
|
||||
|
||||
|
|
@ -106,8 +106,8 @@ trait FunctionsBase
|
|||
// ]);
|
||||
|
||||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertGreaterThan(0, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(0, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertCount(1, $response['body']['teams']);
|
||||
// $this->assertEquals('Manchester United', $response['body']['teams'][0]['name']);
|
||||
|
||||
|
|
@ -133,8 +133,8 @@ trait FunctionsBase
|
|||
// $this->assertEquals(201, $response['headers']['status-code']);
|
||||
// $this->assertNotEmpty($response['body']['$id']);
|
||||
// $this->assertEquals('Demo', $response['body']['name']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
// $response = $this->client->call(Client::METHOD_PUT, '/teams/'.$response['body']['$id'], array_merge([
|
||||
|
|
@ -147,8 +147,8 @@ trait FunctionsBase
|
|||
// $this->assertEquals(200, $response['headers']['status-code']);
|
||||
// $this->assertNotEmpty($response['body']['$id']);
|
||||
// $this->assertEquals('Demo New', $response['body']['name']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
// /**
|
||||
|
|
@ -182,8 +182,8 @@ trait FunctionsBase
|
|||
// $this->assertEquals(201, $response['headers']['status-code']);
|
||||
// $this->assertNotEmpty($response['body']['$id']);
|
||||
// $this->assertEquals('Demo', $response['body']['name']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
// $this->assertIsInt($response['body']['sum']);
|
||||
// $this->assertGreaterThan(-1, $response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['total']);
|
||||
// $this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
// $response = $this->client->call(Client::METHOD_DELETE, '/teams/'.$teamUid, array_merge([
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($functions['headers']['status-code'], 200);
|
||||
$this->assertEquals($functions['body']['sum'], 2);
|
||||
$this->assertEquals($functions['body']['total'], 2);
|
||||
$this->assertIsArray($functions['body']['functions']);
|
||||
$this->assertCount(2, $functions['body']['functions']);
|
||||
$this->assertEquals($functions['body']['functions'][0]['name'], 'Test');
|
||||
|
|
@ -389,7 +389,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($function['headers']['status-code'], 200);
|
||||
$this->assertEquals($function['body']['sum'], 2);
|
||||
$this->assertEquals($function['body']['total'], 2);
|
||||
$this->assertIsArray($function['body']['deployments']);
|
||||
$this->assertCount(2, $function['body']['deployments']);
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]));
|
||||
|
||||
$this->assertEquals($function['headers']['status-code'], 200);
|
||||
$this->assertEquals(2, $function['body']['sum']);
|
||||
$this->assertEquals(2, $function['body']['total']);
|
||||
$this->assertIsArray($function['body']['deployments']);
|
||||
$this->assertCount(2, $function['body']['deployments']);
|
||||
$this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']);
|
||||
|
|
@ -417,7 +417,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]));
|
||||
|
||||
$this->assertEquals($function['headers']['status-code'], 200);
|
||||
$this->assertEquals(2, $function['body']['sum']);
|
||||
$this->assertEquals(2, $function['body']['total']);
|
||||
$this->assertIsArray($function['body']['deployments']);
|
||||
$this->assertCount(2, $function['body']['deployments']);
|
||||
$this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']);
|
||||
|
|
@ -430,7 +430,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
]));
|
||||
|
||||
$this->assertEquals($function['headers']['status-code'], 200);
|
||||
$this->assertEquals(2, $function['body']['sum']);
|
||||
$this->assertEquals(2, $function['body']['total']);
|
||||
$this->assertIsArray($function['body']['deployments']);
|
||||
$this->assertCount(2, $function['body']['deployments']);
|
||||
$this->assertEquals($function['body']['deployments'][0]['$id'], $data['deploymentId']);
|
||||
|
|
@ -540,7 +540,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($function['headers']['status-code'], 200);
|
||||
$this->assertEquals($function['body']['sum'], 1);
|
||||
$this->assertEquals($function['body']['total'], 1);
|
||||
$this->assertIsArray($function['body']['executions']);
|
||||
$this->assertCount(1, $function['body']['executions']);
|
||||
$this->assertEquals($function['body']['executions'][0]['$id'], $data['executionId']);
|
||||
|
|
@ -557,8 +557,8 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['executions']);
|
||||
$this->assertEquals($data['functionId'], $response['body']['executions'][0]['functionId']);
|
||||
|
||||
|
|
@ -570,8 +570,8 @@ class FunctionsCustomServerTest extends Scope
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['executions']);
|
||||
$this->assertEquals($data['executionId'], $response['body']['executions'][0]['$id']);
|
||||
|
||||
|
|
@ -755,7 +755,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -870,7 +870,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -976,7 +976,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -1081,7 +1081,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -1186,7 +1186,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -1291,7 +1291,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($executions['headers']['status-code'], 200);
|
||||
$this->assertEquals($executions['body']['sum'], 1);
|
||||
$this->assertEquals($executions['body']['total'], 1);
|
||||
$this->assertIsArray($executions['body']['executions']);
|
||||
$this->assertCount(1, $executions['body']['executions']);
|
||||
$this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -1396,7 +1396,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
// ], $this->getHeaders()));
|
||||
|
||||
// $this->assertEquals($executions['headers']['status-code'], 200);
|
||||
// $this->assertEquals($executions['body']['sum'], 1);
|
||||
// $this->assertEquals($executions['body']['total'], 1);
|
||||
// $this->assertIsArray($executions['body']['executions']);
|
||||
// $this->assertCount(1, $executions['body']['executions']);
|
||||
// $this->assertEquals($executions['body']['executions'][0]['$id'], $executionId);
|
||||
|
|
@ -1421,7 +1421,7 @@ class FunctionsCustomServerTest extends Scope
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $runtimes['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $runtimes['body']['sum']);
|
||||
$this->assertGreaterThan(0, $runtimes['body']['total']);
|
||||
|
||||
$runtime = $runtimes['body']['runtimes'][0];
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ trait LocaleBase
|
|||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(194, $response['body']['sum']);
|
||||
$this->assertEquals(194, $response['body']['total']);
|
||||
$this->assertEquals($response['body']['countries'][0]['name'], 'Afghanistan');
|
||||
$this->assertEquals($response['body']['countries'][0]['code'], 'AF');
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ trait LocaleBase
|
|||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(194, $response['body']['sum']);
|
||||
$this->assertEquals(194, $response['body']['total']);
|
||||
$this->assertEquals($response['body']['countries'][0]['name'], 'Afganistán');
|
||||
$this->assertEquals($response['body']['countries'][0]['code'], 'AF');
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ trait LocaleBase
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(27, $response['body']['sum']);
|
||||
$this->assertEquals(27, $response['body']['total']);
|
||||
$this->assertIsArray($response['body']['countries']);
|
||||
$this->assertEquals($response['body']['countries'][0]['name'], 'Austria');
|
||||
$this->assertEquals($response['body']['countries'][0]['code'], 'AT');
|
||||
|
|
@ -95,7 +95,7 @@ trait LocaleBase
|
|||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(27, $response['body']['sum']);
|
||||
$this->assertEquals(27, $response['body']['total']);
|
||||
$this->assertIsArray($response['body']['countries']);
|
||||
$this->assertEquals($response['body']['countries'][0]['name'], 'Alemania');
|
||||
$this->assertEquals($response['body']['countries'][0]['code'], 'DE');
|
||||
|
|
@ -120,7 +120,7 @@ trait LocaleBase
|
|||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(194, $response['body']['sum']);
|
||||
$this->assertEquals(194, $response['body']['total']);
|
||||
$this->assertIsArray($response['body']['phones']);
|
||||
$this->assertEquals($response['body']['phones'][0]['code'], '+1');
|
||||
$this->assertEquals($response['body']['phones'][0]['countryName'], 'Canada');
|
||||
|
|
@ -144,7 +144,7 @@ trait LocaleBase
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(7, $response['body']['sum']);
|
||||
$this->assertEquals(7, $response['body']['total']);
|
||||
$this->assertIsArray($response['body']['continents']);
|
||||
$this->assertEquals($response['body']['continents'][0]['code'], 'AF');
|
||||
$this->assertEquals($response['body']['continents'][0]['name'], 'Africa');
|
||||
|
|
@ -157,7 +157,7 @@ trait LocaleBase
|
|||
]);
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(7, $response['body']['sum']);
|
||||
$this->assertEquals(7, $response['body']['total']);
|
||||
$this->assertIsArray($response['body']['continents']);
|
||||
$this->assertEquals($response['body']['continents'][0]['code'], 'NA');
|
||||
$this->assertEquals($response['body']['continents'][0]['name'], 'América del Norte');
|
||||
|
|
@ -182,7 +182,7 @@ trait LocaleBase
|
|||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(117, $response['body']['sum']);
|
||||
$this->assertEquals(117, $response['body']['total']);
|
||||
$this->assertEquals($response['body']['currencies'][0]['symbol'], '$');
|
||||
$this->assertEquals($response['body']['currencies'][0]['name'], 'US Dollar');
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ trait LocaleBase
|
|||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(184, $response['body']['sum']);
|
||||
$this->assertEquals(184, $response['body']['total']);
|
||||
|
||||
$this->assertEquals($response['body']['languages'][0]['code'], 'aa');
|
||||
$this->assertEquals($response['body']['languages'][0]['name'], 'Afar');
|
||||
|
|
@ -251,7 +251,7 @@ trait LocaleBase
|
|||
// }
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(194, $response['body']['sum']);
|
||||
$this->assertEquals(194, $response['body']['total']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/locale/continents', [
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -268,7 +268,7 @@ trait LocaleBase
|
|||
// }
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals(7, $response['body']['sum']);
|
||||
$this->assertEquals(7, $response['body']['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
]));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals($response['body']['sum'], 1);
|
||||
$this->assertEquals($response['body']['total'], 1);
|
||||
$this->assertIsArray($response['body']['projects']);
|
||||
$this->assertCount(1, $response['body']['projects']);
|
||||
$this->assertEquals($response['body']['projects'][0]['name'], 'Project Test');
|
||||
|
|
@ -123,7 +123,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
]));
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertEquals($response['body']['sum'], 1);
|
||||
$this->assertEquals($response['body']['total'], 1);
|
||||
$this->assertIsArray($response['body']['projects']);
|
||||
$this->assertCount(1, $response['body']['projects']);
|
||||
$this->assertEquals($response['body']['projects'][0]['$id'], $data['projectId']);
|
||||
|
|
@ -861,7 +861,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
@ -1095,7 +1095,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
@ -1420,7 +1420,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(7, $response['body']['sum']);
|
||||
$this->assertEquals(7, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
@ -1926,7 +1926,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
], $this->getHeaders()), []);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ trait StorageBase
|
|||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()));
|
||||
$this->assertEquals(200, $files['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $files['body']['sum']);
|
||||
$this->assertGreaterThan(0, $files['body']['total']);
|
||||
$this->assertGreaterThan(0, count($files['body']['files']));
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ trait TeamsBase
|
|||
$this->assertEquals(201, $response1['headers']['status-code']);
|
||||
$this->assertNotEmpty($response1['body']['$id']);
|
||||
$this->assertEquals('Arsenal', $response1['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response1['body']['sum']);
|
||||
$this->assertIsInt($response1['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response1['body']['total']);
|
||||
$this->assertIsInt($response1['body']['total']);
|
||||
$this->assertIsInt($response1['body']['dateCreated']);
|
||||
|
||||
$teamUid = $response1['body']['$id'];
|
||||
|
|
@ -43,8 +43,8 @@ trait TeamsBase
|
|||
$this->assertNotEmpty($response2['body']['$id']);
|
||||
$this->assertEquals($teamId, $response2['body']['$id']);
|
||||
$this->assertEquals('Manchester United', $response2['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response2['body']['sum']);
|
||||
$this->assertIsInt($response2['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response2['body']['total']);
|
||||
$this->assertIsInt($response2['body']['total']);
|
||||
$this->assertIsInt($response2['body']['dateCreated']);
|
||||
|
||||
$response3 = $this->client->call(Client::METHOD_POST, '/teams', array_merge([
|
||||
|
|
@ -58,8 +58,8 @@ trait TeamsBase
|
|||
$this->assertEquals(201, $response3['headers']['status-code']);
|
||||
$this->assertNotEmpty($response3['body']['$id']);
|
||||
$this->assertEquals('Newcastle', $response3['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response3['body']['sum']);
|
||||
$this->assertIsInt($response3['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response3['body']['total']);
|
||||
$this->assertIsInt($response3['body']['total']);
|
||||
$this->assertIsInt($response3['body']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
@ -94,8 +94,8 @@ trait TeamsBase
|
|||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Arsenal', $response['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
@ -119,8 +119,8 @@ trait TeamsBase
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertGreaterThan(2, count($response['body']['teams']));
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -131,8 +131,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(2, $response['body']['teams']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -143,8 +143,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertGreaterThan(2, $response['body']['teams']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -155,8 +155,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['teams']);
|
||||
$this->assertEquals('Manchester United', $response['body']['teams'][0]['name']);
|
||||
|
||||
|
|
@ -168,8 +168,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['teams']);
|
||||
$this->assertEquals('Manchester United', $response['body']['teams'][0]['name']);
|
||||
|
||||
|
|
@ -181,8 +181,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['teams']);
|
||||
$this->assertEquals('Arsenal', $response['body']['teams'][0]['name']);
|
||||
|
||||
|
|
@ -194,8 +194,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $teams['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $teams['body']['sum']);
|
||||
$this->assertIsInt($teams['body']['sum']);
|
||||
$this->assertGreaterThan(0, $teams['body']['total']);
|
||||
$this->assertIsInt($teams['body']['total']);
|
||||
$this->assertCount(2, $teams['body']['teams']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/teams', array_merge([
|
||||
|
|
@ -207,8 +207,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['teams']);
|
||||
$this->assertEquals($teams['body']['teams'][1]['$id'], $response['body']['teams'][0]['$id']);
|
||||
|
||||
|
|
@ -222,8 +222,8 @@ trait TeamsBase
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertGreaterThan(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['teams']);
|
||||
$this->assertEquals($teams['body']['teams'][0]['$id'], $response['body']['teams'][0]['$id']);
|
||||
|
||||
|
|
@ -258,8 +258,8 @@ trait TeamsBase
|
|||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Demo', $response['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_PUT, '/teams/'.$response['body']['$id'], array_merge([
|
||||
|
|
@ -273,8 +273,8 @@ trait TeamsBase
|
|||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Demo New', $response['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
@ -309,8 +309,8 @@ trait TeamsBase
|
|||
$this->assertEquals(201, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Demo', $response['body']['name']);
|
||||
$this->assertGreaterThan(-1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertGreaterThan(-1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_DELETE, '/teams/'.$teamUid, array_merge([
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertNotEmpty($response['body']['memberships'][0]['$id']);
|
||||
$this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']);
|
||||
$this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']);
|
||||
|
|
@ -38,7 +38,7 @@ trait TeamsBaseClient
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertNotEmpty($response['body']['memberships'][0]);
|
||||
$this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']);
|
||||
$this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']);
|
||||
|
|
@ -52,7 +52,7 @@ trait TeamsBaseClient
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertNotEmpty($response['body']['memberships'][0]);
|
||||
$this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']);
|
||||
$this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']);
|
||||
|
|
@ -66,9 +66,9 @@ trait TeamsBaseClient
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertEmpty($response['body']['memberships']);
|
||||
$this->assertEquals(0, $response['body']['sum']);
|
||||
$this->assertEquals(0, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
@ -191,7 +191,7 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $memberships['headers']['status-code']);
|
||||
$this->assertIsInt($memberships['body']['sum']);
|
||||
$this->assertIsInt($memberships['body']['total']);
|
||||
$this->assertNotEmpty($memberships['body']['memberships']);
|
||||
$this->assertCount(2, $memberships['body']['memberships']);
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ trait TeamsBaseClient
|
|||
]);
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertNotEmpty($response['body']['memberships']);
|
||||
$this->assertCount(1, $response['body']['memberships']);
|
||||
$this->assertEquals($memberships['body']['memberships'][1]['$id'], $response['body']['memberships'][0]['$id']);
|
||||
|
|
@ -441,7 +441,7 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(2, $response['body']['sum']);
|
||||
$this->assertEquals(2, $response['body']['total']);
|
||||
|
||||
$ownerMembershipUid = $response['body']['memberships'][0]['$id'];
|
||||
|
||||
|
|
@ -496,7 +496,7 @@ trait TeamsBaseClient
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for when the owner tries to delete their membership
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ trait TeamsBaseServer
|
|||
], $this->getHeaders()));
|
||||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals(0, $response['body']['sum']);
|
||||
$this->assertEquals(0, $response['body']['total']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
|
@ -201,8 +201,8 @@ trait TeamsBaseServer
|
|||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Arsenal', $response['body']['name']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
|
||||
|
|
@ -227,8 +227,8 @@ trait TeamsBaseServer
|
|||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertNotEmpty($response['body']['$id']);
|
||||
$this->assertEquals('Arsenal', $response['body']['name']);
|
||||
$this->assertEquals(0, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(0, $response['body']['total']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertIsInt($response['body']['dateCreated']);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,8 +155,8 @@ trait UsersBase
|
|||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertIsArray($response['body']['users']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['users']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/users', array_merge([
|
||||
|
|
@ -169,8 +169,8 @@ trait UsersBase
|
|||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertIsArray($response['body']['users']);
|
||||
$this->assertIsInt($response['body']['sum']);
|
||||
$this->assertEquals(1, $response['body']['sum']);
|
||||
$this->assertIsInt($response['body']['total']);
|
||||
$this->assertEquals(1, $response['body']['total']);
|
||||
$this->assertCount(1, $response['body']['users']);
|
||||
|
||||
$response = $this->client->call(Client::METHOD_GET, '/users', array_merge([
|
||||
|
|
@ -234,8 +234,8 @@ trait UsersBase
|
|||
$this->assertEquals($users['headers']['status-code'], 200);
|
||||
$this->assertIsArray($users['body']);
|
||||
$this->assertIsArray($users['body']['users']);
|
||||
$this->assertIsInt($users['body']['sum']);
|
||||
$this->assertGreaterThan(0, $users['body']['sum']);
|
||||
$this->assertIsInt($users['body']['total']);
|
||||
$this->assertGreaterThan(0, $users['body']['total']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
@ -458,7 +458,7 @@ trait UsersBase
|
|||
|
||||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -470,7 +470,7 @@ trait UsersBase
|
|||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertLessThanOrEqual(1, count($logs['body']['logs']));
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -481,7 +481,7 @@ trait UsersBase
|
|||
|
||||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
|
||||
$logs = $this->client->call(Client::METHOD_GET, '/users/' . $data['userId'] . '/logs', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
|
|
@ -494,7 +494,7 @@ trait UsersBase
|
|||
$this->assertEquals($logs['headers']['status-code'], 200);
|
||||
$this->assertIsArray($logs['body']['logs']);
|
||||
$this->assertLessThanOrEqual(1, count($logs['body']['logs']));
|
||||
$this->assertIsNumeric($logs['body']['sum']);
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -544,8 +544,8 @@ trait WebhooksBase
|
|||
$this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide()));
|
||||
$this->assertNotEmpty($webhook['data']['$id']);
|
||||
$this->assertEquals('Arsenal', $webhook['data']['name']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['sum']);
|
||||
$this->assertIsInt($webhook['data']['sum']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
@ -584,8 +584,8 @@ trait WebhooksBase
|
|||
$this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide()));
|
||||
$this->assertNotEmpty($webhook['data']['$id']);
|
||||
$this->assertEquals('Demo New', $webhook['data']['name']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['sum']);
|
||||
$this->assertIsInt($webhook['data']['sum']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
@ -627,8 +627,8 @@ trait WebhooksBase
|
|||
$this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide()));
|
||||
$this->assertNotEmpty($webhook['data']['$id']);
|
||||
$this->assertEquals('Chelsea', $webhook['data']['name']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['sum']);
|
||||
$this->assertIsInt($webhook['data']['sum']);
|
||||
$this->assertGreaterThan(-1, $webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['total']);
|
||||
$this->assertIsInt($webhook['data']['dateCreated']);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ class WebhooksCustomClientTest extends Scope
|
|||
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']);
|
||||
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']);
|
||||
$this->assertEquals(empty($webhook['headers']['X-Appwrite-Webhook-User-Id'] ?? ''), ('server' === $this->getSide()));
|
||||
$this->assertEquals($webhook['data']['sum'], 2);
|
||||
$this->assertEquals($webhook['data']['total'], 2);
|
||||
$this->assertNotEmpty($webhook['data']['sessions'][1]['$id']);
|
||||
$this->assertNotEmpty($webhook['data']['sessions'][1]['userId']);
|
||||
$this->assertIsInt($webhook['data']['sessions'][1]['expire']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue