feat(versioning): version scenarios and snippets, bump to 1.16.0

- snapshot scenario and snippet content into version tables on every
  content change; live tables keep holding the latest version
- record the scenario version on each run and copy its steps into the
  run steps, so runs execute and show the version they were created with
- keep run step history when a step is deleted (FK set null)
- pin a snippet version with runSnippet('alias@N')
- add version picker to the run modal and version info across the UI
- add version list/get endpoints and MCP tools
- include version in exports and require it on import, restoring the
  exact version by id + version
This commit is contained in:
Andrii Arsenin committed 2026-09-30 15:24:44 +03:00
1 parent 9fb6e8538b
commit eed385debf
40 files changed
+1457 -137

No files matched your search

@@ -1,9 +1,11 @@
import {
IsBoolean,
IsEnum,
IsInt,
IsNotEmpty,
IsOptional,
IsUUID,
Min,
} from "class-validator";
import { TraceMode } from "../../config/app.config";
@@ -19,4 +21,10 @@ export class CreateScenarioRunDto {
@IsEnum(TraceMode)
@IsOptional()
traceMode?: TraceMode;
/** Scenario version to run; defaults to the latest. */
@IsInt()
@Min(1)
@IsOptional()
version?: number;
}
@@ -3,11 +3,13 @@ import { Type } from "class-transformer";
import {
IsArray,
IsIn,
IsInt,
IsNotEmpty,
IsObject,
IsOptional,
IsString,
IsUUID,
Min,
ValidateNested,
} from "class-validator";
import { EnvironmentData } from "../../environment/environment.entity";
@@ -24,6 +26,12 @@ export class ScenarioStepExportDto {
@IsString()
@IsNotEmpty()
execCode: string | null;
@ApiPropertyOptional()
@IsOptional()
@IsInt()
@Min(1)
timeoutSeconds?: number | null;
}
export class CredentialExportDto {
@@ -117,6 +125,17 @@ export class ScenarioExportDto {
@IsUUID()
environmentId?: string;
@ApiProperty({ description: "Scenario version this export holds" })
@IsInt()
@Min(1)
version: number;
@ApiPropertyOptional()
@IsOptional()
@IsInt()
@Min(1)
timeoutSeconds?: number;
@ApiPropertyOptional({ type: [ScenarioCredentialMappingDto] })
@IsOptional()
@IsArray()