kafka-console 1.3.51 → 1.3.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function config(opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { resource, resourceName: name, brokers, logLevel, ssl } = _a, rest = __rest(_a, ["resource", "resourceName", "brokers", "logLevel", "ssl"]);
24
+ function config(opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { resource, resourceName: name, brokers, logLevel, ssl } = _b, rest = __rest(_b, ["resource", "resourceName", "brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const admin = yield (0, kafka_1.createAdmin)(client);
@@ -53,10 +53,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  const Fs = __importStar(require("fs"));
54
54
  const kafka_1 = require("../utils/kafka");
55
55
  const formatters_1 = require("../utils/formatters");
56
- function consume(topic, opts, { parent }) {
57
- var _a, e_1, _b, _c;
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const _d = Object.assign(Object.assign({}, parent.opts()), opts), { group, format, fromBeginning, count, skip, filename, brokers, logLevel, timeout, ssl, pretty } = _d, saslOptions = __rest(_d, ["group", "format", "fromBeginning", "count", "skip", "filename", "brokers", "logLevel", "timeout", "ssl", "pretty"]);
56
+ function consume(topic_1, opts_1, _a) {
57
+ return __awaiter(this, arguments, void 0, function* (topic, opts, { parent }) {
58
+ var _b, e_1, _c, _d;
59
+ const _e = Object.assign(Object.assign({}, parent.opts()), opts), { group, format, fromBeginning, count, skip, filename, brokers, logLevel, timeout, ssl, pretty } = _e, saslOptions = __rest(_e, ["group", "format", "fromBeginning", "count", "skip", "filename", "brokers", "logLevel", "timeout", "ssl", "pretty"]);
60
60
  const sasl = (0, kafka_1.getSASL)(saslOptions);
61
61
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
62
62
  const output = filename ? Fs.createWriteStream(filename) : process.stdout;
@@ -69,10 +69,10 @@ function consume(topic, opts, { parent }) {
69
69
  });
70
70
  const formatter = (0, formatters_1.getFormatter)(format);
71
71
  try {
72
- for (var _e = true, consumer_1 = __asyncValues(consumer), consumer_1_1; consumer_1_1 = yield consumer_1.next(), _a = consumer_1_1.done, !_a; _e = true) {
73
- _c = consumer_1_1.value;
74
- _e = false;
75
- let { message: { headers, key, value } } = _c;
72
+ for (var _f = true, consumer_1 = __asyncValues(consumer), consumer_1_1; consumer_1_1 = yield consumer_1.next(), _b = consumer_1_1.done, !_b; _f = true) {
73
+ _d = consumer_1_1.value;
74
+ _f = false;
75
+ let { message: { headers, key, value } } = _d;
76
76
  const parsedHeaders = Object.entries(headers).reduce((result, [key, value]) => {
77
77
  return Object.assign(Object.assign({}, result), { [key]: value.toString() });
78
78
  }, {});
@@ -84,7 +84,7 @@ function consume(topic, opts, { parent }) {
84
84
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
85
85
  finally {
86
86
  try {
87
- if (!_e && !_a && (_b = consumer_1.return)) yield _b.call(consumer_1);
87
+ if (!_f && !_b && (_c = consumer_1.return)) yield _c.call(consumer_1);
88
88
  }
89
89
  finally { if (e_1) throw e_1.error; }
90
90
  }
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function createTopic(topic, opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _a, rest = __rest(_a, ["brokers", "logLevel", "ssl"]);
24
+ function createTopic(topic_1, opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (topic, opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _b, rest = __rest(_b, ["brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const admin = yield (0, kafka_1.createAdmin)(client);
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function deleteTopic(topic, opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _a, rest = __rest(_a, ["brokers", "logLevel", "ssl"]);
24
+ function deleteTopic(topic_1, opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (topic, opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _b, rest = __rest(_b, ["brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const admin = yield (0, kafka_1.createAdmin)(client);
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function fetchTopicOffset(topic, timestamp, opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _a, rest = __rest(_a, ["brokers", "logLevel", "ssl"]);
24
+ function fetchTopicOffset(topic_1, timestamp_1, opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (topic, timestamp, opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _b, rest = __rest(_b, ["brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const admin = yield (0, kafka_1.createAdmin)(client);
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function list(opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { all, brokers, logLevel, ssl } = _a, rest = __rest(_a, ["all", "brokers", "logLevel", "ssl"]);
24
+ function list(opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { all, brokers, logLevel, ssl } = _b, rest = __rest(_b, ["all", "brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const cluster = yield (0, kafka_1.createCluster)(client);
@@ -21,9 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const kafka_1 = require("../utils/kafka");
24
- function metadata(opts, { parent }) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- const _a = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _a, rest = __rest(_a, ["brokers", "logLevel", "ssl"]);
24
+ function metadata(opts_1, _a) {
25
+ return __awaiter(this, arguments, void 0, function* (opts, { parent }) {
26
+ const _b = Object.assign(Object.assign({}, parent.opts()), opts), { brokers, logLevel, ssl } = _b, rest = __rest(_b, ["brokers", "logLevel", "ssl"]);
27
27
  const sasl = (0, kafka_1.getSASL)(rest);
28
28
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
29
29
  const cluster = yield (0, kafka_1.createCluster)(client);
@@ -81,10 +81,10 @@ function getInput(filename) {
81
81
  }
82
82
  });
83
83
  }
84
- function produce(topic, opts, { parent }) {
85
- var _a, e_1, _b, _c;
86
- return __awaiter(this, void 0, void 0, function* () {
87
- const _d = Object.assign(Object.assign({}, parent.opts()), opts), { format, header, input: filename, delay, brokers, logLevel, ssl } = _d, rest = __rest(_d, ["format", "header", "input", "delay", "brokers", "logLevel", "ssl"]);
84
+ function produce(topic_1, opts_1, _a) {
85
+ return __awaiter(this, arguments, void 0, function* (topic, opts, { parent }) {
86
+ var _b, e_1, _c, _d;
87
+ const _e = Object.assign(Object.assign({}, parent.opts()), opts), { format, header, input: filename, delay, brokers, logLevel, ssl } = _e, rest = __rest(_e, ["format", "header", "input", "delay", "brokers", "logLevel", "ssl"]);
88
88
  const sasl = (0, kafka_1.getSASL)(rest);
89
89
  const client = (0, kafka_1.createClient)(brokers, ssl, sasl, logLevel);
90
90
  const producer = yield (0, kafka_1.createProducer)(client, topic);
@@ -101,10 +101,10 @@ function produce(topic, opts, { parent }) {
101
101
  const formatter = (0, formatters_1.getFormatter)(format);
102
102
  const input = yield getInput(filename);
103
103
  try {
104
- for (var _e = true, input_1 = __asyncValues(input), input_1_1; input_1_1 = yield input_1.next(), _a = input_1_1.done, !_a; _e = true) {
105
- _c = input_1_1.value;
106
- _e = false;
107
- let { key, value, headers } = _c;
104
+ for (var _f = true, input_1 = __asyncValues(input), input_1_1; input_1_1 = yield input_1.next(), _b = input_1_1.done, !_b; _f = true) {
105
+ _d = input_1_1.value;
106
+ _f = false;
107
+ let { key, value, headers } = _d;
108
108
  const encodedValue = yield formatter.encode(value);
109
109
  const message = { key, value: encodedValue, headers: Object.assign(Object.assign({}, staticHeaders), headers) };
110
110
  producer.push(message);
@@ -114,7 +114,7 @@ function produce(topic, opts, { parent }) {
114
114
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
115
115
  finally {
116
116
  try {
117
- if (!_e && !_a && (_b = input_1.return)) yield _b.call(input_1);
117
+ if (!_f && !_b && (_c = input_1.return)) yield _c.call(input_1);
118
118
  }
119
119
  finally { if (e_1) throw e_1.error; }
120
120
  }
@@ -105,8 +105,8 @@ function createAdmin(client) {
105
105
  });
106
106
  }
107
107
  exports.createAdmin = createAdmin;
108
- function createConsumer(client, group, topic, fromBeginning = false, poolOptions = {}) {
109
- return __awaiter(this, void 0, void 0, function* () {
108
+ function createConsumer(client_1, group_1, topic_1) {
109
+ return __awaiter(this, arguments, void 0, function* (client, group, topic, fromBeginning = false, poolOptions = {}) {
110
110
  const consumerConfig = {
111
111
  groupId: group,
112
112
  };
@@ -68,8 +68,8 @@ class Pool {
68
68
  return this;
69
69
  }
70
70
  toArray() {
71
- var _a, e_1, _b, _c;
72
71
  return __awaiter(this, void 0, void 0, function* () {
72
+ var _a, e_1, _b, _c;
73
73
  const result = [];
74
74
  try {
75
75
  for (var _d = true, _e = __asyncValues(this), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kafka-console",
3
- "version": "1.3.51",
3
+ "version": "1.3.53",
4
4
  "description": "Kafka CLI tool",
5
5
  "main": "index.js",
6
6
  "bin": {