import { z } from "zod";
import { baseTestSchema, baseTraceSchema } from "../../types/TestTypes.js";
export const numericString = (description) => z
    .string()
    .refine((val) => !val || /^\d+$/.test(val), {
    message: `${description} must be a non-negative integer`,
});
export const loadTestSchema = {
    ...baseTestSchema,
    loadCount: numericString("loadCount")
        .default("")
        .describe("Total number of iterations to be executed for the test. DO NOT ASSUME VALUE"),
    loadDuration: numericString("loadDuration")
        .default("5")
        .describe("Duration of the load test in seconds (default: 5)"),
    loadNumThreads: numericString("loadNumThreads")
        .default("1")
        .describe("Number of concurrent threads/users for the load test (default: 1)"),
    loadRampupDuration: numericString("loadRampupDuration")
        .default("")
        .describe("Time in seconds to gradually increase load to target level. DO NOT ASSUME VALUE"),
    loadRampupInterval: numericString("loadRampupInterval")
        .default("")
        .describe("Interval in seconds between ramping up threads. DO NOT ASSUME VALUE"),
    loadTargetRPS: numericString("loadTargetRPS")
        .default("")
        .describe("Target requests per second for the load test. DO NOT ASSUME VALUE"),
    trace: baseTraceSchema.shape.trace.default(""),
    include: baseTraceSchema.shape.include,
    exclude: baseTraceSchema.shape.exclude,
    endpointURL: baseTestSchema.endpointURL.default(""),
};
