1
0
Fork 0
mirror of synced 2024-05-19 04:02:34 +12:00

feat: use new $createdAt and $updatedAt attributes

This commit is contained in:
Torsten Dittmann 2022-06-15 14:46:52 +02:00
parent 74cd77e2f1
commit bbdf70ee90
45 changed files with 282 additions and 270 deletions

View file

@ -30,28 +30,6 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateUpdated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'enabled',
'type' => Database::VAR_BOOLEAN,
@ -659,29 +637,7 @@ $collections = [
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateUpdated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
]
],
'indexes' => [
[
@ -1508,17 +1464,6 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'total',
'type' => Database::VAR_INTEGER,
@ -1706,28 +1651,6 @@ $collections = [
'array' => false,
'filters' => [],
],
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateUpdated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'array' => false,
'$id' => 'status',
@ -1856,17 +1779,6 @@ $collections = [
'$id' => 'deployments',
'name' => 'Deployments',
'attributes' => [
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'resourceId',
'type' => Database::VAR_STRING,
@ -2158,17 +2070,6 @@ $collections = [
'$id' => 'executions',
'name' => 'Executions',
'attributes' => [
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => true,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'functionId',
'type' => Database::VAR_STRING,
@ -2379,26 +2280,6 @@ $collections = [
'$id' => 'buckets',
'name' => 'Buckets',
'attributes' => [
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'signed' => false,
'size' => 0,
'required' => false,
'array' => false,
'filters' => [],
],
[
'$id' => 'dateUpdated',
'type' => Database::VAR_INTEGER,
'size' => 0,
'format' => '',
'signed' => false,
'required' => false,
'array' => false,
'filters' => [],
],
[
'$id' => 'enabled',
'type' => Database::VAR_BOOLEAN,
@ -2639,17 +2520,6 @@ $collections = [
'$id' => 'files',
'$name' => 'Files',
'attributes' => [
[
'$id' => 'dateCreated',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => false,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'array' => false,
'$id' => 'bucketId',

View file

@ -1530,8 +1530,7 @@ App::patch('/v1/account/sessions/:sessionId')
$session
->setAttribute('providerAccessToken', $oauth2->getAccessToken(''))
->setAttribute('providerRefreshToken', $oauth2->getRefreshToken(''))
->setAttribute('providerAccessTokenExpiry', \time() + (int) $oauth2->getAccessTokenExpiry(''))
;
->setAttribute('providerAccessTokenExpiry', \time() + (int) $oauth2->getAccessTokenExpiry(''));
$dbForProject->updateDocument('sessions', $sessionId, $session);

View file

@ -166,8 +166,6 @@ App::post('/v1/database/collections')
'$read' => $read ?? [], // Collection permissions for collection documents (based on permission model)
'$write' => $write ?? [], // Collection permissions for collection documents (based on permission model)
'permission' => $permission, // Permissions model type (document vs collection)
'dateCreated' => time(),
'dateUpdated' => time(),
'enabled' => true,
'name' => $name,
'search' => implode(' ', [$collectionId, $name]),
@ -597,7 +595,6 @@ App::put('/v1/database/collections/:collectionId')
->setAttribute('$read', $read)
->setAttribute('name', $name)
->setAttribute('permission', $permission)
->setAttribute('dateUpdated', time())
->setAttribute('enabled', $enabled)
->setAttribute('search', implode(' ', [$collectionId, $name])));
} catch (AuthorizationException $exception) {

View file

@ -66,8 +66,6 @@ App::post('/v1/functions')
$function = $dbForProject->createDocument('functions', new Document([
'$id' => $functionId,
'execute' => $execute,
'dateCreated' => time(),
'dateUpdated' => time(),
'status' => 'disabled',
'name' => $name,
'runtime' => $runtime,
@ -315,7 +313,6 @@ App::put('/v1/functions/:functionId')
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
'execute' => $execute,
'dateUpdated' => time(),
'name' => $name,
'vars' => $vars,
'events' => $events,
@ -575,7 +572,6 @@ App::post('/v1/functions/:functionId/deployments')
'$write' => ['role:all'],
'resourceId' => $function->getId(),
'resourceType' => 'functions',
'dateCreated' => time(),
'entrypoint' => $entrypoint,
'path' => $path,
'size' => $fileSize,
@ -605,7 +601,6 @@ App::post('/v1/functions/:functionId/deployments')
'$write' => ['role:all'],
'resourceId' => $function->getId(),
'resourceType' => 'functions',
'dateCreated' => time(),
'entrypoint' => $entrypoint,
'path' => $path,
'size' => $fileSize,
@ -854,11 +849,11 @@ App::post('/v1/functions/:functionId/executions')
$executionId = $dbForProject->getId();
/** @var Document $execution */
$execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', new Document([
'$id' => $executionId,
'$read' => (!$user->isEmpty()) ? ['user:' . $user->getId()] : [],
'$write' => [],
'dateCreated' => time(),
'functionId' => $function->getId(),
'deploymentId' => $deployment->getId(),
'trigger' => 'http', // http / schedule / event
@ -952,7 +947,7 @@ App::post('/v1/functions/:functionId/executions')
$execution->setAttribute('time', $executionResponse['time']);
} catch (\Throwable $th) {
$endtime = \microtime(true);
$time = $endtime - $execution->getAttribute('dateCreated');
$time = $endtime - $execution->getCreatedAt();
$execution->setAttribute('time', $time);
$execution->setAttribute('status', 'failed');
$execution->setAttribute('statusCode', $th->getCode());

View file

@ -998,9 +998,7 @@ App::post('/v1/projects/:projectId/platforms')
'name' => $name,
'key' => $key,
'store' => $store,
'hostname' => $hostname,
'dateCreated' => \time(),
'dateUpdated' => \time(),
'hostname' => $hostname
]);
$platform = $dbForConsole->createDocument('platforms', $platform);
@ -1112,7 +1110,6 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
$platform
->setAttribute('name', $name)
->setAttribute('dateUpdated', \time())
->setAttribute('key', $key)
->setAttribute('store', $store)
->setAttribute('hostname', $hostname)

View file

@ -107,8 +107,6 @@ App::post('/v1/storage/buckets')
$bucket = $dbForProject->createDocument('buckets', new Document([
'$id' => $bucketId,
'$collection' => 'buckets',
'dateCreated' => \time(),
'dateUpdated' => \time(),
'name' => $name,
'permission' => $permission,
'maximumFileSize' => $maximumFileSize,
@ -546,7 +544,6 @@ App::post('/v1/storage/buckets/:bucketId/files')
'$id' => $fileId,
'$read' => $read,
'$write' => $write,
'dateCreated' => \time(),
'bucketId' => $bucket->getId(),
'name' => $fileName,
'path' => $path,
@ -613,7 +610,6 @@ App::post('/v1/storage/buckets/:bucketId/files')
'$id' => $fileId,
'$read' => $read,
'$write' => $write,
'dateCreated' => \time(),
'bucketId' => $bucket->getId(),
'name' => $fileName,
'path' => $path,

View file

@ -63,7 +63,6 @@ App::post('/v1/teams')
'$write' => ['team:' . $teamId . '/owner'],
'name' => $name,
'total' => ($isPrivilegedUser || $isAppUser) ? 0 : 1,
'dateCreated' => \time(),
'search' => implode(' ', [$teamId, $name]),
])));

View file

@ -298,11 +298,10 @@ App::init(function (App $utopia, Request $request, Response $response, Document
$service = $route->getLabel('sdk.namespace', '');
if (!empty($service)) {
$roles = Authorization::getRoles();
if (
array_key_exists($service, $project->getAttribute('services', []))
&& !$project->getAttribute('services', [])[$service]
&& !(Auth::isPrivilegedUser($roles) || Auth::isAppUser($roles))
&& !(Auth::isPrivilegedUser(Authorization::getRoles()) || Auth::isAppUser(Authorization::getRoles()))
) {
throw new AppwriteException('Service is disabled', 503, AppwriteException::GENERAL_SERVICE_DISABLED);
}

View file

@ -155,8 +155,6 @@ $http->on('start', function (Server $http) use ($payloadSize, $register) {
$dbForConsole->createDocument('buckets', new Document([
'$id' => 'default',
'$collection' => 'buckets',
'dateCreated' => \time(),
'dateUpdated' => \time(),
'name' => 'Default',
'permission' => 'file',
'maximumFileSize' => (int) App::getEnv('_APP_STORAGE_LIMIT', 0), // 10MB

View file

@ -461,6 +461,11 @@ $register->set('dbPool', function () {
->withPassword($dbPass)
->withOptions([
PDO::ATTR_ERRMODE => App::isDevelopment() ? PDO::ERRMODE_WARNING : PDO::ERRMODE_SILENT, // If in production mode, warnings are not displayed
PDO::ATTR_TIMEOUT => 3, // Seconds
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => true,
PDO::ATTR_STRINGIFY_FETCHES => true,
]),
64
);
@ -553,11 +558,12 @@ $register->set('db', function () {
$dbScheme = App::getEnv('_APP_DB_SCHEMA', '');
$pdo = new PDO("mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
PDO::ATTR_TIMEOUT => 3, // Seconds
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_EMULATE_PREPARES => true,
PDO::ATTR_STRINGIFY_FETCHES => true,
));
return $pdo;

View file

@ -568,8 +568,8 @@ $logs = $this->getParam('logs', null);
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-collection.dateUpdated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-collection.dateCreated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-collection.$updatedAt|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-collection.$createdAt|dateText}}"></span></li>
</ul>
<form

View file

@ -67,7 +67,7 @@
<span class="text-fade text-size-small" data-ls-bind="{{file.sizeOriginal|humanFileUnit}}"></span>
</td>
<td data-title="Created: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.dateCreated|dateText}}"></span>
<span class="text-fade text-size-small" data-ls-bind="{{file.$createdAt|dateText}}"></span>
</td>
<!-- <td class="hide">
<a target="_blank" data-ls-attrs="href="><i class="icon-link-ext"></i></a>

View file

@ -170,7 +170,7 @@ sort($patterns);
<span data-ls-if="{{deployment.status}} == 'failed'" style="color: var(--config-color-danger)" class="pull-start" data-ls-bind="{{deployment.status}}"></span>
<span data-ls-if="{{deployment.status}} == 'ready'" style="color: var(--config-color-success)" class="pull-start" data-ls-bind="{{deployment.status}}"></span>
<span data-ls-if="{{deployment.status}} == 'processing' || {{deployment.status}} == 'building'" style="color: var(--config-color-info)" class="pull-start" data-ls-bind="{{deployment.status}}"></span>
<span class="pull-start" data-ls-bind="&nbsp; | &nbsp; Created {{deployment.dateCreated|timeSince}} &nbsp; | &nbsp; {{deployment.size|humanFileSize}}{{deployment.size|humanFileUnit}}"></span>
<span class="pull-start" data-ls-bind="&nbsp; | &nbsp; Created {{deployment.$createdAt|timeSince}} &nbsp; | &nbsp; {{deployment.size|humanFileSize}}{{deployment.size|humanFileUnit}}"></span>
<span data-ls-if="{{deployment.status}} == 'failed'">&nbsp; | &nbsp;<button type="button" class="link text-size-small" data-ls-ui-trigger="open-stderr-{{deployment.$id}}">Logs</button></span>
<span data-ls-if="{{deployment.status}} == 'ready'">&nbsp; | &nbsp;<button type="button" class="link text-size-small" data-ls-ui-trigger="open-stdout-{{deployment.$id}}">Logs</button></span>
@ -246,8 +246,8 @@ sort($patterns);
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-function.dateUpdated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-function.dateCreated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-function.$updatedAt|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-function.$createdAt|dateText}}"></span></li>
</ul>
<form name="functions.delete" class="margin-bottom"
@ -393,7 +393,7 @@ sort($patterns);
<i class="dot success" data-ls-if="{{execution.status}} === 'completed'"></i>
</td>
<td data-title="Date: ">
<span data-ls-bind="{{execution.dateCreated|dateTime}}"></span>
<span data-ls-bind="{{execution.$createdAt|dateTime}}"></span>
</td>
<td data-title="Status: ">
<span data-ls-bind="{{execution.status}}"></span>
@ -596,8 +596,8 @@ sort($patterns);
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-function.dateUpdated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-function.dateCreated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-function.$updatedAt|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-function.$createdAt|dateText}}"></span></li>
</ul>
<form name="functions.delete" class="margin-bottom"

View file

@ -190,7 +190,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<span data-ls-bind="{{file.sizeOriginal|humanFileUnit}}"></span>
</div>
<div class="margin-bottom">
<i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Created at: <span data-ls-bind="{{file.dateCreated|dateText}}"></span>
<i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Created at: <span data-ls-bind="{{file.$createdAt|dateText}}"></span>
</div>
</div>
</div>
@ -211,7 +211,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<span class="text-fade text-size-small" data-ls-bind="{{file.sizeOriginal|humanFileUnit}}"></span>
</td>
<td data-title="Created: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.dateCreated|dateText}}"></span>
<span class="text-fade text-size-small" data-ls-bind="{{file.$createdAt|dateText}}"></span>
</td>
<td data-title="" class="cell-options-more" style="overflow: visible">
<div class="drop-list end" data-ls-ui-open="" data-button-aria="File Options" data-button-class="icon-dot-3 reset-inner-button" data-blur="1">
@ -472,8 +472,8 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-bucket.dateUpdated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-bucket.dateCreated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-bucket.$updatedAt|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-bucket.$createdAt|dateText}}"></span></li>
</ul>
<form name="storage.deleteBucket" class="margin-bottom"

View file

@ -248,7 +248,7 @@ $smtpEnabled = $this->getParam('smtpEnabled', false);
<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.total}} members"></span></td>
<td data-title="Date Created: "><small data-ls-bind="{{team.dateCreated|dateText}}"></small></td>
<td data-title="Date Created: "><small data-ls-bind="{{team.$createdAt|dateText}}"></small></td>
</tr>
</tbody>
</table>

View file

@ -207,7 +207,7 @@
<ul class="margin-bottom-large text-fade text-size-small">
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{team.dateCreated|dateText}}"></span></li>
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{team.$createdAt|dateText}}"></span></li>
</ul>
<form name="teams.delete" class="margin-bottom"

View file

@ -249,7 +249,7 @@ class DeletesV1 extends Worker
$dbForProject = $this->getProjectDB($projectId);
// Delete Executions
$this->deleteByGroup('executions', [
new Query('dateCreated', Query::TYPE_LESSER, [$timestamp])
new Query('$createdAt', Query::TYPE_LESSER, [$timestamp])
], $dbForProject);
});
}

View file

@ -227,7 +227,10 @@ class FunctionsV1 extends Worker
$runtime = $runtimes[$function->getAttribute('runtime')];
/** Create execution or update execution status */
/**
* Create execution or update execution status
* @var Document $execution
*/
$execution = Authorization::skip(function () use ($dbForProject, &$executionId, $functionId, $deploymentId, $trigger, $user) {
$execution = $dbForProject->getDocument('executions', $executionId ?? '');
if ($execution->isEmpty()) {
@ -236,7 +239,6 @@ class FunctionsV1 extends Worker
'$id' => $executionId,
'$read' => $user->isEmpty() ? [] : ['user:' . $user->getId()],
'$write' => [],
'dateCreated' => time(),
'functionId' => $functionId,
'deploymentId' => $deploymentId,
'trigger' => $trigger,
@ -298,7 +300,7 @@ class FunctionsV1 extends Worker
->setAttribute('time', $executionResponse['time']);
} catch (\Throwable $th) {
$endtime = \microtime(true);
$time = $endtime - $execution->getAttribute('dateCreated');
$time = $endtime - $execution->getCreatedAt();
$execution
->setAttribute('time', $time)
->setAttribute('status', 'failed')

View file

@ -45,7 +45,7 @@
"utopia-php/cache": "0.6.*",
"utopia-php/cli": "0.12.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.17.*",
"utopia-php/database": "dev-bug-last-internal-id as 0.18.0",
"utopia-php/locale": "0.4.*",
"utopia-php/registry": "0.5.*",
"utopia-php/preloader": "0.2.*",

28
composer.lock generated
View file

@ -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": "9450d0e08c0f21141af8d99232d37df9",
"content-hash": "90fda9828f3d88a82b199b3c16f015dd",
"packages": [
{
"name": "adhocore/jwt",
@ -2107,16 +2107,16 @@
},
{
"name": "utopia-php/database",
"version": "0.17.1",
"version": "dev-bug-last-internal-id",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "a4d001452b78b85335ffbd34176cd45d2b13c1ca"
"reference": "fbc6e6e3ea57856564755f3826f1bff0e43c5f1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/a4d001452b78b85335ffbd34176cd45d2b13c1ca",
"reference": "a4d001452b78b85335ffbd34176cd45d2b13c1ca",
"url": "https://api.github.com/repos/utopia-php/database/zipball/fbc6e6e3ea57856564755f3826f1bff0e43c5f1a",
"reference": "fbc6e6e3ea57856564755f3826f1bff0e43c5f1a",
"shasum": ""
},
"require": {
@ -2131,6 +2131,7 @@
"require-dev": {
"fakerphp/faker": "^1.14",
"phpunit/phpunit": "^9.4",
"swoole/ide-helper": "4.8.0",
"utopia-php/cli": "^0.11.0",
"vimeo/psalm": "4.0.1"
},
@ -2164,9 +2165,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.17.1"
"source": "https://github.com/utopia-php/database/tree/bug-last-internal-id"
},
"time": "2022-05-16T09:11:44+00:00"
"time": "2022-06-15T07:42:27+00:00"
},
{
"name": "utopia-php/domains",
@ -5345,9 +5346,18 @@
"time": "2022-05-17T05:48:52+00:00"
}
],
"aliases": [],
"aliases": [
{
"package": "utopia-php/database",
"version": "dev-bug-last-internal-id",
"alias": "0.18.0",
"alias_normalized": "0.18.0.0"
}
],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"utopia-php/database": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {

View file

@ -16,6 +16,18 @@ class Bucket extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Bucket creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Bucket update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'File read permissions.',
@ -36,18 +48,6 @@ class Bucket extends Model
'default' => '',
'example' => 'file',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'Bucket creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('dateUpdated', [
'type' => self::TYPE_INTEGER,
'description' => 'Bucket update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Bucket name.',

View file

@ -16,6 +16,18 @@ class Collection extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Collection creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Collection update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'Collection read permissions.',

View file

@ -16,6 +16,18 @@ class Deployment extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Deployment creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Deployment update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('resourceId', [
'type' => self::TYPE_STRING,
'description' => 'Resource ID.',
@ -28,12 +40,6 @@ class Deployment extends Model
'default' => '',
'example' => 'functions',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'The deployment creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('entrypoint', [
'type' => self::TYPE_STRING,
'description' => 'The entrypoint file to use to execute the deployment code.',

View file

@ -42,6 +42,18 @@ class Document extends Any
'default' => '',
'example' => '5e5ea5c15117e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Document creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Document update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'Document read permissions.',

View file

@ -21,6 +21,18 @@ class Domain extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Domain creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Domain update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('domain', [
'type' => self::TYPE_STRING,
'description' => 'Domain name.',

View file

@ -16,6 +16,18 @@ class Execution extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Execution creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Execution update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'Execution read permissions.',
@ -29,12 +41,6 @@ class Execution extends Model
'default' => '',
'example' => '5e5ea6g16897e',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'The execution creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('trigger', [
'type' => self::TYPE_STRING,
'description' => 'The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.',

View file

@ -22,6 +22,18 @@ class File extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'File creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'File update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$read', [
'type' => self::TYPE_STRING,
'description' => 'File read permissions.',
@ -42,12 +54,6 @@ class File extends Model
'default' => '',
'example' => 'Pink.png',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'File creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('signature', [
'type' => self::TYPE_STRING,
'description' => 'File MD5 signature.',

View file

@ -18,6 +18,18 @@ class Func extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Function creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Function update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('execute', [
'type' => self::TYPE_STRING,
'description' => 'Execution permissions.',
@ -31,18 +43,6 @@ class Func extends Model
'default' => '',
'example' => 'My Function',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'Function creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('dateUpdated', [
'type' => self::TYPE_INTEGER,
'description' => 'Function update date in Unix timestamp.',
'default' => 0,
'example' => 1592981257,
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'Function status. Possible values: `disabled`, `enabled`',

View file

@ -21,6 +21,18 @@ class Key extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Key creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Key update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Key name.',

View file

@ -16,6 +16,18 @@ class Membership extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Membership creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Membership update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('userId', [
'type' => self::TYPE_STRING,
'description' => 'User ID.',

View file

@ -21,6 +21,18 @@ class Platform extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Project creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Project update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Platform name.',

View file

@ -23,6 +23,18 @@ class Project extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Project creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Project update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Project name.',

View file

@ -16,6 +16,12 @@ class Session extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Session creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('userId', [
'type' => self::TYPE_STRING,
'description' => 'User ID.',

View file

@ -16,18 +16,24 @@ class Team extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Team creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Team update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Team name.',
'default' => '',
'example' => 'VIP',
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'Team creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('total', [
'type' => self::TYPE_INTEGER,
'description' => 'Total number of team members.',

View file

@ -16,6 +16,12 @@ class Token extends Model
'default' => '',
'example' => 'bb8ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Token creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('userId', [
'type' => self::TYPE_STRING,
'description' => 'User ID.',

View file

@ -17,6 +17,18 @@ class User extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'User creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'User update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'User name.',

View file

@ -21,6 +21,18 @@ class Webhook extends Model
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('$createdAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Webhook creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('$updatedAt', [
'type' => self::TYPE_INTEGER,
'description' => 'Webhook update date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Webhook name.',

View file

@ -790,9 +790,9 @@ class DatabaseCustomServerTest extends Scope
}
// testing for indexLimit = 64
// MariaDB, MySQL, and MongoDB create 3 indexes per new collection
// MariaDB, MySQL, and MongoDB create 5 indexes per new collection
// Add up to the limit, then check if the next index throws IndexLimitException
for ($i = 0; $i < 61; $i++) {
for ($i = 0; $i < 59; $i++) {
// $this->assertEquals(true, static::getDatabase()->createIndex('indexLimit', "index{$i}", Database::INDEX_KEY, ["test{$i}"], [16]));
$index = $this->client->call(Client::METHOD_POST, '/database/collections/' . $collectionId . '/indexes', array_merge([
'content-type' => 'application/json',
@ -821,7 +821,7 @@ class DatabaseCustomServerTest extends Scope
$this->assertIsArray($collection['body']['attributes']);
$this->assertIsArray($collection['body']['indexes']);
$this->assertCount(64, $collection['body']['attributes']);
$this->assertCount(61, $collection['body']['indexes']);
$this->assertCount(59, $collection['body']['indexes']);
$tooMany = $this->client->call(Client::METHOD_POST, '/database/collections/' . $collectionId . '/indexes', array_merge([
'content-type' => 'application/json',

View file

@ -47,8 +47,8 @@ class FunctionsCustomServerTest extends Scope
$this->assertNotEmpty($response1['body']['$id']);
$this->assertEquals('Test', $response1['body']['name']);
$this->assertEquals('php-8.0', $response1['body']['runtime']);
$this->assertIsInt($response1['body']['dateCreated']);
$this->assertIsInt($response1['body']['dateUpdated']);
$this->assertIsInt($response1['body']['$createdAt']);
$this->assertIsInt($response1['body']['$updatedAt']);
$this->assertEquals('', $response1['body']['deployment']);
$this->assertEquals([
'funcKey1' => 'funcValue1',
@ -248,8 +248,8 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(200, $response1['headers']['status-code']);
$this->assertNotEmpty($response1['body']['$id']);
$this->assertEquals('Test1', $response1['body']['name']);
$this->assertIsInt($response1['body']['dateCreated']);
$this->assertIsInt($response1['body']['dateUpdated']);
$this->assertIsInt($response1['body']['$createdAt']);
$this->assertIsInt($response1['body']['$updatedAt']);
$this->assertEquals('', $response1['body']['deployment']);
$this->assertEquals([
'key4' => 'value4',
@ -294,7 +294,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(201, $deployment['headers']['status-code']);
$this->assertNotEmpty($deployment['body']['$id']);
$this->assertIsInt($deployment['body']['dateCreated']);
$this->assertIsInt($deployment['body']['$createdAt']);
$this->assertEquals('index.php', $deployment['body']['entrypoint']);
// Wait for deployment to build.
@ -343,7 +343,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(201, $largeTag['headers']['status-code']);
$this->assertNotEmpty($largeTag['body']['$id']);
$this->assertIsInt($largeTag['body']['dateCreated']);
$this->assertIsInt($largeTag['body']['$createdAt']);
$this->assertEquals('index.php', $largeTag['body']['entrypoint']);
$this->assertGreaterThan(10000, $largeTag['body']['size']);
@ -365,8 +365,8 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['dateUpdated']);
$this->assertIsInt($response['body']['$createdAt']);
$this->assertIsInt($response['body']['$updatedAt']);
$this->assertEquals($data['deploymentId'], $response['body']['deployment']);
/**
@ -487,7 +487,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertNotEmpty($execution['body']['$id']);
$this->assertNotEmpty($execution['body']['functionId']);
$this->assertIsInt($execution['body']['dateCreated']);
$this->assertIsInt($execution['body']['$createdAt']);
$this->assertEquals($data['functionId'], $execution['body']['functionId']);
$this->assertEquals('waiting', $execution['body']['status']);
$this->assertEquals(0, $execution['body']['statusCode']);
@ -504,7 +504,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertNotEmpty($execution['body']['$id']);
$this->assertNotEmpty($execution['body']['functionId']);
$this->assertIsInt($execution['body']['dateCreated']);
$this->assertIsInt($execution['body']['$createdAt']);
$this->assertEquals($data['functionId'], $execution['body']['functionId']);
$this->assertEquals('completed', $execution['body']['status']);
$this->assertEquals(200, $execution['body']['statusCode']);

View file

@ -41,7 +41,7 @@ trait StorageBase
]);
$this->assertEquals(201, $file['headers']['status-code']);
$this->assertNotEmpty($file['body']['$id']);
$this->assertIsInt($file['body']['dateCreated']);
$this->assertIsInt($file['body']['$createdAt']);
$this->assertEquals('logo.png', $file['body']['name']);
$this->assertEquals('image/png', $file['body']['mimeType']);
$this->assertEquals(47218, $file['body']['sizeOriginal']);
@ -102,7 +102,7 @@ trait StorageBase
$this->assertEquals(201, $largeFile['headers']['status-code']);
$this->assertNotEmpty($largeFile['body']['$id']);
$this->assertIsInt($largeFile['body']['dateCreated']);
$this->assertIsInt($largeFile['body']['$createdAt']);
$this->assertEquals('large-file.mp4', $largeFile['body']['name']);
$this->assertEquals('video/mp4', $largeFile['body']['mimeType']);
$this->assertEquals($totalSize, $largeFile['body']['sizeOriginal']);
@ -253,7 +253,7 @@ trait StorageBase
$this->assertEquals(200, $file1['headers']['status-code']);
$this->assertNotEmpty($file1['body']['$id']);
$this->assertIsInt($file1['body']['dateCreated']);
$this->assertIsInt($file1['body']['$createdAt']);
$this->assertEquals('logo.png', $file1['body']['name']);
$this->assertEquals('image/png', $file1['body']['mimeType']);
$this->assertEquals(47218, $file1['body']['sizeOriginal']);
@ -547,7 +547,7 @@ trait StorageBase
$this->assertEquals(200, $file['headers']['status-code']);
$this->assertNotEmpty($file['body']['$id']);
$this->assertIsInt($file['body']['dateCreated']);
$this->assertIsInt($file['body']['$createdAt']);
$this->assertEquals('logo.png', $file['body']['name']);
$this->assertEquals('image/png', $file['body']['mimeType']);
$this->assertEquals(47218, $file['body']['sizeOriginal']);

View file

@ -49,7 +49,7 @@ class StorageCustomClientTest extends Scope
$fileId = $file['body']['$id'];
$this->assertEquals($file['headers']['status-code'], 201);
$this->assertNotEmpty($fileId);
$this->assertIsInt($file['body']['dateCreated']);
$this->assertIsInt($file['body']['$createdAt']);
$this->assertEquals('permissions.png', $file['body']['name']);
$this->assertEquals('image/png', $file['body']['mimeType']);
$this->assertEquals(47218, $file['body']['sizeOriginal']);
@ -138,7 +138,7 @@ class StorageCustomClientTest extends Scope
$this->assertNotEmpty($file['body']['$id']);
$this->assertContains('user:' . $this->getUser()['$id'], $file['body']['$read']);
$this->assertContains('user:' . $this->getUser()['$id'], $file['body']['$write']);
$this->assertIsInt($file['body']['dateCreated']);
$this->assertIsInt($file['body']['$createdAt']);
$this->assertEquals('permissions.png', $file['body']['name']);
$this->assertEquals('image/png', $file['body']['mimeType']);
$this->assertEquals(47218, $file['body']['sizeOriginal']);

View file

@ -28,7 +28,7 @@ class StorageCustomServerTest extends Scope
]);
$this->assertEquals(201, $bucket['headers']['status-code']);
$this->assertNotEmpty($bucket['body']['$id']);
$this->assertIsInt($bucket['body']['dateCreated']);
$this->assertIsInt($bucket['body']['$createdAt']);
$this->assertIsArray($bucket['body']['$read']);
$this->assertIsArray($bucket['body']['$write']);
$this->assertIsArray($bucket['body']['allowedFileExtensions']);
@ -187,7 +187,7 @@ class StorageCustomServerTest extends Scope
]);
$this->assertEquals(200, $bucket['headers']['status-code']);
$this->assertNotEmpty($bucket['body']['$id']);
$this->assertIsInt($bucket['body']['dateCreated']);
$this->assertIsInt($bucket['body']['$createdAt']);
$this->assertIsArray($bucket['body']['$read']);
$this->assertIsArray($bucket['body']['$write']);
$this->assertIsArray($bucket['body']['allowedFileExtensions']);

View file

@ -25,7 +25,7 @@ trait TeamsBase
$this->assertEquals('Arsenal', $response1['body']['name']);
$this->assertGreaterThan(-1, $response1['body']['total']);
$this->assertIsInt($response1['body']['total']);
$this->assertIsInt($response1['body']['dateCreated']);
$this->assertIsInt($response1['body']['$createdAt']);
$teamUid = $response1['body']['$id'];
$teamName = $response1['body']['name'];
@ -45,7 +45,7 @@ trait TeamsBase
$this->assertEquals('Manchester United', $response2['body']['name']);
$this->assertGreaterThan(-1, $response2['body']['total']);
$this->assertIsInt($response2['body']['total']);
$this->assertIsInt($response2['body']['dateCreated']);
$this->assertIsInt($response2['body']['$createdAt']);
$response3 = $this->client->call(Client::METHOD_POST, '/teams', array_merge([
'content-type' => 'application/json',
@ -60,7 +60,7 @@ trait TeamsBase
$this->assertEquals('Newcastle', $response3['body']['name']);
$this->assertGreaterThan(-1, $response3['body']['total']);
$this->assertIsInt($response3['body']['total']);
$this->assertIsInt($response3['body']['dateCreated']);
$this->assertIsInt($response3['body']['$createdAt']);
/**
* Test for FAILURE
@ -96,7 +96,7 @@ trait TeamsBase
$this->assertEquals('Arsenal', $response['body']['name']);
$this->assertGreaterThan(-1, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
/**
* Test for FAILURE
@ -260,7 +260,7 @@ trait TeamsBase
$this->assertEquals('Demo', $response['body']['name']);
$this->assertGreaterThan(-1, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
$response = $this->client->call(Client::METHOD_PUT, '/teams/' . $response['body']['$id'], array_merge([
'content-type' => 'application/json',
@ -275,7 +275,7 @@ trait TeamsBase
$this->assertEquals('Demo New', $response['body']['name']);
$this->assertGreaterThan(-1, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
/**
* Test for FAILURE
@ -311,7 +311,7 @@ trait TeamsBase
$this->assertEquals('Demo', $response['body']['name']);
$this->assertGreaterThan(-1, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
$response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid, array_merge([
'content-type' => 'application/json',

View file

@ -204,7 +204,7 @@ trait TeamsBaseServer
$this->assertEquals('Arsenal', $response['body']['name']);
$this->assertEquals(1, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
/** Delete User */
@ -230,6 +230,6 @@ trait TeamsBaseServer
$this->assertEquals('Arsenal', $response['body']['name']);
$this->assertEquals(0, $response['body']['total']);
$this->assertIsInt($response['body']['total']);
$this->assertIsInt($response['body']['dateCreated']);
$this->assertIsInt($response['body']['$createdAt']);
}
}

View file

@ -505,7 +505,7 @@ trait WebhooksBase
$this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$write']);
$this->assertEquals($webhook['data']['name'], 'logo.png');
$this->assertIsInt($webhook['data']['dateCreated'], 'logo.png');
$this->assertIsInt($webhook['data']['$createdAt']);
$this->assertNotEmpty($webhook['data']['signature']);
$this->assertEquals($webhook['data']['mimeType'], 'image/png');
$this->assertEquals($webhook['data']['sizeOriginal'], 47218);
@ -561,7 +561,7 @@ trait WebhooksBase
$this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$write']);
$this->assertEquals($webhook['data']['name'], 'logo.png');
$this->assertIsInt($webhook['data']['dateCreated'], 'logo.png');
$this->assertIsInt($webhook['data']['$createdAt']);
$this->assertNotEmpty($webhook['data']['signature']);
$this->assertEquals($webhook['data']['mimeType'], 'image/png');
$this->assertEquals($webhook['data']['sizeOriginal'], 47218);
@ -612,7 +612,7 @@ trait WebhooksBase
$this->assertIsArray($webhook['data']['$read']);
$this->assertIsArray($webhook['data']['$write']);
$this->assertEquals($webhook['data']['name'], 'logo.png');
$this->assertIsInt($webhook['data']['dateCreated'], 'logo.png');
$this->assertIsInt($webhook['data']['$createdAt']);
$this->assertNotEmpty($webhook['data']['signature']);
$this->assertEquals($webhook['data']['mimeType'], 'image/png');
$this->assertEquals($webhook['data']['sizeOriginal'], 47218);
@ -695,7 +695,7 @@ trait WebhooksBase
$this->assertEquals('Arsenal', $webhook['data']['name']);
$this->assertGreaterThan(-1, $webhook['data']['total']);
$this->assertIsInt($webhook['data']['total']);
$this->assertIsInt($webhook['data']['dateCreated']);
$this->assertIsInt($webhook['data']['$createdAt']);
/**
* Test for FAILURE
@ -740,7 +740,7 @@ trait WebhooksBase
$this->assertEquals('Demo New', $webhook['data']['name']);
$this->assertGreaterThan(-1, $webhook['data']['total']);
$this->assertIsInt($webhook['data']['total']);
$this->assertIsInt($webhook['data']['dateCreated']);
$this->assertIsInt($webhook['data']['$createdAt']);
/**
* Test for FAILURE
@ -789,7 +789,7 @@ trait WebhooksBase
$this->assertEquals('Chelsea', $webhook['data']['name']);
$this->assertGreaterThan(-1, $webhook['data']['total']);
$this->assertIsInt($webhook['data']['total']);
$this->assertIsInt($webhook['data']['dateCreated']);
$this->assertIsInt($webhook['data']['$createdAt']);
/**
* Test for FAILURE