Removed the tasks service

This commit is contained in:
Eldad Fux committed 2021-07-27 17:16:12 +03:00
1 parent 5dfa6217d8
commit 95dacecf3a
32 files changed
+21 -1693

No files matched your search

+1 -1
View File
@@ -304,7 +304,7 @@ class MySQL extends Adapter
$st2->execute();
}
//TODO remove this dependency (check if related to nested documents)
// TODO remove this dependency (check if related to nested documents)
$this->getRedis()->expire($this->getNamespace().':document-'.$data['$id'], 0);
$this->getRedis()->expire($this->getNamespace().':document-'.$data['$id'], 0);
+1 -2
View File
@@ -18,9 +18,8 @@ class Database
const SYSTEM_COLLECTION_PROJECTS = 'projects';
const SYSTEM_COLLECTION_WEBHOOKS = 'webhooks';
const SYSTEM_COLLECTION_KEYS = 'keys';
const SYSTEM_COLLECTION_TASKS = 'tasks';
const SYSTEM_COLLECTION_PLATFORMS = 'platforms';
const SYSTEM_COLLECTION_USAGES = 'usages'; //TODO add structure
const SYSTEM_COLLECTION_USAGES = 'usages'; // TODO add structure
const SYSTEM_COLLECTION_DOMAINS = 'domains';
const SYSTEM_COLLECTION_CERTIFICATES = 'certificates';
const SYSTEM_COLLECTION_RESERVED = 'reserved';
-1
View File
@@ -28,7 +28,6 @@ class Event
const WEBHOOK_QUEUE_NAME = 'v1-webhooks';
const WEBHOOK_CLASS_NAME = 'WebhooksV1';
const TASK_QUEUE_NAME = 'v1-tasks';
const TASK_CLASS_NAME = 'TasksV1';
const CERTIFICATES_QUEUE_NAME = 'v1-certificates';
+3 -3
View File
@@ -68,9 +68,9 @@ class V05 extends Migration
$document->setAttribute('security', $document->getAttribute('security') ? true : false);
break;
case Database::SYSTEM_COLLECTION_TASKS:
$document->setAttribute('security', $document->getAttribute('security') ? true : false);
break;
// case Database::SYSTEM_COLLECTION_TASKS:
// $document->setAttribute('security', $document->getAttribute('security') ? true : false);
// break;
case Database::SYSTEM_COLLECTION_USERS:
foreach ($providers as $key => $provider) {
-4
View File
@@ -120,8 +120,6 @@ class Response extends SwooleResponse
const MODEL_WEBHOOK_LIST = 'webhookList';
const MODEL_KEY = 'key';
const MODEL_KEY_LIST = 'keyList';
const MODEL_TASK = 'task';
const MODEL_TASK_LIST = 'taskList';
const MODEL_PLATFORM = 'platform';
const MODEL_PLATFORM_LIST = 'platformList';
const MODEL_DOMAIN = 'domain';
@@ -170,7 +168,6 @@ class Response extends SwooleResponse
->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false))
->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false))
->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false))
->setModel(new BaseList('Tasks List', self::MODEL_TASK_LIST, 'tasks', self::MODEL_TASK, true, false))
->setModel(new BaseList('Platforms List', self::MODEL_PLATFORM_LIST, 'platforms', self::MODEL_PLATFORM, true, false))
->setModel(new BaseList('Domains List', self::MODEL_DOMAIN_LIST, 'domains', self::MODEL_DOMAIN, true, false))
->setModel(new BaseList('Countries List', self::MODEL_COUNTRY_LIST, 'countries', self::MODEL_COUNTRY))
@@ -201,7 +198,6 @@ class Response extends SwooleResponse
->setModel(new Project())
->setModel(new Webhook())
->setModel(new Key())
->setModel(new Task())
->setModel(new Domain())
->setModel(new Platform())
->setModel(new Country())
@@ -123,13 +123,6 @@ class Project extends Model
'example' => new stdClass,
'array' => true,
])
->addRule('tasks', [
'type' => Response::MODEL_TASK,
'description' => 'List of Tasks.',
'default' => [],
'example' => new stdClass,
'array' => true,
])
;
$providers = Config::getParam('providers', []);
-143
View File
@@ -1,143 +0,0 @@
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Task extends Model
{
/**
* @var bool
*/
protected $public = false;
public function __construct()
{
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Task ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('projectId', [
'type' => self::TYPE_STRING,
'description' => 'Project ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Task name.',
'default' => '',
'example' => 'My Task',
])
->addRule('security', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Indicated if SSL / TLS Certificate verification is enabled.',
'default' => true,
'example' => true,
])
->addRule('httpMethod', [
'type' => self::TYPE_STRING,
'description' => 'Task HTTP Method.',
'default' => '',
'example' => 'POST',
])
->addRule('httpUrl', [
'type' => self::TYPE_STRING,
'description' => 'Task HTTP URL.',
'default' => '',
'example' => 'https://example.com/task',
])
->addRule('httpHeaders', [
'type' => self::TYPE_STRING,
'description' => 'Task HTTP headers.',
'default' => [],
'example' => 'key:value',
'array' => true,
])
->addRule('httpUser', [
'type' => self::TYPE_STRING,
'description' => 'HTTP basic authentication username.',
'default' => '',
'example' => 'username',
])
->addRule('httpPass', [
'type' => self::TYPE_STRING,
'description' => 'HTTP basic authentication password.',
'default' => '',
'example' => 'password',
])
->addRule('duration', [
'type' => self::TYPE_FLOAT,
'description' => 'Task duration in seconds.',
'default' => 0,
'example' => 1.2,
])
->addRule('delay', [
'type' => self::TYPE_FLOAT,
'description' => 'Task delay time in seconds.',
'default' => 0,
'example' => 1.2,
])
->addRule('failures', [
'type' => self::TYPE_INTEGER,
'description' => 'Number of recurring task failures.',
'default' => 0,
'example' => 0,
])
->addRule('schedule', [
'type' => self::TYPE_STRING,
'description' => 'Task schedule in CRON syntax.',
'default' => '',
'example' => '* * * * *',
])
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'Task status. Possible values: play, pause',
'default' => '',
'example' => 'enabled',
])
->addRule('updated', [
'type' => self::TYPE_INTEGER,
'description' => 'Task last updated time in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('previous', [
'type' => self::TYPE_INTEGER,
'description' => 'Task previous run time in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
->addRule('next', [
'type' => self::TYPE_INTEGER,
'description' => 'Task next run time in Unix timestamp.',
'default' => 0,
'example' => 1592981650,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Task';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_TASK;
}
}