Skip to content

Commit

Permalink
Add missing event_cb property to type defs #804
Browse files Browse the repository at this point in the history
  • Loading branch information
iradul committed Jun 11, 2020
1 parent de44bdb commit c8d60f5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ci/librdkafka-defs-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,27 @@ function generateInterface(interfaceDef, configItems) {
return `export interface ` + interfaceDef + ' {\n' + fields + '\n}';
}

function addSpecialGlobalProps(globalProps) {
globalProps.push({
"property": "event_cb",
"consumerOrProducer": "*",
"range": "",
"defaultValue": "true",
"importance": "low",
"description": "Enables or disables `event.*` emitting.",
"rawType": "boolean",
"type": "boolean"
});
}

function generateConfigDTS(file) {
const configuration = readLibRDKafkaFile(file);
const [globalStr, topicStr] = configuration.split('Topic configuration properties');

const [globalProps, topicProps] = [extractConfigItems(globalStr), extractConfigItems(topicStr)];

addSpecialGlobalProps(globalProps);

const [globalSharedProps, producerGlobalProps, consumerGlobalProps] = [
globalProps.filter(i => i.consumerOrProducer === '*'),
globalProps.filter(i => i.consumerOrProducer === 'P'),
Expand Down
7 changes: 7 additions & 0 deletions config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,13 @@ export interface GlobalConfig {
* A rack identifier for this client. This can be any string value which indicates where this client is physically located. It corresponds with the broker config `broker.rack`.
*/
"client.rack"?: string;

/**
* Enables or disables `event.*` emitting.
*
* @default true
*/
"event_cb"?: boolean;
}

export interface ProducerGlobalConfig extends GlobalConfig {
Expand Down

0 comments on commit c8d60f5

Please sign in to comment.