Adds prettier 3.9.8 (exact) with a shared config (single quotes, 120 columns, trailing commas), .prettierignore, .editorconfig and the `format` / `format:check` scripts, then formats all TypeScript, JavaScript, CSS, JSON and YAML sources. Purely mechanical: no behaviour change. Typecheck passes, the vitest suite and the 74 IDE node tests produce the same results as before (socket-binding tests still cannot run inside this sandbox). Previously the longest source line was ~3000 characters; reviewing the following semantic changes now produces readable diffs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
799 B
TypeScript
25 lines
799 B
TypeScript
import { Body, Controller, Inject, Param, Post, Req } from '@nestjs/common';
|
|
import type { Request } from 'express';
|
|
import { z } from 'zod';
|
|
import type { Actor } from '@wishforge/contracts';
|
|
import { Services } from './http.js';
|
|
import { WorkspaceLaunch } from './domain/workspace-launch.js';
|
|
@Controller('v1/workspaces')
|
|
export class WorkspaceLaunchController {
|
|
constructor(@Inject(Services) private s: Services) {}
|
|
@Post(':id/launch') async launch(
|
|
@Req() req: Request & { actor: Actor },
|
|
@Param('id') id: string,
|
|
@Body() body: unknown,
|
|
) {
|
|
z.object({}).strict().parse(body);
|
|
return {
|
|
data: await new WorkspaceLaunch(this.s.control.store, this.s.control.env).launch(
|
|
req.actor,
|
|
id,
|
|
req.header('Authorization') ?? '',
|
|
),
|
|
};
|
|
}
|
|
}
|