Merge branch 'feat-functions-refactor' of github.com:appwrite/appwrite into feat-add-builds-worker

This commit is contained in:
Christy Jacob
2022-01-26 16:59:24 +04:00
46 changed files with 694 additions and 686 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class Database
// Functions
const SYSTEM_COLLECTION_FUNCTIONS = 'functions';
const SYSTEM_COLLECTION_TAGS = 'tags';
const SYSTEM_COLLECTION_DEPLOYMENTS = 'deployments';
const SYSTEM_COLLECTION_EXECUTIONS = 'executions';
// Realtime
+5 -5
View File
@@ -51,7 +51,7 @@ use Appwrite\Utopia\Response\Model\Phone;
use Appwrite\Utopia\Response\Model\Platform;
use Appwrite\Utopia\Response\Model\Project;
use Appwrite\Utopia\Response\Model\Rule;
use Appwrite\Utopia\Response\Model\Tag;
use Appwrite\Utopia\Response\Model\Deployment;
use Appwrite\Utopia\Response\Model\Token;
use Appwrite\Utopia\Response\Model\Webhook;
use Appwrite\Utopia\Response\Model\Preferences;
@@ -151,8 +151,8 @@ class Response extends SwooleResponse
const MODEL_FUNCTION_LIST = 'functionList';
const MODEL_RUNTIME = 'runtime';
const MODEL_RUNTIME_LIST = 'runtimeList';
const MODEL_TAG = 'tag';
const MODEL_TAG_LIST = 'tagList';
const MODEL_DEPLOYMENT = 'deployment';
const MODEL_DEPLOYMENT_LIST = 'deploymentList';
const MODEL_EXECUTION = 'execution';
const MODEL_SYNC_EXECUTION = 'syncExecution';
const MODEL_EXECUTION_LIST = 'executionList';
@@ -222,7 +222,7 @@ class Response extends SwooleResponse
->setModel(new BaseList('Memberships List', self::MODEL_MEMBERSHIP_LIST, 'memberships', self::MODEL_MEMBERSHIP))
->setModel(new BaseList('Functions List', self::MODEL_FUNCTION_LIST, 'functions', self::MODEL_FUNCTION))
->setModel(new BaseList('Runtimes List', self::MODEL_RUNTIME_LIST, 'runtimes', self::MODEL_RUNTIME))
->setModel(new BaseList('Tags List', self::MODEL_TAG_LIST, 'tags', self::MODEL_TAG))
->setModel(new BaseList('Deployments List', self::MODEL_DEPLOYMENT_LIST, 'deployments', self::MODEL_DEPLOYMENT))
->setModel(new BaseList('Executions List', self::MODEL_EXECUTION_LIST, 'executions', self::MODEL_EXECUTION))
->setModel(new BaseList('Builds List', self::MODEL_BUILD_LIST, 'builds', self::MODEL_BUILD))
->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false))
@@ -262,7 +262,7 @@ class Response extends SwooleResponse
->setModel(new Membership())
->setModel(new Func())
->setModel(new Runtime())
->setModel(new Tag())
->setModel(new Deployment())
->setModel(new Execution())
->setModel(new SyncExecution())
->setModel(new Build())
+2 -2
View File
@@ -28,8 +28,8 @@ class V07 extends Filter
case Response::MODEL_COLLECTION:
case Response::MODEL_FILE_LIST:
case Response::MODEL_FILE:
case Response::MODEL_TAG_LIST:
case Response::MODEL_TAG:
case Response::MODEL_DEPLOYMENT_LIST:
case Response::MODEL_DEPLOYMENT:
case Response::MODEL_EXECUTION_LIST:
case Response::MODEL_EXECUTION:
case Response::MODEL_TEAM_LIST:
+2 -2
View File
@@ -24,8 +24,8 @@ class V08 extends Filter
case Response::MODEL_COLLECTION:
case Response::MODEL_FILE_LIST:
case Response::MODEL_FILE:
case Response::MODEL_TAG_LIST:
case Response::MODEL_TAG:
case Response::MODEL_DEPLOYMENT_LIST:
case Response::MODEL_DEPLOYMENT:
case Response::MODEL_EXECUTION_LIST:
case Response::MODEL_EXECUTION:
case Response::MODEL_TEAM_LIST:
+5 -5
View File
@@ -18,15 +18,15 @@ class Build extends Model
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'The tag creation date in Unix timestamp.',
'description' => 'The deployment creation date in Unix timestamp.',
'default' => 0,
'example' => 1592981250,
])
// Build Status
// Failed - The tag build has failed. More details can usually be found in buildStderr
// Ready - The tag build was successful and the tag is ready to be deployed
// Processing - The tag is currently waiting to have a build triggered
// Building - The tag is currently being built
// Failed - The deployment build has failed. More details can usually be found in buildStderr
// Ready - The deployment build was successful and the deployment is ready to be deployed
// Processing - The deployment is currently waiting to have a build triggered
// Building - The deployment is currently being built
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'The build status.',
@@ -5,14 +5,14 @@ namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Tag extends Model
class Deployment extends Model
{
public function __construct()
{
$this
->addRule('$id', [
'type' => self::TYPE_STRING,
'description' => 'Tag ID.',
'description' => 'Deployment ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])
@@ -24,13 +24,13 @@ class Tag extends Model
])
->addRule('dateCreated', [
'type' => self::TYPE_INTEGER,
'description' => 'The tag creation date in Unix timestamp.',
'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 tag code.',
'description' => 'The entrypoint file to use to execute the delpoyment code.',
'default' => '',
'example' => 'enabled',
])
@@ -41,13 +41,13 @@ class Tag extends Model
'example' => 128,
])
// Build Status
// Failed - The tag build has failed. More details can usually be found in buildStderr
// Ready - The tag build was successful and the tag is ready to be deployed
// Processing - The tag is currently waiting to have a build triggered
// Building - The tag is currently being built
// Failed - The deployment build has failed. More details can usually be found in buildStderr
// Ready - The deployment build was successful and the deployment is ready to be deployed
// Processing - The deployment is currently waiting to have a build triggered
// Building - The deployment is currently being built
->addRule('status', [
'type' => self::TYPE_STRING,
'description' => 'The tags current built status',
'description' => 'The deployment\'s current built status',
'default' => '',
'example' => 'ready',
])
@@ -71,7 +71,7 @@ class Tag extends Model
])
->addRule('deploy', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Whether the tag should be automatically deployed.',
'description' => 'Whether the deployment should be automatically deployed.',
'default' => false,
'example' => true,
])
@@ -85,7 +85,7 @@ class Tag extends Model
*/
public function getName():string
{
return 'Tag';
return 'Deployment';
}
/**
@@ -95,6 +95,6 @@ class Tag extends Model
*/
public function getType():string
{
return Response::MODEL_TAG;
return Response::MODEL_DEPLOYMENT;
}
}
+2 -2
View File
@@ -55,9 +55,9 @@ class Func extends Model
'default' => '',
'example' => 'python-3.8',
])
->addRule('tag', [
->addRule('deployment', [
'type' => self::TYPE_STRING,
'description' => 'Function active tag ID.',
'description' => 'Function\'s active deployment ID.',
'default' => '',
'example' => '5e5ea5c16897e',
])