import { JamError } from "../../domain/errors.js"; import type { CredentialPort } from "../../ports/credentials.port.js"; export type JiraRequest = { path: string; method?: "GET" | "POST" | "PUT"; query?: Record; body?: unknown; /** * Whether a transient failure may be retried. * * Reads say yes and get the retry loop below. Writes say no: a request that * timed out may already have been applied, so resending it is how one * comment becomes two. The write path resolves that ambiguity by reading the * issue back, never by trying again. */ retry?: boolean; }; export type JiraResponse = { data: T; /** Size of the raw response body, for telemetry and budget accounting. */ bytes: number; }; /** * Thin HTTP boundary around Jira Cloud REST v3. * * Two hard rules live here: * 1. The Authorization header is built at request time and never stored, * logged, or attached to a thrown error. * 2. Every non-2xx response becomes a JamError with a normalized code, so no * vendor error shape escapes the adapter. */ export declare class JiraClient { private readonly credentials; private readonly fetchImpl; private cached?; constructor(credentials: CredentialPort, fetchImpl?: typeof fetch); get baseUrl(): string; private creds; request(req: JiraRequest): Promise>; } export declare function mapStatus(status: number, body: string, path: string): JamError;