kafka-ts 1.3.1-beta.2 → 1.3.1-beta.3
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.
|
@@ -33,7 +33,9 @@ const OFFSET_COMMIT_V2 = (0, api_1.createApi)({
|
|
|
33
33
|
.writeInt32(data.generationIdOrMemberEpoch)
|
|
34
34
|
.writeString(data.memberId)
|
|
35
35
|
.writeInt64(-1n) // retention_time_ms is deprecated and should be set to -1
|
|
36
|
-
.writeArray(data.topics, (encoder, topic) => encoder
|
|
36
|
+
.writeArray(data.topics, (encoder, topic) => encoder
|
|
37
|
+
.writeString(topic.name)
|
|
38
|
+
.writeArray(topic.partitions, (encoder, partition) => encoder
|
|
37
39
|
.writeInt32(partition.partitionIndex)
|
|
38
40
|
.writeInt64(partition.committedOffset)
|
|
39
41
|
.writeString(partition.committedMetadata))),
|
package/dist/auth/plain.d.ts
CHANGED
package/dist/broker.js
CHANGED
|
@@ -42,7 +42,8 @@ class Broker {
|
|
|
42
42
|
logger_1.log.warn(`Broker does not support API ${(0, api_1.getApiName)(api)} version ${api.apiVersion} (minVersion=${minVersion}, maxVersion=${maxVersion})`);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
const versionsByApiKey = Object.fromEntries(versions.map(({ apiKey, minVersion, maxVersion }) => [apiKey, { minVersion, maxVersion }]));
|
|
46
|
+
this.connection.setVersions(versionsByApiKey);
|
|
46
47
|
}
|
|
47
48
|
async saslHandshake() {
|
|
48
49
|
if (!this.options.sasl) {
|
package/dist/connection.js
CHANGED
|
@@ -118,13 +118,14 @@ class Connection {
|
|
|
118
118
|
if (!versionInfo)
|
|
119
119
|
throw new Error(`Broker does not support API ${(0, api_1.getApiName)(api)}`);
|
|
120
120
|
if (api.apiVersion < versionInfo.minVersion || api.apiVersion > versionInfo.maxVersion) {
|
|
121
|
-
if (api.fallback)
|
|
121
|
+
if (api.fallback) {
|
|
122
122
|
return this.validateVersion(api.fallback);
|
|
123
|
+
}
|
|
123
124
|
throw new Error(`Broker does not support API ${(0, api_1.getApiName)(api)} version ${api.apiVersion} (minVersion=${versionInfo.minVersion}, maxVersion=${versionInfo.maxVersion})`);
|
|
124
125
|
}
|
|
125
126
|
return api;
|
|
126
127
|
}
|
|
127
|
-
validateVersionCached = (0, cached_1.cached)(this.validateVersion, (api) => api.apiKey.toString());
|
|
128
|
+
validateVersionCached = (0, cached_1.cached)(this.validateVersion.bind(this), (api) => api.apiKey.toString());
|
|
128
129
|
async sendRequest(apiLatest, body) {
|
|
129
130
|
const api = this.validateVersionCached(apiLatest);
|
|
130
131
|
const correlationId = this.nextCorrelationId();
|