feat(scenarios): add step title, scenario credentials, and environment context in executor
- add nullable title column to scenario steps; exposed in create/edit forms and step table - add scenario-credential join (many-to-many with CredentialEntity) with CRUD endpoints - expose environment URLs in code executor helpers via helpers.env and helpers.getEnvUrl() - resolve and cache environment per run from the login step's environmentName in scheduler - add section spacing and step table title column to ScenarioDetailPage
This commit is contained in:
@@ -16,6 +16,7 @@ import { CreateScenarioDto } from "./dto/create-scenario.dto";
|
||||
import { UpdateScenarioDto } from "./dto/update-scenario.dto";
|
||||
import { CreateScenarioStepDto } from "./dto/create-scenario-step.dto";
|
||||
import { UpdateScenarioStepDto } from "./dto/update-scenario-step.dto";
|
||||
import { AddScenarioCredentialDto } from "./dto/add-scenario-credential.dto";
|
||||
import { PaginationQueryDto } from "./dto/pagination-query.dto";
|
||||
import { ScenarioOrderBy } from "./scenario.service";
|
||||
import { RunsQueryDto } from "./dto/runs-query.dto";
|
||||
@@ -140,6 +141,40 @@ export class ScenarioController {
|
||||
return this.scenarioService.removeStep(id, stepId);
|
||||
}
|
||||
|
||||
// ── Credentials ───────────────────────────────────────────────────────────
|
||||
|
||||
@Get(":id/credentials")
|
||||
@ApiOperation({ summary: "List credentials assigned to a scenario" })
|
||||
@ApiResponse({ status: 200 })
|
||||
@ApiResponse({ status: 404, description: "Scenario not found" })
|
||||
findScenarioCredentials(@Param("id", ParseIntPipe) id: number) {
|
||||
return this.scenarioService.findScenarioCredentials(id);
|
||||
}
|
||||
|
||||
@Post(":id/credentials")
|
||||
@ApiOperation({ summary: "Add a credential to a scenario with an alias" })
|
||||
@ApiResponse({ status: 201, description: "Credential added" })
|
||||
@ApiResponse({ status: 404, description: "Scenario or credential not found" })
|
||||
@ApiResponse({ status: 409, description: "Alias already used in this scenario" })
|
||||
addScenarioCredential(
|
||||
@Param("id", ParseIntPipe) id: number,
|
||||
@Body() dto: AddScenarioCredentialDto,
|
||||
) {
|
||||
return this.scenarioService.addScenarioCredential(id, dto);
|
||||
}
|
||||
|
||||
@Delete(":id/credentials/:scCredId")
|
||||
@HttpCode(204)
|
||||
@ApiOperation({ summary: "Remove a credential from a scenario" })
|
||||
@ApiResponse({ status: 204 })
|
||||
@ApiResponse({ status: 404, description: "Scenario or credential assignment not found" })
|
||||
removeScenarioCredential(
|
||||
@Param("id", ParseIntPipe) id: number,
|
||||
@Param("scCredId", ParseIntPipe) scCredId: number,
|
||||
) {
|
||||
return this.scenarioService.removeScenarioCredential(id, scCredId);
|
||||
}
|
||||
|
||||
// ── Runs ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@Get(":id/runs")
|
||||
|
||||
Reference in New Issue
Block a user