refactor(session): auto-create named browser sessions
- create and register named browser sessions on open/exec when missing - align scenario step DTO/entity/service by removing sessionName usage - update MCP scenario-step schemas to use optional title fields
This commit is contained in:
1 parent
1627733701
commit
b45f95d8cf
9 files changed
+54
-28
No files matched your search
@@ -5,6 +5,7 @@ export class AddScenarioCredentialDto {
|
||||
@ApiProperty({ example: "uuid-here" })
|
||||
@IsUUID()
|
||||
credentialId: string;
|
||||
|
||||
@ApiProperty({ example: "api_key" })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
|
||||
@@ -7,16 +7,6 @@ export class CreateScenarioStepDto {
|
||||
@IsString()
|
||||
title?: string;
|
||||
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"Session name (deprecated — browser is created automatically per run).",
|
||||
example: "my-session",
|
||||
})
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
sessionName?: string;
|
||||
|
||||
@ApiPropertyOptional({ example: "return await page.title();" })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -13,12 +13,6 @@ export class UpdateScenarioStepDto {
|
||||
@Min(0)
|
||||
order?: number;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
sessionName?: string;
|
||||
|
||||
@ApiPropertyOptional()
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
|
||||
@@ -29,9 +29,6 @@ export class ScenarioStepEntity {
|
||||
@Column({ type: "text", nullable: true })
|
||||
title: string | null;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
sessionName: string | null;
|
||||
|
||||
@Column({ type: "text", nullable: true })
|
||||
execCode: string | null;
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ export class ScenarioService {
|
||||
order: currentCount,
|
||||
scenarioId,
|
||||
title: dto.title ?? null,
|
||||
sessionName: dto.sessionName ?? null,
|
||||
execCode: dto.execCode ?? null,
|
||||
validateCode: dto.validateCode ?? null,
|
||||
}),
|
||||
@@ -153,7 +152,6 @@ export class ScenarioService {
|
||||
...dto,
|
||||
order: step.order,
|
||||
title: dto.title ?? step.title,
|
||||
sessionName: dto.sessionName ?? step.sessionName,
|
||||
execCode: dto.execCode ?? step.execCode,
|
||||
validateCode: dto.validateCode ?? step.validateCode,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user