mirror of
https://github.com/nextcloud/app_api.git
synced 2026-01-13 20:19:21 +00:00
PR should not break anything, for old parts added a workarounds, that we will remove in a month when all ExApps will publish their updates. **Changes**: * UI now use the same algorithm/code for ExApp `register` & `update` as the CLI commands. * Deprecated "deploy" command, now `register` commands performs deploy. **Refactoring**: * Removed internal `DispatchInit` command, as from CLI we already can do it without spawning additional process. * Removed hack(`status['active']`) when we have some half-enabled state of ExApp when it is not enabled, but already can call APIs, now ExApp enables before calling `/init` * Made code more consistent in many place. OTHER CHANGES FOR DEVS: * For `--json-info` parameter in occ `register` command keys renamed: "appid" -> "id", "system_app" -> "system" _Old naming is still supported but will be removed in future, in such way we make consistent parameters between `info.xml` and `--json-info`._ ---- Related: #219 _AppAPI will perform deploy & registration in a background and issue should be fixed_ --------- Signed-off-by: Alexander Piskun <bigcat88@icloud.com> Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com> Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
82 lines
2.1 KiB
PHP
82 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\AppAPI\Db;
|
|
|
|
use JsonSerializable;
|
|
use OCP\AppFramework\Db\Entity;
|
|
|
|
/**
|
|
* Class DaemonConfig
|
|
*
|
|
* @package OCA\AppAPI\Db
|
|
*
|
|
* @method string getAcceptsDeployId()
|
|
* @method string getName()
|
|
* @method string getDisplayName()
|
|
* @method string getProtocol()
|
|
* @method string getHost()
|
|
* @method array getDeployConfig()
|
|
* @method void setAcceptsDeployId(string $acceptsDeployId)
|
|
* @method void setName(string $name)
|
|
* @method void setDisplayName(string $displayName)
|
|
* @method void setProtocol(string $protocol)
|
|
* @method void setHost(string $host)
|
|
* @method void setDeployConfig(array $deployConfig)
|
|
*/
|
|
class DaemonConfig extends Entity implements JsonSerializable {
|
|
protected $name;
|
|
protected $displayName;
|
|
protected $acceptsDeployId;
|
|
protected $protocol;
|
|
protected $host;
|
|
protected $deployConfig;
|
|
|
|
/**
|
|
* @param array $params
|
|
*/
|
|
public function __construct(array $params = []) {
|
|
$this->addType('acceptsDeployId', 'string');
|
|
$this->addType('name', 'string');
|
|
$this->addType('displayName', 'string');
|
|
$this->addType('protocol', 'string');
|
|
$this->addType('host', 'string');
|
|
$this->addType('deployConfig', 'json');
|
|
|
|
if (isset($params['id'])) {
|
|
$this->setId($params['id']);
|
|
}
|
|
if (isset($params['accepts_deploy_id'])) {
|
|
$this->setAcceptsDeployId($params['accepts_deploy_id']);
|
|
}
|
|
if (isset($params['name'])) {
|
|
$this->setName($params['name']);
|
|
}
|
|
if (isset($params['display_name'])) {
|
|
$this->setDisplayName($params['display_name']);
|
|
}
|
|
if (isset($params['protocol'])) {
|
|
$this->setProtocol($params['protocol']);
|
|
}
|
|
if (isset($params['host'])) {
|
|
$this->setHost($params['host']);
|
|
}
|
|
if (isset($params['deploy_config'])) {
|
|
$this->setDeployConfig($params['deploy_config']);
|
|
}
|
|
}
|
|
|
|
public function jsonSerialize(): array {
|
|
return [
|
|
'id' => $this->getId(),
|
|
'accepts_deploy_id' => $this->getAcceptsDeployId(),
|
|
'name' => $this->getName(),
|
|
'display_name' => $this->getDisplayName(),
|
|
'protocol' => $this->getProtocol(),
|
|
'host' => $this->getHost(),
|
|
'deploy_config' => $this->getDeployConfig(),
|
|
];
|
|
}
|
|
}
|