Merge branch '0.15.x' of https://github.com/appwrite/appwrite into origin/feat-internal-id
This commit is contained in:
commit
511898afc9
|
@ -93,7 +93,7 @@ git clone git@github.com:[YOUR_FORK_HERE]/appwrite.git
|
|||
|
||||
cd appwrite
|
||||
|
||||
docker-compose up -d
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Code Autocompletion
|
||||
|
@ -108,7 +108,7 @@ docker run --rm --interactive --tty \
|
|||
|
||||
### User Interface
|
||||
|
||||
Appwrite uses an internal micro-framework called Litespeed.js to build simple UI components in vanilla JS and [less](http://lesscss.org/) for compiling CSS code. To apply any of your changes to the UI, use the `gulp build` or `gulp less` commands, and restart the Appwrite main container to load the new static files to memory using `docker-compose restart appwrite`.
|
||||
Appwrite uses an internal micro-framework called Litespeed.js to build simple UI components in vanilla JS and [less](http://lesscss.org/) for compiling CSS code. To apply any of your changes to the UI, use the `gulp build` or `gulp less` commands, and restart the Appwrite main container to load the new static files to memory using `docker compose restart appwrite`.
|
||||
|
||||
### Get Started
|
||||
|
||||
|
@ -222,7 +222,7 @@ Currently, all of the Appwrite microservices are intended to communicate using t
|
|||
|
||||
## Ports
|
||||
|
||||
Appwrite dev version uses ports 80 and 443 as an entry point to the Appwrite API and console. We also expose multiple ports in the range of 9500-9504 for debugging some of the Appwrite containers on dev mode. If you have any conflicts with the ports running on your system, you can easily replace them by editing Appwrite's docker-compose.yml file and executing `docker-compose up -d` command.
|
||||
Appwrite dev version uses ports 80 and 443 as an entry point to the Appwrite API and console. We also expose multiple ports in the range of 9500-9504 for debugging some of the Appwrite containers on dev mode. If you have any conflicts with the ports running on your system, you can easily replace them by editing Appwrite's docker-compose.yml file and executing `docker compose up -d` command.
|
||||
|
||||
## Technology Stack
|
||||
|
||||
|
@ -363,25 +363,25 @@ In settings, go to **Languages & Frameworks** > **PHP** > **Debug**, there under
|
|||
To run all tests manually, use the Appwrite Docker CLI from your terminal:
|
||||
|
||||
```bash
|
||||
docker-compose exec appwrite test
|
||||
docker compose exec appwrite test
|
||||
```
|
||||
|
||||
To run unit tests use:
|
||||
|
||||
```bash
|
||||
docker-compose exec appwrite test /usr/src/code/tests/unit
|
||||
docker compose exec appwrite test /usr/src/code/tests/unit
|
||||
```
|
||||
|
||||
To run end-2-end tests use:
|
||||
|
||||
```bash
|
||||
docker-compose exec appwrite test /usr/src/code/tests/e2e
|
||||
docker compose exec appwrite test /usr/src/code/tests/e2e
|
||||
```
|
||||
|
||||
To run end-2-end tests for a spcific service use:
|
||||
|
||||
```bash
|
||||
docker-compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
|
||||
docker compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName]
|
||||
```
|
||||
|
||||
## Benchmarking
|
||||
|
@ -462,4 +462,4 @@ Submitting documentation updates, enhancements, designs, or bug fixes. Spelling
|
|||
|
||||
### Helping Someone
|
||||
|
||||
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
|
||||
Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo!
|
|
@ -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,
|
||||
|
@ -703,29 +681,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' => [
|
||||
[
|
||||
|
@ -1607,17 +1563,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,
|
||||
|
@ -1827,28 +1772,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',
|
||||
|
@ -1976,17 +1899,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,
|
||||
|
@ -2277,17 +2189,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,
|
||||
|
@ -2497,26 +2398,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,
|
||||
|
@ -2757,17 +2638,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',
|
||||
|
|
|
@ -1537,8 +1537,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);
|
||||
|
||||
|
|
|
@ -168,8 +168,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]),
|
||||
|
@ -599,7 +597,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) {
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -1004,9 +1004,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);
|
||||
|
@ -1118,7 +1116,6 @@ App::put('/v1/projects/:projectId/platforms/:platformId')
|
|||
|
||||
$platform
|
||||
->setAttribute('name', $name)
|
||||
->setAttribute('dateUpdated', \time())
|
||||
->setAttribute('key', $key)
|
||||
->setAttribute('store', $store)
|
||||
->setAttribute('hostname', $hostname)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]),
|
||||
])));
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -460,10 +460,12 @@ $register->set('dbPool', function () {
|
|||
->withUsername($dbUser)
|
||||
->withPassword($dbPass)
|
||||
->withOptions([
|
||||
PDO::ATTR_ERRMODE => App::isDevelopment() ? PDO::ERRMODE_WARNING : PDO::ERRMODE_SILENT,// If in production mode, warnings are not displayed
|
||||
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 // In order to be consistent between mariadb and mysql
|
||||
PDO::ATTR_STRINGIFY_FETCHES => true,
|
||||
]),
|
||||
64
|
||||
);
|
||||
|
|
|
@ -33,7 +33,7 @@ $cli
|
|||
* 3. Ask user to backup important volumes, env vars, and SQL tables
|
||||
* In th future we can try and automate this for smaller/medium size setups
|
||||
* 4. Drop new docker-compose.yml setup (located inside the container, no network dependencies with appwrite.io) - DONE
|
||||
* 5. Run docker-compose up -d - DONE
|
||||
* 5. Run docker compose up -d - DONE
|
||||
* 6. Run data migration
|
||||
*/
|
||||
$config = Config::getParam('variables');
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -347,6 +347,8 @@ $logs = $this->getParam('logs', null);
|
|||
|
||||
<ul class="margin-bottom-large text-fade text-size-small" data-ls-if="({{project-document.$id}})">
|
||||
<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-document.$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-document.$createdAt|dateText}}"></span></li>
|
||||
</ul>
|
||||
|
||||
<div data-ls-if="({{project-document.$id}})">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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=" | Created {{deployment.dateCreated|timeSince}} | {{deployment.size|humanFileSize}}{{deployment.size|humanFileUnit}}"></span>
|
||||
<span class="pull-start" data-ls-bind=" | Created {{deployment.$createdAt|timeSince}} | {{deployment.size|humanFileSize}}{{deployment.size|humanFileUnit}}"></span>
|
||||
|
||||
<span data-ls-if="{{deployment.status}} == 'failed'"> | <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'"> | <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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -246,7 +246,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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -239,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 +297,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')
|
||||
|
|
|
@ -217,7 +217,7 @@ Please mention in your documentation what resources or API docs you used to impl
|
|||
|
||||
After you finished adding your new provider to Appwrite, you should be able to see it in your Appwrite console. Navigate to 'Project > Users > Providers' and check your new provider's settings form.
|
||||
|
||||
> To start Appwrite console from the source code, you can simply run `docker-compose up -d'.
|
||||
> To start Appwrite console from the source code, you can simply run `docker compose up -d'.
|
||||
|
||||
Add credentials and check both a successful and a failed login (where the user denies integration on the provider page).
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ Make sure to replace all instances of `LANGUAGE_NAME` with your language's name
|
|||
Once you have done this and saved it, it is finally time to move onto one of the final steps.
|
||||
|
||||
### 5.4 Running the tests.
|
||||
Running the tests is easy, simply run `docker-compose up` in the root of the `runtimes` folder. This will launch a Docker container with the test script and start running through all the runtimes making sure to test them thoroughly.
|
||||
Running the tests is easy, simply run `docker compose up` in the root of the `runtimes` folder. This will launch a Docker container with the test script and start running through all the runtimes making sure to test them thoroughly.
|
||||
|
||||
If all tests pass then congratulations! You can now go ahead and file a PR against the `runtimes` repo making sure to target the `refactor` branch, make sure you're ready to respond to any feedback which can arise during our code review.
|
||||
|
||||
|
|
|
@ -46,6 +46,6 @@ If required for the new adapter, may be for credentials, introduce new environme
|
|||
In `app/controllers/shared/api.php` inside init function, there is a `switch/case` statements for each supported storage device. Implement the instantiation of your device type for your device case. The device cases are the devices constants listed in the `uptopa-php/storage/Storage` class.
|
||||
|
||||
### Test and verify everything works
|
||||
To test you can switch to your newly added device using `_APP_STORAGE_DEVICE` environment variable. Then run `docker-compose build && docker-compose up -d` in order to build the containers with updated changes. Once the containers are running, login to Appwrite console and create a project. Then in storage section, try to upload, preview, delete files.
|
||||
To test you can switch to your newly added device using `_APP_STORAGE_DEVICE` environment variable. Then run `docker compose build && docker compose up -d` in order to build the containers with updated changes. Once the containers are running, login to Appwrite console and create a project. Then in storage section, try to upload, preview, delete files.
|
||||
|
||||
If everything goes well, initiate a pull request to appwrite repository.
|
||||
|
|
|
@ -148,7 +148,7 @@ To test if the translation is properly loaded, we will send a GET request to get
|
|||
First of all, we need to start a local instance of Appwrite. Thanks to Docker, this can be done using one command.
|
||||
|
||||
```shell
|
||||
$ docker-compose up -d
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
If this is your first time running Appwrite, it may take up to few minutes to download all images and start all containers. Once everything is started, you should see Appwrite running on `http://localhost:80`. When you visit this URL, it will ask you to sign up. After that, it will show you your empty dashboard where you need to create a new project - give it any name you want. Then you need to go to `Settings` of the project and copy `Project-ID`.
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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`.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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`',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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.',
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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']);
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -497,7 +497,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);
|
||||
|
@ -553,7 +553,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);
|
||||
|
@ -604,7 +604,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);
|
||||
|
@ -687,7 +687,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
|
||||
|
@ -732,7 +732,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
|
||||
|
@ -781,7 +781,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
|
||||
|
|
Loading…
Reference in a new issue