/** * Turns Atlassian ids into names. * * Every responder the JSM Operations API returns — on-call participants, alert * responders, schedule owners — is a bare id (`712020:9ae5385e-…`). Nothing in * the Operations API resolves one to a person, so answering "who do I page?" * with something a human can act on means a second call to the Jira platform * API for users, and to /v1/teams for teams. * * The hard rule in this module: **a failed lookup never fails the answer.** * Knowing that an unnamed account id is on-call is worth far more than a clean * error, so every path here degrades to "ids, plus a line saying why they are * still ids" rather than throwing. */ import type { JsmClient } from "./client.js"; import type { ResolvedIdentity } from "../types.js"; /** What a caller needs to render a resolution attempt honestly. */ export interface Directory { /** Resolved entries, keyed by id. Ids that could not be resolved are absent. */ names: Map; /** * Set when a lookup failed. Rendered as a single line beneath the answer so * the reader knows the ids are unresolved because of a config gap, not * because the responder has no name. */ note?: string; } /** Exposed for tests: a cached name from a previous case must not leak into the next. */ export declare function clearDirectoryCache(): void; /** * Resolves Jira account ids to display names via /rest/api/3/user/bulk. * * `maxResults` is sent explicitly because the endpoint defaults it to 10: a * batch of 50 ids would come back with 10 names and no indication that the * other 40 were dropped. */ export declare function resolveUsers(client: JsmClient, ids: string[]): Promise; /** * Resolves team ids to team names via /v1/teams. * * Sits behind read:ops-config, which any caller reaching this point already * holds, so unlike the user lookup this needs no extra grant. */ export declare function resolveTeams(client: JsmClient): Promise>; /** * Resolves a mixed list of responder ids — users, teams, escalations — in as * few calls as possible. * * `types` says what each id is when the API told us (participants carry a * type; a flat user list does not). Ids of unknown type are tried as users, * which is what a flat on-call list always contains. */ export declare function resolveIdentities(client: JsmClient, entries: Array<{ id: string; type?: string; }>): Promise; /** * Renders one responder for a human: a name where we have one, and always the * id, because the id is what the JSM UI and every other tool here take. */ export declare function renderIdentity(identity: ResolvedIdentity): string; //# sourceMappingURL=directory.d.ts.map