mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Move schedules module into projects namespace
This commit is contained in:
committed by
premtsd-code
parent
c3e80296b1
commit
4940239c99
@@ -11,7 +11,6 @@ use Appwrite\Platform\Modules\Functions;
|
||||
use Appwrite\Platform\Modules\Health;
|
||||
use Appwrite\Platform\Modules\Projects;
|
||||
use Appwrite\Platform\Modules\Proxy;
|
||||
use Appwrite\Platform\Modules\Schedules;
|
||||
use Appwrite\Platform\Modules\Sites;
|
||||
use Appwrite\Platform\Modules\Storage;
|
||||
use Appwrite\Platform\Modules\Tokens;
|
||||
@@ -29,7 +28,6 @@ class Appwrite extends Platform
|
||||
$this->addModule(new Projects\Module());
|
||||
$this->addModule(new Functions\Module());
|
||||
$this->addModule(new Health\Module());
|
||||
$this->addModule(new Schedules\Module());
|
||||
$this->addModule(new Sites\Module());
|
||||
$this->addModule(new Console\Module());
|
||||
$this->addModule(new Proxy\Module());
|
||||
|
||||
+4
-2
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules;
|
||||
namespace Appwrite\Platform\Modules\Projects\Http\Schedules;
|
||||
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Task\Validator\Cron;
|
||||
@@ -75,7 +76,7 @@ class Create extends Action
|
||||
namespace: 'projects',
|
||||
group: 'schedules',
|
||||
name: 'createSchedule',
|
||||
description: '/docs/references/schedules/create.md',
|
||||
description: '/docs/references/projects/schedules/create.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
@@ -83,6 +84,7 @@ class Create extends Action
|
||||
model: Response::MODEL_SCHEDULE,
|
||||
),
|
||||
],
|
||||
contentType: ContentType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('resourceType', '', new WhiteList($resourceTypes, true), 'The resource type for the schedule. Possible values: '.implode(', ', $resourceTypes).'.')
|
||||
+5
-3
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules;
|
||||
namespace Appwrite\Platform\Modules\Projects\Http\Schedules;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
@@ -33,14 +34,15 @@ class Get extends Action
|
||||
namespace: 'projects',
|
||||
group: 'schedules',
|
||||
name: 'getSchedule',
|
||||
description: '/docs/references/schedules/get.md',
|
||||
description: '/docs/references/projects/schedules/get.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_SCHEDULE,
|
||||
)
|
||||
]
|
||||
],
|
||||
contentType: ContentType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('scheduleId', '', new UID(), 'Schedule ID.')
|
||||
+5
-3
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules;
|
||||
namespace Appwrite\Platform\Modules\Projects\Http\Schedules;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Database\Validator\Queries\Schedules;
|
||||
@@ -40,14 +41,15 @@ class XList extends Action
|
||||
namespace: 'projects',
|
||||
group: 'schedules',
|
||||
name: 'listSchedules',
|
||||
description: '/docs/references/schedules/list.md',
|
||||
description: '/docs/references/projects/schedules/list.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_SCHEDULE_LIST,
|
||||
)
|
||||
]
|
||||
],
|
||||
contentType: ContentType::JSON,
|
||||
))
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('queries', [], new Schedules(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Schedules::ALLOWED_ATTRIBUTES), true)
|
||||
@@ -12,6 +12,9 @@ use Appwrite\Platform\Modules\Projects\Http\Projects\Labels\Update as UpdateProj
|
||||
use Appwrite\Platform\Modules\Projects\Http\Projects\Team\Update as UpdateProjectTeam;
|
||||
use Appwrite\Platform\Modules\Projects\Http\Projects\Update as UpdateProject;
|
||||
use Appwrite\Platform\Modules\Projects\Http\Projects\XList as ListProjects;
|
||||
use Appwrite\Platform\Modules\Projects\Http\Schedules\Create as CreateSchedule;
|
||||
use Appwrite\Platform\Modules\Projects\Http\Schedules\Get as GetSchedule;
|
||||
use Appwrite\Platform\Modules\Projects\Http\Schedules\XList as ListSchedules;
|
||||
use Utopia\Platform\Service;
|
||||
|
||||
class Http extends Service
|
||||
@@ -30,5 +33,9 @@ class Http extends Service
|
||||
$this->addAction(ListProjects::getName(), new ListProjects());
|
||||
$this->addAction(UpdateProjectLabels::getName(), new UpdateProjectLabels());
|
||||
$this->addAction(UpdateProjectTeam::getName(), new UpdateProjectTeam());
|
||||
|
||||
$this->addAction(CreateSchedule::getName(), new CreateSchedule());
|
||||
$this->addAction(GetSchedule::getName(), new GetSchedule());
|
||||
$this->addAction(ListSchedules::getName(), new ListSchedules());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Schedules;
|
||||
|
||||
use Appwrite\Platform\Modules\Schedules\Services\Http;
|
||||
use Utopia\Platform;
|
||||
|
||||
class Module extends Platform\Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->addService('http', new Http());
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Schedules\Services;
|
||||
|
||||
use Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules\Create;
|
||||
use Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules\Get;
|
||||
use Appwrite\Platform\Modules\Schedules\Http\Projects\Schedules\XList;
|
||||
use Utopia\Platform\Service;
|
||||
|
||||
class Http extends Service
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->type = Service::TYPE_HTTP;
|
||||
|
||||
$this->addAction(Get::getName(), new Get());
|
||||
$this->addAction(XList::getName(), new XList());
|
||||
$this->addAction(Create::getName(), new Create());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user