Some checks failed
ci/woodpecker/push/api Pipeline failed
Adds database-backed TerminalSession model with ACTIVE/CLOSED status enum, migration SQL, TerminalSessionService (create/findByWorkspace/close/findById), DTO file with class-validator decorators, unit tests (12 tests), and module registration. Workspace relation and indexed columns enable efficient session listing and recovery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
/**
|
|
* TerminalModule
|
|
*
|
|
* NestJS module for WebSocket-based terminal sessions via node-pty.
|
|
*
|
|
* Imports:
|
|
* - AuthModule for WebSocket authentication (verifySession)
|
|
* - PrismaModule for workspace membership queries and session persistence
|
|
*
|
|
* Providers:
|
|
* - TerminalService: manages PTY session lifecycle (in-memory)
|
|
* - TerminalSessionService: persists session records to the database
|
|
* - TerminalGateway: WebSocket gateway on /terminal namespace
|
|
*
|
|
* The module does not export providers; terminal sessions are
|
|
* self-contained within this module.
|
|
*/
|
|
|
|
import { Module } from "@nestjs/common";
|
|
import { TerminalGateway } from "./terminal.gateway";
|
|
import { TerminalService } from "./terminal.service";
|
|
import { TerminalSessionService } from "./terminal-session.service";
|
|
import { AuthModule } from "../auth/auth.module";
|
|
import { PrismaModule } from "../prisma/prisma.module";
|
|
|
|
@Module({
|
|
imports: [AuthModule, PrismaModule],
|
|
providers: [TerminalGateway, TerminalService, TerminalSessionService],
|
|
exports: [TerminalSessionService],
|
|
})
|
|
export class TerminalModule {}
|