import { z } from "zod";
import type { GdsError } from "./errors.ts";
export interface Logger {
    debug(msg: string, fields?: Record<string, unknown>): void;
    info(msg: string, fields?: Record<string, unknown>): void;
    warn(msg: string, fields?: Record<string, unknown>): void;
    error(msg: string, fields?: Record<string, unknown>): void;
}
export declare const AuthMethodSchema: z.ZodEnum<{
    "api-key": "api-key";
    oauth2: "oauth2";
    certificate: "certificate";
    basic: "basic";
}>;
export type AuthMethod = z.infer<typeof AuthMethodSchema>;
export declare const AuthConfigSchema: z.ZodObject<{
    method: z.ZodDefault<z.ZodEnum<{
        "api-key": "api-key";
        oauth2: "oauth2";
        certificate: "certificate";
        basic: "basic";
    }>>;
    clientId: z.ZodOptional<z.ZodString>;
    clientSecret: z.ZodOptional<z.ZodString>;
    tokenUrl: z.ZodOptional<z.ZodString>;
    certPath: z.ZodOptional<z.ZodString>;
    accessToken: z.ZodOptional<z.ZodString>;
    tokenExpiry: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type AuthConfig = z.infer<typeof AuthConfigSchema>;
export declare const GdsRequestSchema: z.ZodObject<{
    requestId: z.ZodString;
    operation: z.ZodEnum<{
        search: "search";
        price: "price";
        book: "book";
        cancel: "cancel";
        retrieve: "retrieve";
        seatmap: "seatmap";
        baggage: "baggage";
    }>;
    carrier: z.ZodString;
    timestamp: z.ZodString;
    payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
}, z.core.$strip>;
export type GdsRequest = z.infer<typeof GdsRequestSchema>;
export declare const GdsResponseSchema: z.ZodObject<{
    requestId: z.ZodString;
    provider: z.ZodString;
    data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
    warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
    responseTimeMs: z.ZodNumber;
    fromCache: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
export type GdsResponse = z.infer<typeof GdsResponseSchema>;
/**
 * Interface that every GDS adapter must implement.
 * Each adapter wraps a specific GDS provider (Amadeus, Sabre, etc.)
 * and translates our unified API into provider-specific calls.
 */
export interface GdsAdapter {
    /** Provider name (e.g. "amadeus", "sabre"). */
    readonly providerName: string;
    /** List of IATA carrier codes this adapter supports. */
    readonly supportedCarriers: readonly string[];
    /** Authenticate with the provider. */
    authenticate(): Promise<void>;
    /** Check if the adapter is currently authenticated. */
    isAuthenticated(): Promise<boolean>;
    /** Execute a GDS request. */
    execute(request: GdsRequest): Promise<GdsResponse>;
    /** Check if this adapter supports a given carrier. */
    supportsCarrier(carrier: string): boolean;
    /** Get adapter health status. */
    health(): Promise<AdapterHealth>;
    /** Optional logger for structured logging. */
    logger?: Logger;
}
export interface AdapterHealth {
    provider: string;
    connected: boolean;
    latencyMs: number;
    circuitState: string;
    rateLimitRemaining: number;
    lastError?: GdsError;
}
export declare const RetryConfigSchema: z.ZodObject<{
    maxRetries: z.ZodNumber;
    baseDelayMs: z.ZodNumber;
    maxDelayMs: z.ZodNumber;
    backoffMultiplier: z.ZodNumber;
}, z.core.$strip>;
export type RetryConfig = z.infer<typeof RetryConfigSchema>;
/**
 * Execute a function with retry and exponential backoff.
 * Only retries on retryable errors.
 */
export declare function withRetry<T>(fn: () => Promise<T>, shouldRetry: (error: unknown) => boolean, config?: Partial<RetryConfig>): Promise<T>;
//# sourceMappingURL=adapter.d.ts.map