feat(scenario): run logs, lint/format tooling, CONTRIBUTING
- add ScenarioRunLogEntity to persist step script output to DB - stepLogger dual-writes to NestJS logger and DB (fire-and-forget) - add GET /scenarios/:id/run/:runId returning run, stepRuns and logs - add POST /scenarios/:id/run/:runId/wait (polls until terminal state) - 9 new integration tests for the two endpoints (136 total) - add eslint with typescript-eslint and eslint-config-prettier - add npm scripts: format, lint, lint:fix - resolve all lint errors across src and test (no any types) - add CONTRIBUTING.md covering dev workflow
This commit is contained in:
1 parent
b0c02a1cdc
commit
9a9ccbfe37
67 files changed
+3809
-1412
No files matched your search
@@ -1,28 +1,36 @@
|
||||
import { Controller, Delete, Get, NotFoundException, Param, ParseIntPipe, Query } from '@nestjs/common';
|
||||
import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { SessionService } from './session.service';
|
||||
import { PaginationQueryDto } from '../common/dto/pagination.dto';
|
||||
import { SessionOrderBy } from './session.service';
|
||||
import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
NotFoundException,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
Query,
|
||||
} from "@nestjs/common";
|
||||
import { ApiOperation, ApiResponse, ApiTags } from "@nestjs/swagger";
|
||||
import { SessionService } from "./session.service";
|
||||
import { PaginationQueryDto } from "../common/dto/pagination.dto";
|
||||
import { SessionOrderBy } from "./session.service";
|
||||
|
||||
@ApiTags('sessions')
|
||||
@Controller('sessions')
|
||||
@ApiTags("sessions")
|
||||
@Controller("sessions")
|
||||
export class SessionController {
|
||||
constructor(private readonly sessionService: SessionService) {}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List all stored sessions (paginated)' })
|
||||
@ApiResponse({ status: 200, description: 'Paginated sessions' })
|
||||
@ApiOperation({ summary: "List all stored sessions (paginated)" })
|
||||
@ApiResponse({ status: 200, description: "Paginated sessions" })
|
||||
findAll(@Query() query: PaginationQueryDto<SessionOrderBy>) {
|
||||
return this.sessionService.findAll(query);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@ApiOperation({ summary: 'Delete a session by ID' })
|
||||
@ApiResponse({ status: 200, description: 'Session deleted' })
|
||||
@ApiResponse({ status: 404, description: 'Session not found' })
|
||||
async remove(@Param('id', ParseIntPipe) id: number): Promise<void> {
|
||||
@Delete(":id")
|
||||
@ApiOperation({ summary: "Delete a session by ID" })
|
||||
@ApiResponse({ status: 200, description: "Session deleted" })
|
||||
@ApiResponse({ status: 404, description: "Session not found" })
|
||||
async remove(@Param("id", ParseIntPipe) id: number): Promise<void> {
|
||||
const sessions = await this.sessionService.findAll();
|
||||
if (!sessions.data.find(s => s.id === id)) {
|
||||
if (!sessions.data.find((s) => s.id === id)) {
|
||||
throw new NotFoundException(`Session ${id} not found`);
|
||||
}
|
||||
await this.sessionService.remove(id);
|
||||
|
||||
Reference in new issue
Block a user