Integration Credentials: - Add IntegrationCredential model with encrypted payload - Add full CRUD: ManageIntegrationCredentialsAction, 4 Tasks, Controller, Requests - Add migration for integration_credentials table - Add Vue pages: Index, Create, Edit - AI tasks now read API keys from DB instead of .env - Add sidebar menu item Deploy UI: - Add DeployTask with full deploy lifecycle management - Extend DeployController with index, log, history endpoints - Add Deploy/Index.vue with live polling and deploy log viewer - Add sidebar menu item and QuickAction for Sveden UI: - Add 'key' icon to SidebarNavItem - Change deploy button color to amber in Main.vue
48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Containers\Dashboard\Actions\IntegrationCredentials;
|
|
|
|
use App\Containers\Dashboard\Models\IntegrationCredential;
|
|
use App\Containers\Dashboard\Tasks\IntegrationCredentials\DeleteIntegrationCredentialTask;
|
|
use App\Containers\Dashboard\Tasks\IntegrationCredentials\GetIntegrationCredentialTask;
|
|
use App\Containers\Dashboard\Tasks\IntegrationCredentials\ListIntegrationCredentialsTask;
|
|
use App\Containers\Dashboard\Tasks\IntegrationCredentials\SaveIntegrationCredentialTask;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
|
|
class ManageIntegrationCredentialsAction
|
|
{
|
|
public function __construct(
|
|
private readonly ListIntegrationCredentialsTask $listTask,
|
|
private readonly SaveIntegrationCredentialTask $saveTask,
|
|
private readonly DeleteIntegrationCredentialTask $deleteTask,
|
|
) {}
|
|
|
|
public function list(): Collection
|
|
{
|
|
return $this->listTask->run();
|
|
}
|
|
|
|
public function create(array $data): IntegrationCredential
|
|
{
|
|
return $this->saveTask->run(
|
|
$data['provider'],
|
|
$data['payload'],
|
|
$data['is_active'] ?? true,
|
|
);
|
|
}
|
|
|
|
public function update(IntegrationCredential $credential, array $data): IntegrationCredential
|
|
{
|
|
return $this->saveTask->run(
|
|
$data['provider'],
|
|
$data['payload'],
|
|
$data['is_active'] ?? true,
|
|
);
|
|
}
|
|
|
|
public function delete(IntegrationCredential $credential): bool
|
|
{
|
|
return $this->deleteTask->run($credential);
|
|
}
|
|
}
|