/**
 * Deployment Verification Types
 *
 * Types for canary deployment, health monitoring, and rollback detection.
 *
 * @module scanners/deploy/types
 */
import { z } from "zod";
/**
 * Supported deployment providers
 */
export type DeployProvider = "vercel" | "aws" | "gcp" | "railway" | "render" | "fly" | "unknown";
/**
 * Deployment environment
 */
export type DeployEnvironment = "production" | "preview" | "staging" | "development";
/**
 * Deployment status
 */
export type DeployStatus = "pending" | "building" | "deploying" | "ready" | "failed" | "canceled" | "rolled_back";
/**
 * Health check result
 */
export interface HealthCheckResult {
    endpoint: string;
    status: "healthy" | "degraded" | "unhealthy" | "timeout";
    statusCode?: number;
    responseTime: number;
    error?: string;
    checkedAt: string;
}
/**
 * Deployment info
 */
export interface DeploymentInfo {
    id: string;
    provider: DeployProvider;
    environment: DeployEnvironment;
    status: DeployStatus;
    url: string;
    createdAt: string;
    readyAt?: string;
    meta?: {
        commit?: string;
        branch?: string;
        buildTime?: number;
    };
}
/**
 * Canary deployment config
 */
export declare const CanaryConfigSchema: z.ZodObject<{
    enabled: z.ZodDefault<z.ZodBoolean>;
    trafficPercent: z.ZodDefault<z.ZodNumber>;
    duration: z.ZodDefault<z.ZodString>;
    thresholds: z.ZodOptional<z.ZodObject<{
        errorRate: z.ZodDefault<z.ZodNumber>;
        p95Latency: z.ZodDefault<z.ZodNumber>;
        healthCheckFailures: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        errorRate: number;
        p95Latency: number;
        healthCheckFailures: number;
    }, {
        errorRate?: number | undefined;
        p95Latency?: number | undefined;
        healthCheckFailures?: number | undefined;
    }>>;
    rollbackOnFailure: z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    enabled: boolean;
    duration: string;
    trafficPercent: number;
    rollbackOnFailure: boolean;
    thresholds?: {
        errorRate: number;
        p95Latency: number;
        healthCheckFailures: number;
    } | undefined;
}, {
    enabled?: boolean | undefined;
    duration?: string | undefined;
    thresholds?: {
        errorRate?: number | undefined;
        p95Latency?: number | undefined;
        healthCheckFailures?: number | undefined;
    } | undefined;
    trafficPercent?: number | undefined;
    rollbackOnFailure?: boolean | undefined;
}>;
export type CanaryConfig = z.infer<typeof CanaryConfigSchema>;
/**
 * Smoke test definition
 */
export declare const SmokeTestSchema: z.ZodObject<{
    name: z.ZodString;
    endpoint: z.ZodString;
    method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "DELETE"]>>;
    expectedStatus: z.ZodDefault<z.ZodNumber>;
    timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
    headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
    body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    assertions: z.ZodOptional<z.ZodArray<z.ZodObject<{
        type: z.ZodEnum<["status", "body", "header", "latency"]>;
        path: z.ZodOptional<z.ZodString>;
        operator: z.ZodEnum<["eq", "ne", "gt", "lt", "contains", "matches"]>;
        value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
    }, "strip", z.ZodTypeAny, {
        value: string | number;
        type: "status" | "body" | "header" | "latency";
        operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
        path?: string | undefined;
    }, {
        value: string | number;
        type: "status" | "body" | "header" | "latency";
        operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
        path?: string | undefined;
    }>, "many">>;
}, "strip", z.ZodTypeAny, {
    name: string;
    timeout: number;
    method: "GET" | "POST" | "PUT" | "DELETE";
    endpoint: string;
    expectedStatus: number;
    headers?: Record<string, string> | undefined;
    body?: Record<string, unknown> | undefined;
    assertions?: {
        value: string | number;
        type: "status" | "body" | "header" | "latency";
        operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
        path?: string | undefined;
    }[] | undefined;
}, {
    name: string;
    endpoint: string;
    timeout?: number | undefined;
    headers?: Record<string, string> | undefined;
    body?: Record<string, unknown> | undefined;
    method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
    expectedStatus?: number | undefined;
    assertions?: {
        value: string | number;
        type: "status" | "body" | "header" | "latency";
        operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
        path?: string | undefined;
    }[] | undefined;
}>;
export type SmokeTest = z.infer<typeof SmokeTestSchema>;
/**
 * Deployment config (YAML schema)
 */
