Comparing version
{ | ||
"name": "kafkajs", | ||
"version": "1.13.0-beta.53", | ||
"version": "1.13.0-beta.54", | ||
"description": "A modern Apache Kafka client for node.js", | ||
@@ -85,5 +85,5 @@ "author": "Tulio Ornelas <ornelas.tulio@gmail.com>", | ||
"kafkajs": { | ||
"sha": "46d5f54d58f7a3c8944027b058d4d2462eeb413f", | ||
"compare": "https://github.com/tulios/kafkajs/compare/v1.12.0...46d5f54d58f7a3c8944027b058d4d2462eeb413f" | ||
"sha": "9a6cc1bff0e6a79dc5e79d835d3828018947ffc5", | ||
"compare": "https://github.com/tulios/kafkajs/compare/v1.12.0...9a6cc1bff0e6a79dc5e79d835d3828018947ffc5" | ||
} | ||
} |
@@ -17,2 +17,3 @@ const Long = require('long') | ||
* | ||
* @type {import("../../types").Broker} | ||
* @param {Connection} connection | ||
@@ -184,5 +185,5 @@ * @param {Object} logger | ||
* @public | ||
* @type {import("../../types").Broker['metadata']} | ||
* @param {Array} [topics=[]] An array of topics to fetch metadata for. | ||
* If no topics are specified fetch metadata for all topics | ||
* @returns {Promise} | ||
*/ | ||
@@ -189,0 +190,0 @@ async metadata(topics = []) { |
@@ -26,2 +26,5 @@ const Long = require('long') | ||
/** | ||
* @returns {import("../../types").Consumer} | ||
*/ | ||
module.exports = ({ | ||
@@ -107,5 +110,3 @@ cluster, | ||
/** | ||
* @returns {Promise} | ||
*/ | ||
/** @type {import("../../types").Consumer["connect"]} */ | ||
const connect = async () => { | ||
@@ -116,5 +117,3 @@ await cluster.connect() | ||
/** | ||
* @return {Promise} | ||
*/ | ||
/** @type {import("../../types").Consumer["disconnect"]} */ | ||
const disconnect = async () => { | ||
@@ -129,5 +128,3 @@ try { | ||
/** | ||
* @return {Promise} | ||
*/ | ||
/** @type {import("../../types").Consumer["stop"]} */ | ||
const stop = async () => { | ||
@@ -146,7 +143,3 @@ try { | ||
/** | ||
* @param {string | RegExp} topic | ||
* @param {boolean} [fromBeginning=false] | ||
* @return {Promise} | ||
*/ | ||
/** @type {import("../../types").Consumer["subscribe"]} */ | ||
const subscribe = async ({ topic, fromBeginning = false }) => { | ||
@@ -194,13 +187,3 @@ if (consumerGroup) { | ||
/** | ||
* @param {boolean} [autoCommit=true] | ||
* @param {number} [autoCommitInterval=null] | ||
* @param {number} [autoCommitThreshold=null] | ||
* @param {boolean} [eachBatchAutoResolve=true] Automatically resolves the last offset of the batch when the | ||
* the callback succeeds | ||
* @param {number} [partitionsConsumedConcurrently=1] | ||
* @param {Function} [eachBatch=null] | ||
* @param {Function} [eachMessage=null] | ||
* @return {Promise} | ||
*/ | ||
/** @type {import("../../types").Consumer["run"]} */ | ||
const run = async ({ | ||
@@ -295,7 +278,3 @@ autoCommit = true, | ||
/** | ||
* @param {string} eventName | ||
* @param {AsyncFunction} listener | ||
* @return {Function} removeListener | ||
*/ | ||
/** @type {import("../../types").Consumer["on"]} */ | ||
const on = (eventName, listener) => { | ||
@@ -318,3 +297,4 @@ if (!eventNames.includes(eventName)) { | ||
/** | ||
* @param {Array<TopicPartitionOffsetAndMetadata>} topicPartitions | ||
* @type {import("../../types").Consumer["commitOffsets"]} | ||
* @param topicPartitions | ||
* Example: [{ topic: 'topic-name', partition: 0, offset: '1', metadata: 'event-id-3' }] | ||
@@ -379,7 +359,3 @@ */ | ||
/** | ||
* @param {string} topic | ||
* @param {number} partition | ||
* @param {string} offset | ||
*/ | ||
/** @type {import("../../types").Consumer["seek"]} */ | ||
const seek = ({ topic, partition, offset }) => { | ||
@@ -416,19 +392,3 @@ if (!topic) { | ||
/** | ||
* @returns Promise<GroupDescription> | ||
* | ||
* @typedef {Object} GroupDescription | ||
* @property {string} groupId | ||
* @property {Array<MemberDescription>} members | ||
* @property {string} protocol | ||
* @property {string} protocolType | ||
* @property {string} state | ||
* | ||
* @typedef {Object} MemberDescription | ||
* @property {string} clientHost | ||
* @property {string} clientId | ||
* @property {string} memberId | ||
* @property {Buffer} memberAssignment | ||
* @property {Buffer} memberMetadata | ||
*/ | ||
/** @type {import("../../types").Consumer["describeGroup"]} */ | ||
const describeGroup = async () => { | ||
@@ -444,8 +404,5 @@ const coordinator = await cluster.findGroupCoordinator({ groupId }) | ||
/** | ||
* @param {Array<TopicPartitions>} topicPartitions | ||
* @type {import("../../types").Consumer["pause"]} | ||
* @param topicPartitions | ||
* Example: [{ topic: 'topic-name', partitions: [1, 2] }] | ||
* | ||
* @typedef {Object} TopicPartitions | ||
* @property {string} topic | ||
* @property {Array<{number}>} [partitions] | ||
*/ | ||
@@ -480,3 +437,3 @@ const pause = (topicPartitions = []) => { | ||
* | ||
* @returns {Array<TopicPartitions>} | ||
* @type {import("../../types").Consumer["paused"]} | ||
*/ | ||
@@ -492,8 +449,5 @@ const paused = () => { | ||
/** | ||
* @param {Array<TopicPartitions>} topicPartitions | ||
* @type {import("../../types").Consumer["resume"]} | ||
* @param topicPartitions | ||
* Example: [{ topic: 'topic-name', partitions: [1, 2] }] | ||
* | ||
* @typedef {Object} TopicPartitions | ||
* @property {string} topic | ||
* @property {Array<{number}>} [partitions] | ||
*/ | ||
@@ -500,0 +454,0 @@ const resume = (topicPartitions = []) => { |
@@ -77,3 +77,3 @@ const createState = topic => ({ | ||
/** | ||
* @returns {Array<TopicPartitions>} topicPartitions | ||
* @returns {Array<import("../../types").TopicPartitions>} topicPartitions | ||
* Example: [{ topic: 'topic-name', partitions: [1, 2] }] | ||
@@ -89,3 +89,3 @@ */ | ||
/** | ||
* @returns {Array<TopicPartitions>} topicPartitions | ||
* @returns {Array<import("../../types").TopicPartitions>} topicPartitions | ||
* Example: [{ topic: 'topic-name', partitions: [1, 2] }] | ||
@@ -101,3 +101,3 @@ */ | ||
/** | ||
* @returns {Array<TopicPartitions>} topicPartitions | ||
* @returns {Array<import("../../types").TopicPartitions>} topicPartitions | ||
* Example: [{ topic: 'topic-name', partitions: [1, 2] }] | ||
@@ -104,0 +104,0 @@ */ |
@@ -1,1 +0,12 @@ | ||
module.exports = arrays => [].concat.apply([], arrays) | ||
/** | ||
* Flatten the given arrays into a new array | ||
* | ||
* @param {Array<Array<T>>} arrays | ||
* @returns {Array<T>} | ||
* @template T | ||
*/ | ||
function flatten(arrays) { | ||
return [].concat.apply([], arrays) | ||
} | ||
module.exports = flatten |
529234
-0.14%15638
-0.22%