@514labs/moose-lib 0.6.276-ci-1-gfe86cd2c → 0.6.276-ci-3-g7a7bb18a
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.
- package/dist/browserCompatible.js +2 -58
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +2 -62
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +1 -1
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +1 -5
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dmv2/index.js +2 -58
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +2 -62
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -27
- package/dist/index.d.ts +2 -27
- package/dist/index.js +2 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -65
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +77 -193
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +77 -197
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -34,8 +34,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var commons_exports = {};
|
|
35
35
|
__export(commons_exports, {
|
|
36
36
|
ACKs: () => ACKs,
|
|
37
|
-
CODES: () => import_kafka_javascript.CODES,
|
|
38
|
-
KafkaConsumer: () => import_kafka_javascript.KafkaConsumer,
|
|
39
37
|
MAX_RETRIES: () => MAX_RETRIES,
|
|
40
38
|
MAX_RETRIES_PRODUCER: () => MAX_RETRIES_PRODUCER,
|
|
41
39
|
MAX_RETRY_TIME_MS: () => MAX_RETRY_TIME_MS,
|
|
@@ -44,7 +42,6 @@ __export(commons_exports, {
|
|
|
44
42
|
antiCachePath: () => antiCachePath,
|
|
45
43
|
cliLog: () => cliLog,
|
|
46
44
|
compilerLog: () => compilerLog,
|
|
47
|
-
createNativeKafkaConsumer: () => createNativeKafkaConsumer,
|
|
48
45
|
createProducerConfig: () => createProducerConfig,
|
|
49
46
|
getClickhouseClient: () => getClickhouseClient,
|
|
50
47
|
getFileName: () => getFileName,
|
|
@@ -90,13 +87,13 @@ async function getKafkaProducer(cfg, logger, maxMessageBytes) {
|
|
|
90
87
|
await producer.connect();
|
|
91
88
|
return producer;
|
|
92
89
|
}
|
|
93
|
-
var import_http, import_client, import_kafka_javascript, Kafka, compilerLog, antiCachePath, getFileName, getClickhouseClient, cliLog, MAX_RETRIES, MAX_RETRY_TIME_MS, RETRY_INITIAL_TIME_MS, MAX_RETRIES_PRODUCER, RETRY_FACTOR_PRODUCER, ACKs, parseBrokerString, logError, buildSaslConfig, getKafkaClient
|
|
90
|
+
var import_http, import_client, import_kafka_javascript, Kafka, compilerLog, antiCachePath, getFileName, getClickhouseClient, cliLog, MAX_RETRIES, MAX_RETRY_TIME_MS, RETRY_INITIAL_TIME_MS, MAX_RETRIES_PRODUCER, RETRY_FACTOR_PRODUCER, ACKs, parseBrokerString, logError, buildSaslConfig, getKafkaClient;
|
|
94
91
|
var init_commons = __esm({
|
|
95
92
|
"src/commons.ts"() {
|
|
96
93
|
"use strict";
|
|
97
94
|
import_http = __toESM(require("http"));
|
|
98
95
|
import_client = require("@clickhouse/client");
|
|
99
|
-
import_kafka_javascript = require("@
|
|
96
|
+
import_kafka_javascript = require("@514labs/kafka-javascript");
|
|
100
97
|
({ Kafka } = import_kafka_javascript.KafkaJS);
|
|
101
98
|
compilerLog = (message) => {
|
|
102
99
|
if (!isTruthy(process.env.MOOSE_DISABLE_COMPILER_LOGS)) {
|
|
@@ -197,59 +194,6 @@ var init_commons = __esm({
|
|
|
197
194
|
}
|
|
198
195
|
});
|
|
199
196
|
};
|
|
200
|
-
buildNativeSaslConfig = (logger, cfg) => {
|
|
201
|
-
if (!cfg.saslMechanism || !cfg.saslUsername || !cfg.saslPassword) {
|
|
202
|
-
return {};
|
|
203
|
-
}
|
|
204
|
-
const mechanism = cfg.saslMechanism.toUpperCase();
|
|
205
|
-
const validMechanisms = ["PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512"];
|
|
206
|
-
if (!validMechanisms.includes(mechanism)) {
|
|
207
|
-
logger.warn(`Unsupported SASL mechanism: ${cfg.saslMechanism}`);
|
|
208
|
-
return {};
|
|
209
|
-
}
|
|
210
|
-
return {
|
|
211
|
-
"sasl.mechanisms": mechanism,
|
|
212
|
-
"sasl.username": cfg.saslUsername,
|
|
213
|
-
"sasl.password": cfg.saslPassword
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
createNativeKafkaConsumer = (cfg, logger, rebalanceCb) => {
|
|
217
|
-
const brokers = parseBrokerString(cfg.broker || "");
|
|
218
|
-
if (brokers.length === 0) {
|
|
219
|
-
throw new Error(`No valid broker addresses found in: "${cfg.broker}"`);
|
|
220
|
-
}
|
|
221
|
-
logger.log(
|
|
222
|
-
`Creating native KafkaConsumer with brokers: ${brokers.join(", ")}`
|
|
223
|
-
);
|
|
224
|
-
logger.log(`Security protocol: ${cfg.securityProtocol || "plaintext"}`);
|
|
225
|
-
logger.log(`Client ID: ${cfg.clientId}`);
|
|
226
|
-
logger.log(`Group ID: ${cfg.groupId}`);
|
|
227
|
-
const saslConfig = buildNativeSaslConfig(logger, cfg);
|
|
228
|
-
const consumerConfig = {
|
|
229
|
-
// Connection
|
|
230
|
-
"bootstrap.servers": brokers.join(","),
|
|
231
|
-
"client.id": cfg.clientId,
|
|
232
|
-
// Group management
|
|
233
|
-
"group.id": cfg.groupId,
|
|
234
|
-
"session.timeout.ms": cfg.sessionTimeoutMs ?? 3e4,
|
|
235
|
-
"heartbeat.interval.ms": cfg.heartbeatIntervalMs ?? 3e3,
|
|
236
|
-
"max.poll.interval.ms": cfg.maxPollIntervalMs ?? 3e5,
|
|
237
|
-
// Offset management
|
|
238
|
-
"enable.auto.commit": cfg.autoCommit ?? true,
|
|
239
|
-
"auto.commit.interval.ms": cfg.autoCommitIntervalMs ?? 5e3,
|
|
240
|
-
// Security
|
|
241
|
-
...cfg.securityProtocol === "SASL_SSL" && {
|
|
242
|
-
"security.protocol": "sasl_ssl"
|
|
243
|
-
},
|
|
244
|
-
...saslConfig,
|
|
245
|
-
// Rebalance callback
|
|
246
|
-
...rebalanceCb && { rebalance_cb: rebalanceCb }
|
|
247
|
-
};
|
|
248
|
-
const topicConfig = {
|
|
249
|
-
"auto.offset.reset": cfg.autoOffsetReset ?? "earliest"
|
|
250
|
-
};
|
|
251
|
-
return new import_kafka_javascript.KafkaConsumer(consumerConfig, topicConfig);
|
|
252
|
-
};
|
|
253
197
|
}
|
|
254
198
|
});
|
|
255
199
|
|