Comparing version 1.17.0-beta.2 to 1.17.0-beta.3
{ | ||
"name": "kafkajs", | ||
"version": "1.17.0-beta.2", | ||
"version": "1.17.0-beta.3", | ||
"description": "A modern Apache Kafka client for node.js", | ||
@@ -83,5 +83,5 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>", | ||
"kafkajs": { | ||
"sha": "33db95cecf8c2e6adea21df1360d06230c39e1f6", | ||
"compare": "https://github.com/tulios/kafkajs/compare/v1.16.0...33db95cecf8c2e6adea21df1360d06230c39e1f6" | ||
"sha": "a93151d77b97d62d75f67dbf67469427bad4106e", | ||
"compare": "https://github.com/tulios/kafkajs/compare/v1.16.0...a93151d77b97d62d75f67dbf67469427bad4106e" | ||
} | ||
} |
@@ -135,2 +135,33 @@ const createRetry = require('../retry') | ||
for (const { topic, configEntries } of topics) { | ||
if (configEntries == null) { | ||
continue | ||
} | ||
if (!Array.isArray(configEntries)) { | ||
throw new KafkaJSNonRetriableError( | ||
`Invalid configEntries for topic "${topic}", must be an array` | ||
) | ||
} | ||
configEntries.forEach((entry, index) => { | ||
if (typeof entry !== 'object' || entry == null) { | ||
throw new KafkaJSNonRetriableError( | ||
`Invalid configEntries for topic "${topic}". Entry ${index} must be an object` | ||
) | ||
} | ||
for (const requiredProperty of ['name', 'value']) { | ||
if ( | ||
!Object.prototype.hasOwnProperty.call(entry, requiredProperty) || | ||
typeof entry[requiredProperty] !== 'string' | ||
) { | ||
throw new KafkaJSNonRetriableError( | ||
`Invalid configEntries for topic "${topic}". Entry ${index} must have a valid "${requiredProperty}" property` | ||
) | ||
} | ||
} | ||
}) | ||
} | ||
const retrier = createRetry(retry) | ||
@@ -137,0 +168,0 @@ |
@@ -192,3 +192,3 @@ /// <reference types="node" /> | ||
replicaAssignment?: object[] | ||
configEntries?: object[] | ||
configEntries?: IResourceConfigEntry[] | ||
} | ||
@@ -312,6 +312,11 @@ | ||
export interface IResourceConfigEntry { | ||
name: string | ||
value: string | ||
} | ||
export interface IResourceConfig { | ||
type: ResourceTypes | ConfigResourceTypes | ||
name: string | ||
configEntries: { name: string; value: string }[] | ||
configEntries: IResourceConfigEntry[] | ||
} | ||
@@ -318,0 +323,0 @@ |
703594
20575