import type { JiraTransition } from "../../domain/write.js"; import type { CredentialPort } from "../../ports/credentials.port.js"; import type { JiraWritePort } from "../../ports/jira-write.port.js"; /** * Jira Cloud REST v3, mutating half. * * Every request here sets `retry: false`. The read adapter's retry loop is * correct for reads and dangerous here: a request that times out after Jira * accepted it is indistinguishable from one Jira never saw, and resending it * duplicates the change. The application layer resolves that by reading the * issue back - see applyWritePlan. * * This adapter also never reads its own work. Confirmation is a direct issue * GET through the read port, which keeps "what JAM did" and "what Jira shows" * two separate observations rather than one hopeful one. */ export declare class JiraCloudWriteAdapter implements JiraWritePort { private readonly client; constructor(credentials: CredentialPort, fetchImpl?: typeof fetch); /** * Create one issue, once. * * `retry: false` matters more here than anywhere else behind this port. A * retried update converges; a retried create leaves two issues, and the * second one has a different key nobody is holding. An ambiguous failure is * handed to the application layer as JAM_WRITE_UNCERTAIN and resolved by * looking, never by sending it again. */ createIssue(fields: Record): Promise<{ id: string; key: string; }>; updateIssue(key: string, fields: Record): Promise; /** * Add a comment, converting plain text to ADF here rather than accepting ADF. * * Jira's comment body is a document tree, and letting an agent supply one * would mean accepting arbitrary structure - panels, mentions, embedded * content - through a field that reads like "text". The conversion is narrow * on purpose: paragraphs, and nothing else. */ addComment(key: string, body: string): Promise<{ id: string; }>; getTransitions(key: string): Promise; /** * `PUT /rest/api/3/issue/{key}/assignee` with an accountId. * * The dedicated assignment endpoint rather than a field update: assignment * has its own permission and its own Jira semantics, and routing it through * the generic field PUT would put it behind the field whitelist, where it * does not belong. */ assignIssue(key: string, accountId: string): Promise; transitionIssue(key: string, transitionId: string): Promise; }