/**
 * Ticketing Integration
 *
 * Integrates with Jira, ServiceNow, and Linear for creating
 * issues and incidents from certification findings.
 *
 * @module enterprise/integrations/ticketing
 */
import type { Finding, Severity } from "../../certification/types.js";
/**
 * Supported ticketing platforms
 */
export type TicketingPlatform = "jira" | "servicenow" | "linear";
/**
 * Base ticketing configuration
 */
export interface TicketingConfig {
    /** Platform type */
    platform: TicketingPlatform;
    /** API base URL */
    baseUrl: string;
    /** API token or credentials */
    apiToken: string;
    /** Additional auth (e.g., email for Jira) */
    email?: string;
    /** Default project/board */
    defaultProject?: string;
    /** Severity to priority mapping */
    severityMapping?: Record<Severity, string>;
    /** Custom field mappings */
    customFields?: Record<string, string>;
}
/**
 * Ticket creation request
 */
export interface CreateTicketRequest {
    /** Ticket title */
    title: string;
    /** Ticket description (markdown supported) */
    description: string;
    /** Ticket type (bug, task, incident, etc.) */
    type?: string;
    /** Priority */
    priority?: string;
    /** Project/board/team ID */
    project?: string;
    /** Labels/tags */
    labels?: string[];
    /** Assignee */
    assignee?: string;
    /** Custom fields */
    customFields?: Record<string, unknown>;
    /** Source finding(s) */
    findings?: Finding[];
}
/**
 * Created ticket response
 */
export interface TicketResponse {
    /** Ticket ID */
    id: string;
    /** Ticket key/number */
    key: string;
    /** Ticket URL */
    url: string;
    /** Platform */
    platform: TicketingPlatform;
    /** Creation timestamp */
    createdAt: string;
}
/**
 * Batch ticket creation result
 */
export interface BatchTicketResult {
    /** Successfully created tickets */
    created: TicketResponse[];
    /** Failed ticket creations */
    failed: Array<{
        request: CreateTicketRequest;
        error: string;
    }>;
}
/**
 * Jira-specific configuration
 */
export interface JiraConfig extends TicketingConfig {
    platform: "jira";
    /** Jira Cloud or Server */
    isCloud: boolean;
    /** Default issue type */
    defaultIssueType?: string;
}
/**
 * Jira client
 */
export declare class JiraClient {
    private config;
    constructor(config: JiraConfig);
    /**
     * Create a Jira issue
     */
    createTicket(request: CreateTicketRequest): Promise<TicketResponse>;
    /**
     * Add comment to existing issue
     */
    addComment(issueKey: string, comment: string): Promise<void>;
    /**
     * Attach findings report to issue
     */
    attachFile(issueKey: string, filename: string, content: string): Promise<void>;
    /**
     * Search for existing issues
     */
    searchIssues(jql: string): Promise<Array<{
        key: string;
        summary: string;
    }>>;
    /**
     * Make Jira API request
     */
    private request;
    /**
     * Get authorization header
     */
    private getAuthHeader;
    /**
     * Map severity to Jira priority
     */
    private mapSeverity;
    /**
     * Format description with findings
     */
    private formatDescription;
    /**
     * Map custom fields
     */
    private mapCustomFields;
}
/**
 * ServiceNow-specific configuration
 */
export interface ServiceNowConfig extends TicketingConfig {
    platform: "servicenow";
    /** Table to create records in (default: incident) */
    table?: string;
}
/**
 * ServiceNow client
 */
export declare class ServiceNowClient {
    private config;
    constructor(config: ServiceNowConfig);
    /**
     * Create ServiceNow incident/record
     */
    createTicket(request: CreateTicketRequest): Promise<TicketResponse>;
    /**
     * Add work note to incident
     */
    addWorkNote(sysId: string, note: string): Promise<void>;
    /**
     * Update incident state
     */
    updateState(sysId: string, state: number): Promise<void>;
    /**
     * Make ServiceNow API request
     */
    private request;
    /**
     * Map severity to ServiceNow priority
     */
    private mapSeverity;
    /**
     * Format description
     */
    private formatDescription;
}
/**
 * Linear-specific configuration
 */
export interface LinearConfig extends TicketingConfig {
    platform: "linear";
    /** Team ID */
    teamId?: string;
}
/**
 * Linear client
 */
export declare class LinearClient {
    private config;
    constructor(config: LinearConfig);
    /**
     * Create Linear issue
     */
    createTicket(request: CreateTicketRequest): Promise<TicketResponse>;
    /**
     * Add comment to issue
     */
    addComment(issueId: string, comment: string): Promise<void>;
    /**
     * Get team ID by name
     */
    getTeamId(teamName: string): Promise<string | null>;
    /**
     * Make GraphQL request to Linear API
     */
    private graphql;
    /**
     * Map severity to Linear priority
     */
    private mapSeverityToPriority;
    /**
     * Format description with findings
     */
    private formatDescription;
}
/**
 * Unified ticketing client
 */
export declare class TicketingClient {
    private client;
    private platform;
    constructor(config: TicketingConfig);
    /**
     * Create a ticket
     */
    createTicket(request: CreateTicketRequest): Promise<TicketResponse>;
    /**
     * Create tickets for findings
     */
    createTicketsForFindings(findings: Finding[], options?: {
        project?: string;
        groupByCategory?: boolean;
        minSeverity?: Severity;
    }): Promise<BatchTicketResult>;
    /**
     * Get platform name
     */
    getPlatform(): TicketingPlatform;
}
/**
 * Create ticketing client
 */
export declare function createTicketingClient(config: TicketingConfig): TicketingClient;
/**
 * Create Jira client
 */
export declare function createJiraClient(config: Omit<JiraConfig, "platform">): JiraClient;
/**
 * Create ServiceNow client
 */
export declare function createServiceNowClient(config: Omit<ServiceNowConfig, "platform">): ServiceNowClient;
/**
 * Create Linear client
 */
export declare function createLinearClient(config: Omit<LinearConfig, "platform">): LinearClient;
//# sourceMappingURL=ticketing.d.ts.map