export declare const DeployConfigSchema: z.ZodObject<{
    provider: z.ZodOptional<z.ZodEnum<["vercel", "aws", "gcp", "railway", "render", "fly"]>>;
    healthEndpoints: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    smokeTests: z.ZodOptional<z.ZodArray<z.ZodObject<{
        name: z.ZodString;
        endpoint: z.ZodString;
        method: z.ZodDefault<z.ZodEnum<["GET", "POST", "PUT", "DELETE"]>>;
        expectedStatus: z.ZodDefault<z.ZodNumber>;
        timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
        headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
        body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        assertions: z.ZodOptional<z.ZodArray<z.ZodObject<{
            type: z.ZodEnum<["status", "body", "header", "latency"]>;
            path: z.ZodOptional<z.ZodString>;
            operator: z.ZodEnum<["eq", "ne", "gt", "lt", "contains", "matches"]>;
            value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
        }, "strip", z.ZodTypeAny, {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }, {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }>, "many">>;
    }, "strip", z.ZodTypeAny, {
        name: string;
        timeout: number;
        method: "GET" | "POST" | "PUT" | "DELETE";
        endpoint: string;
        expectedStatus: number;
        headers?: Record<string, string> | undefined;
        body?: Record<string, unknown> | undefined;
        assertions?: {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }[] | undefined;
    }, {
        name: string;
        endpoint: string;
        timeout?: number | undefined;
        headers?: Record<string, string> | undefined;
        body?: Record<string, unknown> | undefined;
        method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
        expectedStatus?: number | undefined;
        assertions?: {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }[] | undefined;
    }>, "many">>;
    canary: z.ZodOptional<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        trafficPercent: z.ZodDefault<z.ZodNumber>;
        duration: z.ZodDefault<z.ZodString>;
        thresholds: z.ZodOptional<z.ZodObject<{
            errorRate: z.ZodDefault<z.ZodNumber>;
            p95Latency: z.ZodDefault<z.ZodNumber>;
            healthCheckFailures: z.ZodDefault<z.ZodNumber>;
        }, "strip", z.ZodTypeAny, {
            errorRate: number;
            p95Latency: number;
            healthCheckFailures: number;
        }, {
            errorRate?: number | undefined;
            p95Latency?: number | undefined;
            healthCheckFailures?: number | undefined;
        }>>;
        rollbackOnFailure: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        duration: string;
        trafficPercent: number;
        rollbackOnFailure: boolean;
        thresholds?: {
            errorRate: number;
            p95Latency: number;
            healthCheckFailures: number;
        } | undefined;
    }, {
        enabled?: boolean | undefined;
        duration?: string | undefined;
        thresholds?: {
            errorRate?: number | undefined;
            p95Latency?: number | undefined;
            healthCheckFailures?: number | undefined;
        } | undefined;
        trafficPercent?: number | undefined;
        rollbackOnFailure?: boolean | undefined;
    }>>;
    rollback: z.ZodOptional<z.ZodObject<{
        autoRollback: z.ZodDefault<z.ZodBoolean>;
        retainVersions: z.ZodDefault<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        autoRollback: boolean;
        retainVersions: number;
    }, {
        autoRollback?: boolean | undefined;
        retainVersions?: number | undefined;
    }>>;
    notifications: z.ZodOptional<z.ZodObject<{
        slack: z.ZodOptional<z.ZodString>;
        email: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        email?: string[] | undefined;
        slack?: string | undefined;
    }, {
        email?: string[] | undefined;
        slack?: string | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    healthEndpoints: string[];
    provider?: "vercel" | "aws" | "gcp" | "railway" | "render" | "fly" | undefined;
    canary?: {
        enabled: boolean;
        duration: string;
        trafficPercent: number;
        rollbackOnFailure: boolean;
        thresholds?: {
            errorRate: number;
            p95Latency: number;
            healthCheckFailures: number;
        } | undefined;
    } | undefined;
    smokeTests?: {
        name: string;
        timeout: number;
        method: "GET" | "POST" | "PUT" | "DELETE";
        endpoint: string;
        expectedStatus: number;
        headers?: Record<string, string> | undefined;
        body?: Record<string, unknown> | undefined;
        assertions?: {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }[] | undefined;
    }[] | undefined;
    rollback?: {
        autoRollback: boolean;
        retainVersions: number;
    } | undefined;
    notifications?: {
        email?: string[] | undefined;
        slack?: string | undefined;
    } | undefined;
}, {
    provider?: "vercel" | "aws" | "gcp" | "railway" | "render" | "fly" | undefined;
    canary?: {
        enabled?: boolean | undefined;
        duration?: string | undefined;
        thresholds?: {
            errorRate?: number | undefined;
            p95Latency?: number | undefined;
            healthCheckFailures?: number | undefined;
        } | undefined;
        trafficPercent?: number | undefined;
        rollbackOnFailure?: boolean | undefined;
    } | undefined;
    healthEndpoints?: string[] | undefined;
    smokeTests?: {
        name: string;
        endpoint: string;
        timeout?: number | undefined;
        headers?: Record<string, string> | undefined;
        body?: Record<string, unknown> | undefined;
        method?: "GET" | "POST" | "PUT" | "DELETE" | undefined;
        expectedStatus?: number | undefined;
        assertions?: {
            value: string | number;
            type: "status" | "body" | "header" | "latency";
            operator: "matches" | "eq" | "ne" | "gt" | "lt" | "contains";
            path?: string | undefined;
        }[] | undefined;
    }[] | undefined;
    rollback?: {
        autoRollback?: boolean | undefined;
        retainVersions?: number | undefined;
    } | undefined;
    notifications?: {
        email?: string[] | undefined;
        slack?: string | undefined;
    } | undefined;
}>;
export type DeployConfig = z.infer<typeof DeployConfigSchema>;
/**
 * Smoke test result
 */
