refactor(scenario): remove step type and simplify scheduler to exec-only
- remove StepType, type column, and type field from step entity and DTOs - remove executeLoginStep, executeSignStep, executeExecStep from scheduler - inline exec logic directly in executeStepRun; all steps run execCode - remove AuthService, EnvironmentService, runEnvironments from scheduler - remove type selector from CreateStepPage and EditStepPage - remove type badge column from ScenarioDetailPage - fix useEffect dependency arrays in RunDetailPage (FINAL, id, runId, polling) - fix duplicate /snippets proxy key in vite.config.ts - remove unused escapeHtml export from hljs.ts
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { ConflictException, Injectable, NotFoundException } from "@nestjs/common";
|
||||
import {
|
||||
ConflictException,
|
||||
Injectable,
|
||||
NotFoundException,
|
||||
} from "@nestjs/common";
|
||||
import { InjectRepository } from "@nestjs/typeorm";
|
||||
import { Like, Repository } from "typeorm";
|
||||
import { ScenarioEntity } from "./scenario.entity";
|
||||
@@ -66,7 +70,11 @@ export class ScenarioService {
|
||||
async findOne(id: string): Promise<ScenarioEntity> {
|
||||
const scenario = await this.scenarioRepo.findOne({
|
||||
where: { id },
|
||||
relations: ["steps", "scenarioCredentials", "scenarioCredentials.credential"],
|
||||
relations: [
|
||||
"steps",
|
||||
"scenarioCredentials",
|
||||
"scenarioCredentials.credential",
|
||||
],
|
||||
order: { steps: { order: "ASC" } },
|
||||
});
|
||||
if (!scenario) throw new NotFoundException(`Scenario ${id} not found`);
|
||||
@@ -187,7 +195,9 @@ export class ScenarioService {
|
||||
* Builds a map of alias → parsed credential data for use in code execution.
|
||||
* Returns null values for credentials with no data.
|
||||
*/
|
||||
async buildCredentialMap(scenarioId: string): Promise<Record<string, unknown>> {
|
||||
async buildCredentialMap(
|
||||
scenarioId: string,
|
||||
): Promise<Record<string, unknown>> {
|
||||
const scs = await this.findScenarioCredentials(scenarioId);
|
||||
const map: Record<string, unknown> = {};
|
||||
for (const sc of scs) {
|
||||
@@ -227,7 +237,9 @@ export class ScenarioService {
|
||||
|
||||
async findAllRuns(
|
||||
query: RunsQueryDto,
|
||||
): Promise<PaginatedResult<ScenarioRunEntity & { scenario: ScenarioEntity }>> {
|
||||
): Promise<
|
||||
PaginatedResult<ScenarioRunEntity & { scenario: ScenarioEntity }>
|
||||
> {
|
||||
const page = query.page ?? 1;
|
||||
const limit = query.limit ?? 20;
|
||||
const where: Record<string, unknown> = {};
|
||||
|
||||
Reference in New Issue
Block a user