import { KafkaJS } from "@confluentinc/kafka-javascript"; import type { GroupDescription, LibrdKafkaError } from "@confluentinc/kafka-javascript/types/rdkafka.js"; /** * Single source of truth for the user-facing "group not found" message — * surfaced by both `describe-consumer-group` and `get-consumer-group-lag` * across every broker shape that signals an unknown group ID. */ export declare function notFoundGroupMessage(groupId: string): string; /** * Narrow an unknown rejection (from `admin.describeGroups` or * `admin.fetchOffsets`) to a librdkafka `ERR_GROUP_ID_NOT_FOUND` error — * the most direct of the three not-found shapes the broker can take. */ export declare function isGroupIdNotFoundError(err: unknown): boolean; /** * Tagged-union outcome of {@link describeGroupOutcome}. Collapses the * four shapes the broker can use to report a single-group describe into * three arms a caller can switch on: * * - `notFound`: the group is absent from the cluster, regardless of * which of the four broker shapes surfaced that fact (top-level * `ERR_GROUP_ID_NOT_FOUND` rejection; empty `groups` array; per-group * `.error` with that code; the dead-tombstone fingerprint Confluent * Cloud actually takes for unknown groups). * - `error`: per-group `.error` carrying some non-not-found librdkafka * code. Callers decide whether to surface as a friendly tool-level * error (`describe-consumer-group`) or propagate via throw * (`get-consumer-group-lag`'s existence probe). * - `ok`: a real {@link GroupDescription} the caller can inspect. */ export type DescribeGroupOutcome = { kind: "notFound"; } | { kind: "error"; error: LibrdKafkaError; } | { kind: "ok"; group: GroupDescription; }; /** * Single-group describe with every not-found surface collapsed into one * tagged union. Shared between `describe-consumer-group` (which surfaces * the not-found and error arms as friendly tool-level responses) and * `get-consumer-group-lag`'s existence probe (which maps not-found to * its friendly message and lets the error arm propagate via throw); the * decoding logic stays in one place so the broker's four not-found * shapes can't drift apart between the two callers. * * Non-not-found top-level rejections (auth failures, broker * unavailability, etc.) propagate via throw — they're neither a * not-found signal nor a per-group error. */ export declare function describeGroupOutcome(admin: KafkaJS.Admin, groupId: string): Promise; //# sourceMappingURL=consumer-group-helpers.d.ts.map