<?php
namespace SHServ\Routes;
trait ScriptsRESTAPI_v1 {
protected function scripts_restapi_uri_routes() {
$this -> router -> uri("/api/v1/scripts/actions/list", "{$this -> cn}\\ScriptsRESTAPIController@actions_scripts_list");
$this -> router -> uri("/api/v1/scripts/scopes/list", "{$this -> cn}\\ScriptsRESTAPIController@scope_list");
$this -> router -> uri("/api/v1/scripts/regular/list", "{$this -> cn}\\ScriptsRESTAPIController@regular_scripts_list");
$this -> router -> uri('/api/v1/scripts/scopes/name/$name', "{$this -> cn}\\ScriptsRESTAPIController@scope_file");
$this -> router -> uri('/api/v1/scripts/actions/alias/$uniq_name/enable', "{$this -> cn}\\ScriptsRESTAPIController@action_script_enable");
$this -> router -> uri('/api/v1/scripts/actions/alias/$uniq_name/disable', "{$this -> cn}\\ScriptsRESTAPIController@action_script_disable");
$this -> router -> uri('/api/v1/scripts/scopes/name/$uniq_name/enable', "{$this -> cn}\\ScriptsRESTAPIController@scope_enable");
$this -> router -> uri('/api/v1/scripts/scopes/name/$uniq_name/disable', "{$this -> cn}\\ScriptsRESTAPIController@scope_disable");
$this -> router -> uri('/api/v1/scripts/regular/alias/$uniq_name/enable', "{$this -> cn}\\ScriptsRESTAPIController@regular_script_enable");
$this -> router -> uri('/api/v1/scripts/regular/alias/$uniq_name/disable', "{$this -> cn}\\ScriptsRESTAPIController@regular_script_disable");
}
protected function scripts_restapi_post_routes() {
$this -> router -> post(
[ "alias", "params" ],
"{$this -> cn}\\ScriptsRESTAPIController@run_action_script",
'/api/v1/scripts/actions/run'
);
$this -> router -> post(
[ "name", "path", "file" ],
"{$this -> cn}\\ScriptsRESTAPIController@scope_update",
'/api/v1/scripts/scopes/update'
);
}
protected function scripts_restapi_get_routes() {
}
}