refactor: fix lint errors across server and client
- replace any types with explicit types in scenario file listing, import/export and mcp upload code - type test server addresses and list callbacks, drop unused vars - document why e2e export keeps the archiver import-require form - remove unused scenario files total state in the client - require clean lint in both packages in CLAUDE.md
This commit is contained in:
1 parent
1c5c906cbb
commit
cf56840df9
9 files changed
+41
-27
No files matched your search
@@ -21,7 +21,10 @@ import {
|
||||
import type { AppConfig, TraceMode } from "../config/app.config";
|
||||
import { CredentialEntity } from "../credential/credential.entity";
|
||||
import { EnvironmentEntity } from "../environment/environment.entity";
|
||||
import { FileStorageService } from "../file/file-storage.service";
|
||||
import {
|
||||
FileMetadata,
|
||||
FileStorageService,
|
||||
} from "../file/file-storage.service";
|
||||
import { ScenarioFileEntity } from "../file/scenario-file.entity";
|
||||
import { ScenarioRunFileEntity } from "../file/scenario-run-file.entity";
|
||||
import { SnippetEntity } from "../snippet/snippet.entity";
|
||||
@@ -83,6 +86,12 @@ function stepsSnapshot(steps: ScenarioStepEntity[]): ScenarioStepSnapshot[] {
|
||||
}));
|
||||
}
|
||||
|
||||
/** File metadata as returned by the scenario/run file listing endpoints. */
|
||||
export interface FileListResult {
|
||||
items: Omit<FileMetadata, "path">[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export type UsedSnippet = SnippetEntity & {
|
||||
/** Version pinned via `runSnippet("alias@N")`, or null for the latest. */
|
||||
pinnedVersion: number | null;
|
||||
@@ -941,9 +950,9 @@ export class ScenarioService implements OnModuleInit {
|
||||
|
||||
async uploadFile(
|
||||
scenarioId: string,
|
||||
file: MulterFile,
|
||||
file: Pick<MulterFile, "buffer" | "originalname" | "mimetype">,
|
||||
expiresAtStr?: string,
|
||||
): Promise<any> {
|
||||
): Promise<Omit<FileMetadata, "path" | "sha256">> {
|
||||
// Verify scenario exists
|
||||
await this.findOne(scenarioId);
|
||||
|
||||
@@ -990,7 +999,7 @@ export class ScenarioService implements OnModuleInit {
|
||||
scenarioId: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
): Promise<any> {
|
||||
): Promise<FileListResult> {
|
||||
// Verify scenario exists
|
||||
await this.findOne(scenarioId);
|
||||
|
||||
@@ -1088,7 +1097,7 @@ export class ScenarioService implements OnModuleInit {
|
||||
runId: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
): Promise<any> {
|
||||
): Promise<FileListResult> {
|
||||
// Verify scenario and run exist
|
||||
await this.findOne(scenarioId);
|
||||
const run = await this.runRepo.findOneBy({ id: runId, scenarioId });
|
||||
|
||||
Reference in new issue
Block a user