@dtu-olp-2024/kafka-nocobase
Version:
A NocoBase plugin for Apache Kafka integration, supporting message publishing, topic management, and event-driven workflows. Built for the DTU GreenHope project.
18 lines (15 loc) • 481 B
JavaScript
const Encoder = require('../../../encoder')
const { Metadata: apiKey } = require('../../apiKeys')
/**
* Metadata Request (Version: 4) => [topics] allow_auto_topic_creation
* topics => STRING
* allow_auto_topic_creation => BOOLEAN
*/
module.exports = ({ topics, allowAutoTopicCreation = true }) => ({
apiKey,
apiVersion: 4,
apiName: 'Metadata',
encode: async () => {
return new Encoder().writeNullableArray(topics).writeBoolean(allowAutoTopicCreation)
},
})