/** * Jira backlog provider implementation. * * Provides access to Jira Cloud as a ticket/backlog system. * Uses Jira REST API v3 for all operations. * * @example * ```typescript * import { JiraProvider } from './jira.js'; * * const provider = new JiraProvider(config); * * // Check authentication * const auth = await provider.checkAuth(); * if (!auth.ok) throw new Error(auth.message); * * // Fetch a ticket * const ticket = await provider.getTicket('PROJ-123'); * ``` */ import type { TicketRef } from '../types/ticket.js'; import type { BacklogProvider, BacklogProviderName, Ticket, TicketCreateParams, TicketUpdates, AuthCheckResult } from './types.js'; import type { SpecKitConfig } from '../config.js'; /** * Jira backlog provider. * * Implements the BacklogProvider interface for Jira Cloud. * Requires JIRA_EMAIL and JIRA_API_TOKEN environment variables for authentication. */ export declare class JiraProvider implements BacklogProvider { readonly name: BacklogProviderName; private readonly config; private readonly baseUrl; private readonly projectKey; private readonly auth; /** * Create a new Jira provider. * * @param config - SpecKit configuration */ constructor(config: SpecKitConfig); /** * Make an authenticated request to the Jira API. * * @param endpoint - API endpoint (without base URL) * @param options - Fetch options * @returns Response data */ private request; /** * Handle Jira API errors and convert to provider errors. */ private handleApiError; /** * Map a Jira issue to normalized Ticket format. */ private mapJiraIssueToTicket; /** * Check if authentication is valid. * * @returns Authentication check result */ checkAuth(): Promise; /** * Parse user input to a TicketRef. * * Handles various Jira input formats: * - PROJ-123 * - https://company.atlassian.net/browse/PROJ-123 * * @param input - User-provided reference string * @returns Parsed TicketRef or null if invalid */ parseRef(input: string): TicketRef | null; /** * Generate the web URL for a ticket. * * @param ref - Jira reference (e.g., PROJ-123) * @returns Full URL to view the issue in Jira */ getTicketUrl(ref: string): string; /** * Fetch a ticket by reference string. * * @param ref - Jira reference (PROJ-123 or full URL) * @returns Normalized Ticket object * @throws NotFoundError if issue doesn't exist * @throws AuthError if authentication fails */ getTicket(ref: string): Promise; /** * Create a new ticket. * * @param params - Ticket creation parameters * @returns Created Ticket object * @throws AuthError if authentication fails */ createTicket(params: TicketCreateParams): Promise; /** * Update an existing ticket. * * @param ref - Jira reference * @param updates - Fields to update * @returns Updated Ticket object * @throws NotFoundError if issue doesn't exist * @throws AuthError if authentication fails */ updateTicket(ref: string, updates: TicketUpdates): Promise; /** * Replace all labels on a ticket. * * @param ref - Jira reference * @param labels - Labels to set */ setLabels(ref: string, labels: string[]): Promise; /** * Get current labels on a ticket. * * @param ref - Jira reference * @returns Array of label names */ getLabels(ref: string): Promise; } //# sourceMappingURL=jira.d.ts.map