/** * @fileoverview Abstract {@link BaseClientManager} that owns every Confluent Cloud * REST client and the Schema Registry SDK client. Concrete subclasses live in * sibling files ({@link DirectClientManager} for api-key auth + native Kafka, * plus the OAuth variant introduced in the OAuth wiring ticket). */ import type { KafkaJS } from "@confluentinc/kafka-javascript"; import { SchemaRegistryClient } from "@confluentinc/schemaregistry"; import { type ConfluentCloudRestClientManager, type ConfluentRestClient, type SchemaRegistryClientHandler } from "../confluent/client-manager.js"; import { ConfluentAuth, ConfluentEndpoints } from "../confluent/middleware.js"; export interface BaseClientManagerConfig { endpoints: ConfluentEndpoints; auth: { cloud: ConfluentAuth; flink: ConfluentAuth; tableflow: ConfluentAuth; schemaRegistry: ConfluentAuth; kafka: ConfluentAuth; telemetry: ConfluentAuth; }; } /** * Holds every Confluent Cloud REST client (cloud, tableflow, flink, * schema-registry REST, kafka REST, telemetry) and the Schema Registry SDK * client. Native Kafka admin/producer/consumer clients are declared abstract * here so subclasses can supply the implementation that fits their auth model: * api-key + SASL/PLAIN in {@link DirectClientManager}, or DPAT + * SASL/OAUTHBEARER in OAuthClientManager. * * The `getSchemaRegistrySdkClient(envId?)` accessor has a default * implementation that delegates to the no-arg `getSchemaRegistryClient()`. * That covers direct connections (the arg is ignored). OAuth subclasses * override it to auto-resolve the SR cluster from the supplied environment * id (single SR per environment is the CCloud invariant) and build a * bearer-authenticated SDK client per call. */ export declare abstract class BaseClientManager implements ConfluentCloudRestClientManager, SchemaRegistryClientHandler { private confluentCloudBaseUrl; private confluentCloudFlinkBaseUrl; private confluentCloudSchemaRegistryBaseUrl; private confluentCloudKafkaRestBaseUrl; private confluentCloudTelemetryBaseUrl; private readonly confluentCloudFlinkRestClient; private readonly confluentCloudRestClient; private readonly confluentCloudTableflowRestClient; private readonly confluentCloudSchemaRegistryRestClient; private readonly confluentCloudKafkaRestClient; private readonly confluentCloudTelemetryRestClient; private readonly schemaRegistryClient; constructor(config: BaseClientManagerConfig); /** @inheritdoc */ getConfluentCloudFlinkRestClient(): ConfluentRestClient; /** @inheritdoc */ getConfluentCloudRestClient(): ConfluentRestClient; /** @inheritdoc */ getConfluentCloudTableflowRestClient(): ConfluentRestClient; /** @inheritdoc */ getConfluentCloudSchemaRegistryRestClient(): ConfluentRestClient; /** @inheritdoc */ getSchemaRegistryRestClient(_envId?: string): Promise; /** @inheritdoc */ getConfluentCloudKafkaRestClient(_clusterId?: string, _envId?: string): Promise; /** @inheritdoc */ getConfluentCloudTelemetryRestClient(): ConfluentRestClient; /** @inheritdoc */ getSchemaRegistryClient(): SchemaRegistryClient; /** * Environment-aware Schema Registry SDK client accessor. Under direct, the * arg is ignored and the existing single-instance Lazy is returned. Under * OAuth, `envId` (`env-...`) is required; the SR cluster (`lsrc-...`) is * auto-resolved from the environment (single SR per environment is the * CCloud invariant). The SR client itself is built per-call (no cache) * because the DPAT is captured in the SDK's axios headers at construction * time; endpoint resolution happens fresh on every call too. */ getSchemaRegistrySdkClient(_envId?: string): Promise; /** * Cluster-aware Kafka admin client. Under direct, args are ignored and the * manager-owned `AsyncLazy` singleton admin is returned (manager controls * its lifetime). Under OAuth, args are required and a fresh admin is built * per call — the caller owns the lifetime and must dispose via * `disposeIfOAuth(runtime, connId, admin)` in a `try { ... } finally { ... }` * block (helper at `@src/confluent/tools/cluster-arg-resolvers.js`). */ abstract getKafkaAdminClient(clusterId?: string, envId?: string): Promise; /** * Cluster-aware Kafka producer. Same direct/OAuth lifecycle asymmetry as * {@link getKafkaAdminClient}. */ abstract getKafkaProducer(clusterId?: string, envId?: string): Promise; /** * Build a fresh Kafka consumer (per-call on both direct and OAuth — group * membership has its own server-side lifecycle that doesn't compose with * cached clients). The returned consumer is unconnected; the caller must * call `connect()` and `disconnect()` (typically in a `try/finally`). */ abstract buildKafkaConsumer(clusterId?: string, envId?: string, groupId?: string): Promise; abstract disconnect(): Promise; } //# sourceMappingURL=base-client-manager.d.ts.map