/**
 * Scale Assessment Types
 *
 * Types for load profiling, bottleneck detection, and capacity estimation.
 *
 * @module scanners/scale/types
 */
import { z } from "zod";
/**
 * Endpoint definition for load testing
 */
export const EndpointSchema = z.object({
    path: z.string().describe("URL path to test"),
    method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).default("GET"),
    weight: z.number().min(0).max(100).default(100).describe("Relative weight for traffic distribution"),
    headers: z.record(z.string()).optional(),
    body: z.record(z.unknown()).optional(),
    thresholds: z.object({
        p95: z.number().optional().describe("95th percentile latency threshold (ms)"),
        p99: z.number().optional().describe("99th percentile latency threshold (ms)"),
        errorRate: z.number().optional().describe("Maximum error rate (0-1)"),
    }).optional(),
});
/**
 * Load scenario definition
 */
export const ScenarioSchema = z.object({
    name: z.string().describe("Scenario name"),
    type: z.enum(["ramp", "spike", "soak", "stress", "breakpoint"]).default("ramp"),
    duration: z.string().describe("Duration (e.g., '5m', '1h')"),
    vus: z.union([
        z.number().describe("Fixed number of virtual users"),
        z.object({
            start: z.number().describe("Starting VUs"),
            end: z.number().describe("Ending VUs"),
        }).describe("Ramp VUs from start to end"),
    ]),
    endpoints: z.array(EndpointSchema).optional(),
});
/**
 * Load profile definition (YAML schema)
 */
export const LoadProfileSchema = z.object({
    name: z.string().describe("Profile name"),
    description: z.string().optional(),
    baseUrl: z.string().optional().describe("Base URL for endpoints"),
    tool: z.enum(["k6", "artillery", "autocannon", "wrk"]).default("k6"),
    scenarios: z.array(ScenarioSchema),
    thresholds: z.object({
        p95: z.number().optional().describe("Global 95th percentile threshold (ms)"),
        p99: z.number().optional().describe("Global 99th percentile threshold (ms)"),
        errorRate: z.number().optional().describe("Global max error rate (0-1)"),
        throughput: z.number().optional().describe("Minimum requests/sec"),
    }).optional(),
    endpoints: z.array(EndpointSchema).optional().describe("Default endpoints for all scenarios"),
});
//# sourceMappingURL=types.js.map