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:
ars9 committed 2026-04-08 18:10:42 +03:00
1 parent b0c02a1cdc
commit 9a9ccbfe37
67 files changed
+3809 -1412

No files matched your search

+20 -11
View File
@@ -1,11 +1,14 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { SessionEntity } from './session.entity';
import type { Cookie } from 'playwright';
import { PaginationQueryDto, PaginatedResult } from '../common/dto/pagination.dto';
import { Injectable } from "@nestjs/common";
import { InjectRepository } from "@nestjs/typeorm";
import { Repository } from "typeorm";
import { SessionEntity } from "./session.entity";
import type { Cookie } from "playwright";
import {
PaginationQueryDto,
PaginatedResult,
} from "../common/dto/pagination.dto";
export type SessionOrderBy = 'id' | 'sessionName' | 'createdAt' | 'updatedAt';
export type SessionOrderBy = "id" | "sessionName" | "createdAt" | "updatedAt";
@Injectable()
export class SessionService {
@@ -43,13 +46,19 @@ export class SessionService {
return this.repo.findOneBy({ sessionName });
}
async findAll(query: PaginationQueryDto<SessionOrderBy> = {}): Promise<PaginatedResult<Pick<SessionEntity, 'id' | 'sessionName' | 'createdAt' | 'updatedAt'>>> {
async findAll(
query: PaginationQueryDto<SessionOrderBy> = {},
): Promise<
PaginatedResult<
Pick<SessionEntity, "id" | "sessionName" | "createdAt" | "updatedAt">
>
> {
const page = query.page ?? 1;
const limit = query.limit ?? 20;
const orderBy = query.orderBy ?? 'id';
const orderDir = query.orderDir ?? 'ASC';
const orderBy = query.orderBy ?? "id";
const orderDir = query.orderDir ?? "ASC";
const [data, total] = await this.repo.findAndCount({
select: ['id', 'sessionName', 'createdAt', 'updatedAt'],
select: ["id", "sessionName", "createdAt", "updatedAt"],
order: { [orderBy]: orderDir },
skip: (page - 1) * limit,
take: limit,