export interface SmokeTestResult {
    name: string;
    endpoint: string;
    passed: boolean;
    statusCode: number;
    responseTime: number;
    assertions: Array<{
        type: string;
        expected: string | number;
        actual: string | number;
        passed: boolean;
    }>;
    error?: string;
}
/**
 * Canary analysis result
 */
export interface CanaryAnalysis {
    phase: "running" | "passed" | "failed" | "promoted" | "rolled_back";
    trafficPercent: number;
    duration: number;
    metrics: {
        errorRate: number;
        p95Latency: number;
        requestCount: number;
        healthChecksPassed: number;
        healthChecksFailed: number;
    };
    thresholdsPassed: boolean;
    recommendation: "promote" | "rollback" | "continue";
}
/**
 * Deployment verification result
 */
export interface DeployVerificationResult {
    success: boolean;
    provider: DeployProvider;
    deployment?: DeploymentInfo;
    healthChecks: HealthCheckResult[];
    smokeTests: SmokeTestResult[];
    canary?: CanaryAnalysis;
    score: {
        healthScore: number;
        smokeTestScore: number;
        canaryScore: number;
        overallScore: number;
    };
    duration: number;
    error?: string;
}
/**
 * Provider detection result
 */
export interface ProviderDetection {
    provider: DeployProvider;
    confidence: number;
    indicators: string[];
    projectId?: string;
    configPath?: string;
}
//# sourceMappingURL=types.d.ts.map