-
Notifications
You must be signed in to change notification settings - Fork 23
Open
@MMM-J
Description
Environment Information
- OS: Debian
- Node Version: v22.16.0
- confluent-kafka-javascript version: 1.4.1
Steps to Reproduce
Topic metadata is not wrapped in an outer holder-object, but the typescript types say they are.
Using the promisified api:
import { KafkaJS } from '@confluentinc/kafka-javascript';
const { Kafka, ErrorCodes, CompressionTypes } = KafkaJS;
const admin = new Kafka().admin({
'bootstrap.servers': `localhost:9092`
});
await admin.connect();
const topicsMetadata = await admin.fetchTopicMetadata({
topics: ['test-topic']
});
console.dir(topicsMetadata, { depth: null });
The output is:
[
{
name: 'test-topic',
...
}
]
But the typescript signature is:
fetchTopicMetadata(options?: {
topics?: string[],
includeAuthorizedOperations?: boolean,
timeout?: number
}): Promise<{ topics: Array<ITopicMetadata> }>
That outer { topics: ... } is incorrect.